diff options
Diffstat (limited to 'configmgr/source/backend')
55 files changed, 1236 insertions, 1397 deletions
diff --git a/configmgr/source/backend/backendaccess.cxx b/configmgr/source/backend/backendaccess.cxx index c503177d4c..c84a4d7e5e 100644 --- a/configmgr/source/backend/backendaccess.cxx +++ b/configmgr/source/backend/backendaccess.cxx @@ -73,12 +73,11 @@ #define OU2A(rtlOUString) (::rtl::OUStringToOString((rtlOUString), RTL_TEXTENCODING_ASCII_US).getStr()) #define RTL_LOGFILE_OU2A(rtlOUString) OU2A(rtlOUString) -#define OUSTR(txt) OUString( RTL_CONSTASCII_USTRINGPARAM(txt) ) +#define OUSTR(txt) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(txt) ) namespace configmgr { namespace backend { //------------------------------------------------------------------------------ namespace task = com::sun::star::task; - typedef uno::Reference< backenduno::XUpdatableLayer > LayerDataRemover; inline uno::Reference<lang::XMultiServiceFactory> BackendAccess::getServiceFactory() const @@ -96,7 +95,7 @@ BackendAccess::BackendAccess( { OSL_ENSURE(mContext.is(), "BackendAccess: Context is missing"); if (!mContext.is()) - throw lang::NullPointerException(OUString::createFromAscii("BackendAccess: NULL Context passed"), NULL); + throw lang::NullPointerException(rtl::OUString::createFromAscii("BackendAccess: NULL Context passed"), NULL); if (!xBackend.is()) throw lang::NullPointerException(OUSTR("Configuration: Trying to create backend access without backend"),NULL); if (!uno::Reference<backenduno::XSchemaSupplier>::query(xBackend).is()) @@ -119,15 +118,13 @@ BackendAccess::~BackendAccess() {} //------------------------------------------------------------------------------ namespace { - using localehelper::Locale; - using localehelper::LocaleSequence; //------------------------------------------------------------------------------ static inline - bool findLocale(LocaleSequence const & seq, Locale const & loc) + bool findLocale(std::vector< com::sun::star::lang::Locale > const & seq, com::sun::star::lang::Locale const & loc) { - LocaleSequence::const_iterator first = seq.begin(); - LocaleSequence::const_iterator last = seq.end(); + std::vector< com::sun::star::lang::Locale >::const_iterator first = seq.begin(); + std::vector< com::sun::star::lang::Locale >::const_iterator last = seq.end(); for ( ; first != last; ++first) if (localehelper::equalLocale(*first, loc)) return true; @@ -136,14 +133,14 @@ namespace //------------------------------------------------------------------------------ static inline - void addLocale( Locale const & aLocale, LocaleSequence & inoutLocales) + void addLocale( com::sun::star::lang::Locale const & aLocale, std::vector< com::sun::star::lang::Locale > & inoutLocales) { if (!findLocale(inoutLocales,aLocale)) inoutLocales.push_back(aLocale); } //------------------------------------------------------------------------------ - static OUString toString(uno::Sequence< OUString > const & seq, sal_Unicode separator = ',') + static rtl::OUString toString(uno::Sequence< rtl::OUString > const & seq, sal_Unicode separator = ',') { rtl::OUStringBuffer buf; @@ -161,13 +158,13 @@ namespace //------------------------------------------------------------------------------ static - uno::Sequence< OUString > intersect(uno::Sequence< OUString > const & seq1, uno::Sequence< OUString > const & seq2) + uno::Sequence< rtl::OUString > intersect(uno::Sequence< rtl::OUString > const & seq1, uno::Sequence< rtl::OUString > const & seq2) { sal_Int32 const len1 = seq1.getLength(); - uno::Sequence< OUString > aResult(len1); + uno::Sequence< rtl::OUString > aResult(len1); - OUString const * const beg2 = seq2.getConstArray(); - OUString const * const end2 = beg2 + seq2.getLength(); + rtl::OUString const * const beg2 = seq2.getConstArray(); + rtl::OUString const * const end2 = beg2 + seq2.getLength(); sal_Int32 ix = 0; for (sal_Int32 i1 = 0; i1 < len1; ++i1) @@ -212,17 +209,17 @@ uno::Sequence< rtl::OUString > return aResult; } //------------------------------------------------------------------------------ -static OUString getLayerURL(const uno::Reference<backenduno::XLayer> & aLayer); +static rtl::OUString getLayerURL(const uno::Reference<backenduno::XLayer> & aLayer); void BackendAccess::merge( MergedComponentData& aData, const uno::Reference<backenduno::XLayer> * pLayers, sal_Int32 aNumLayers, - localehelper::Locale const & aRequestedLocale, - localehelper::LocaleSequence & inoutMergedLocales, + com::sun::star::lang::Locale const & aRequestedLocale, + std::vector< com::sun::star::lang::Locale > & inoutMergedLocales, ITemplateDataProvider *aTemplateProvider, sal_Int32 * pLayersMerged) - CFG_UNO_THROW_ALL() + SAL_THROW((com::sun::star::uno::Exception)) { LayerMergeHandler * pMerger = new LayerMergeHandler(mContext, aData, aTemplateProvider ); uno::Reference<backenduno::XLayerHandler> xLayerMerger(pMerger); @@ -232,7 +229,7 @@ void BackendAccess::merge( RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::BackendAccess", "jb99855", "configmgr: BackendAccess::merge()"); RTL_LOGFILE_CONTEXT_TRACE1(aLog, "merging %d layers", int(aNumLayers) ); - OUString const & aLanguage = aRequestedLocale.Language; + rtl::OUString const & aLanguage = aRequestedLocale.Language; bool const needAllLanguages = localehelper::isAnyLanguage(aLanguage); if (aLanguage.getLength() && !needAllLanguages) @@ -280,8 +277,8 @@ void BackendAccess::merge( for (sal_Int32 j = 0; j < aSubLayerIds.getLength(); ++j) { - OUString const & aLocaleIso = aSubLayerIds[j]; - Locale aLocale = localehelper::makeLocale(aLocaleIso); + rtl::OUString const & aLocaleIso = aSubLayerIds[j]; + com::sun::star::lang::Locale aLocale = localehelper::makeLocale(aLocaleIso); // requesting de-CH, we accept de-CH and de, but not de-DE const localehelper::MatchQuality kMatchAccept = localehelper::MATCH_LANGUAGE_PLAIN; @@ -306,22 +303,22 @@ void BackendAccess::merge( //------------------------------------------------------------------------------ bool BackendAccess::readDefaultData( MergedComponentData & aComponentData, - OUString const & aComponent, + rtl::OUString const & aComponent, RequestOptions const & aOptions, bool bIncludeTemplates, const uno::Reference<backenduno::XLayer> * pLayers, sal_Int32 nNumLayers, ITemplateDataProvider *aTemplateProvider, sal_Int32 * pLayersMerged) - CFG_UNO_THROW_ALL() + SAL_THROW((com::sun::star::uno::Exception)) { RTL_LOGFILE_CONTEXT_AUTHOR(aLog1, "configmgr::backend::BackendAccess", "jb99855", "configmgr: BackendAccess::readDefaultData()"); Logger logger(mContext); - const Logger::Level detail = LogLevel::FINER; + const sal_Int32 detail = LogLevel::FINER; bool const bLogDetail = logger.isLogging(detail); - OUString const aSchemaVersion = this->getSchemaVersion(aComponent); + rtl::OUString const aSchemaVersion = this->getSchemaVersion(aComponent); if (logger.isLogging(LogLevel::FINE)) { @@ -332,8 +329,8 @@ bool BackendAccess::readDefaultData( MergedComponentData & aComponentData, logger.fine( aMsg.makeStringAndClear(), "readDefaultData()","configmgr::Backend"); } - localehelper::Locale const aRequestedLocale = localehelper::makeLocale(aOptions.getLocale()); - localehelper::LocaleSequence aKnownLocales; + com::sun::star::lang::Locale const aRequestedLocale = localehelper::makeLocale(aOptions.getLocale()); + std::vector< com::sun::star::lang::Locale > aKnownLocales; if (bLogDetail) logger.log(detail, "... attempt to read from binary cache", "readDefaultData()","configmgr::Backend"); bool bCacheHit = mBinaryCache.readComponentData(aComponentData, getServiceFactory(), @@ -384,7 +381,7 @@ bool BackendAccess::readDefaultData( MergedComponentData & aComponentData, } //------------------------------------------------------------------------------ -static OUString getLayerURL(const uno::Reference<backenduno::XLayer> & aLayer) +static rtl::OUString getLayerURL(const uno::Reference<backenduno::XLayer> & aLayer) { try { @@ -393,7 +390,7 @@ static OUString getLayerURL(const uno::Reference<backenduno::XLayer> & aLayer) if (xLayerProps.is()) { uno::Any aPropVal = xLayerProps->getPropertyValue( OUSTR("URL") ); - OUString aResult; + rtl::OUString aResult; if (aPropVal >>= aResult) return aResult; } @@ -405,11 +402,11 @@ static OUString getLayerURL(const uno::Reference<backenduno::XLayer> & aLayer) } // TODO: use better fallback, e.g. ServiceName const char * const aFallback = aLayer.is() ? "<Unknown Layer Type>" : "<NULL Layer>"; - return OUString::createFromAscii(aFallback); + return rtl::OUString::createFromAscii(aFallback); } //------------------------------------------------------------------------------ static inline -OUString getLayerIdentifier(const uno::Reference<backenduno::XLayer> & aLayer) +rtl::OUString getLayerIdentifier(const uno::Reference<backenduno::XLayer> & aLayer) { return getLayerURL(aLayer); } @@ -419,7 +416,7 @@ static void removeLayerData(uno::Reference< backenduno::XLayer > const & xLayer) { OSL_ASSERT(xLayer.is()); - LayerDataRemover xLayerRemover(xLayer,uno::UNO_QUERY); + uno::Reference< backenduno::XUpdatableLayer > xLayerRemover(xLayer,uno::UNO_QUERY); if (xLayerRemover.is()) try { @@ -494,21 +491,19 @@ private: bool BackendAccess::approveRecovery(const uno::Any & aMergeException, const uno::Reference<backenduno::XLayer> & aBrokenLayer, bool bUserLayerData) - CFG_UNO_THROW_ALL() + SAL_THROW((com::sun::star::uno::Exception)) { - using namespace apihelper; - typedef SimpleInteractionRequest::Continuation Choice; - Choice const k_supported_choices = CONTINUATION_APPROVE | CONTINUATION_DISAPPROVE; + sal_uInt32 const k_supported_choices = apihelper::CONTINUATION_APPROVE | apihelper::CONTINUATION_DISAPPROVE; - Choice chosen = CONTINUATION_UNKNOWN; + sal_uInt32 chosen = apihelper::CONTINUATION_UNKNOWN; - ConfigurationInteractionHandler handler; + apihelper::ConfigurationInteractionHandler handler; try { uno::Reference< task::XInteractionHandler > h(handler.get()); if (h.is()) { handler.setRecursive(new RecursiveHandler(h)); - rtl::Reference< SimpleInteractionRequest > req( - new SimpleInteractionRequest( + rtl::Reference< apihelper::SimpleInteractionRequest > req( + new apihelper::SimpleInteractionRequest( uno::makeAny( backenduno::MergeRecoveryRequest( rtl::OUString( @@ -518,7 +513,7 @@ bool BackendAccess::approveRecovery(const uno::Any & aMergeException, aBrokenLayer, aMergeException, getLayerIdentifier(aBrokenLayer), (bUserLayerData - && (LayerDataRemover::query(aBrokenLayer).is() + && (uno::Reference< backenduno::XUpdatableLayer >::query(aBrokenLayer).is() || FileHelper::fileExists( getLayerURL(aBrokenLayer)))))), k_supported_choices)); @@ -531,9 +526,9 @@ bool BackendAccess::approveRecovery(const uno::Any & aMergeException, switch (chosen) { - case CONTINUATION_APPROVE: return true; - case CONTINUATION_DISAPPROVE: return false; - case CONTINUATION_UNKNOWN: break; + case apihelper::CONTINUATION_APPROVE: return true; + case apihelper::CONTINUATION_DISAPPROVE: return false; + case apihelper::CONTINUATION_UNKNOWN: break; default: OSL_ENSURE(false,"Unsolicited continuation chosen"); break; } @@ -542,12 +537,12 @@ bool BackendAccess::approveRecovery(const uno::Any & aMergeException, } //------------------------------------------------------------------------------ -ComponentResult BackendAccess::getNodeData(const ComponentRequest& aRequest, +ResultHolder< ComponentInstance > BackendAccess::getNodeData(const ComponentRequest& aRequest, ITemplateDataProvider *_aTemplateProvider, INodeDataListener *aListener) - CFG_UNO_THROW_ALL() + SAL_THROW((com::sun::star::uno::Exception)) { - rtl::OUString const component = aRequest.getComponentName().toString() ; + rtl::OUString const component = aRequest.getComponentName(); ITemplateDataProvider * const aTemplateProvider = _aTemplateProvider ? _aTemplateProvider : this; RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::BackendAccess", "jb99855", "configmgr: BackendAccess::getNodeData()"); @@ -587,7 +582,7 @@ ComponentResult BackendAccess::getNodeData(const ComponentRequest& aRequest, //Merge User layer (with all locales) logger.finer("... merging user layer", "getNodeData()","configmgr::Backend"); - localehelper::LocaleSequence aLocales; + std::vector< com::sun::star::lang::Locale > aLocales; merge(aComponentData, layers.getConstArray()+nNumDefaultLayers, nNumUserLayers, localehelper::getAnyLocale(), aLocales, aTemplateProvider ); @@ -607,7 +602,7 @@ ComponentResult BackendAccess::getNodeData(const ComponentRequest& aRequest, { mNotifier->addListener(aListener, aRequest); } - return ComponentResult(retCode) ; + return ResultHolder< ComponentInstance >(retCode) ; } catch (com::sun::star::container::NoSuchElementException &) { throw; } catch (com::sun::star::uno::RuntimeException &) { throw; } @@ -648,11 +643,11 @@ ComponentResult BackendAccess::getNodeData(const ComponentRequest& aRequest, //------------------------------------------------------------------------------ void BackendAccess::updateNodeData(const UpdateRequest& aUpdate) - CFG_UNO_THROW_ALL() + SAL_THROW((com::sun::star::uno::Exception)) { rtl::OUString entity = aUpdate.getOptions().getEntity() ; rtl::OUString component = - aUpdate.getUpdateRoot().getModuleName().toString() ; + aUpdate.getUpdateRoot().getModuleName(); uno::Reference<backenduno::XUpdateHandler> handler ; RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::BackendAccess", "jb99855", "configmgr: BackendAccess::updateNodeData()"); @@ -664,15 +659,15 @@ void BackendAccess::updateNodeData(const UpdateRequest& aUpdate) else { handler = mBackend->getUpdateHandler(component, entity) ; } UpdateDispatcher dispatcher(handler, aUpdate.getOptions().getLocale()) ; - dispatcher.dispatchUpdate(aUpdate.getUpdateRoot().location(), + dispatcher.dispatchUpdate(aUpdate.getUpdateRoot(), *aUpdate.getUpdateData()) ; } //------------------------------------------------------------------------------ -NodeResult BackendAccess::getDefaultData(const NodeRequest& aRequest) - CFG_UNO_THROW_ALL() +ResultHolder< NodeInstance > BackendAccess::getDefaultData(const NodeRequest& aRequest) + SAL_THROW((com::sun::star::uno::Exception)) { - rtl::OUString const component = aRequest.getPath().getModuleName().toString() ; + rtl::OUString const component = aRequest.getPath().getModuleName(); RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::BackendAccess", "jb99855", "configmgr: BackendAccess::getDefaultData()"); RTL_LOGFILE_CONTEXT_TRACE1(aLog, "request path: %s", RTL_LOGFILE_OU2A(aRequest.getPath().toString()) ); @@ -694,19 +689,19 @@ NodeResult BackendAccess::getDefaultData(const NodeRequest& aRequest) sMessage.append(component); sMessage.appendAscii("\" contains no default data. "); - OUString const sMsg = sMessage.makeStringAndClear(); + rtl::OUString const sMsg = sMessage.makeStringAndClear(); Logger(mContext).finer(sMsg,"getDefaultData()","configmgr::BackendAccess"); throw com::sun::star::container::NoSuchElementException(sMsg,mBackend); } std::auto_ptr<ISubtree> aResultTree = aComponentData.extractSchemaTree(); - AbsolutePath aPath = aRequest.getPath(); + configuration::AbsolutePath aPath = aRequest.getPath(); if( aPath.begin() != aPath.end()) { - for(AbsolutePath::Iterator it=aPath.begin()+1,endIt=aPath.end();it!=endIt; ++it) + for(std::vector<configuration::Path::Component>::const_reverse_iterator it=aPath.begin()+1,endIt=aPath.end();it!=endIt; ++it) { - std::auto_ptr<INode> aChild=aResultTree->removeChild(it->getName().toString()); + std::auto_ptr<INode> aChild=aResultTree->removeChild(it->getName()); if(aChild.get()== NULL) { rtl::OUStringBuffer sMessage; @@ -714,7 +709,7 @@ NodeResult BackendAccess::getDefaultData(const NodeRequest& aRequest) sMessage.append(aPath.toString()); sMessage.appendAscii("\" does not exist in the default data. "); - OUString const sMsg = sMessage.makeStringAndClear(); + rtl::OUString const sMsg = sMessage.makeStringAndClear(); Logger(mContext).finest(sMsg,"getDefaultData()","configmgr::BackendAccess"); throw com::sun::star::container::NoSuchElementException(sMsg,mBackend); } @@ -722,9 +717,9 @@ NodeResult BackendAccess::getDefaultData(const NodeRequest& aRequest) ISubtree *pChildAsSubtree = aChild->asISubtree(); if(pChildAsSubtree == NULL) { - OUString sMsg = OUString::createFromAscii("BackendAccess::getDefaultData - Node Expected, Found Property: ").concat(it->getName().toString()); + rtl::OUString sMsg = rtl::OUString::createFromAscii("BackendAccess::getDefaultData - Node Expected, Found Property: ").concat(it->getName()); Logger(mContext).finer(sMsg,"getDefaultData()","configmgr::BackendAccess"); - throw MalformedDataException(sMsg, mBackend, uno::Any()); + throw backenduno::MalformedDataException(sMsg, mBackend, uno::Any()); } aResultTree.reset(pChildAsSubtree); aChild.release(); @@ -732,14 +727,14 @@ NodeResult BackendAccess::getDefaultData(const NodeRequest& aRequest) } NodeInstance retCode(aResultTree, aRequest.getPath()) ; - return NodeResult(retCode) ; + return ResultHolder< NodeInstance >(retCode) ; } //------------------------------------------------------------------------------ -TemplateResult BackendAccess::getTemplateData(const TemplateRequest& aRequest) - CFG_UNO_THROW_ALL() +ResultHolder< TemplateInstance > BackendAccess::getTemplateData(const TemplateRequest& aRequest) + SAL_THROW((com::sun::star::uno::Exception)) { - rtl::OUString component = aRequest.getComponentName().toString(); + rtl::OUString component = aRequest.getComponentName(); RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::BackendAccess", "jb99855", "configmgr: BackendAccess::getTemplateData()"); RTL_LOGFILE_CONTEXT_TRACE2(aLog, "requested template: %s/%s", @@ -765,18 +760,18 @@ TemplateResult BackendAccess::getTemplateData(const TemplateRequest& aRequest) else { backenduno::TemplateIdentifier templateId ; - templateId.Name = aRequest.getTemplateName().toString() ; - templateId.Component = aRequest.getComponentName().toString() ; + templateId.Name = aRequest.getTemplateName(); + templateId.Component = aRequest.getComponentName(); aResultData = aComponentData.extractTemplateNode(templateId.Name); } TemplateInstance retCode(aResultData,aRequest.getTemplateName(), aRequest.getComponentName()) ; - return TemplateResult(retCode) ; + return ResultHolder< TemplateInstance >(retCode) ; } //------------------------------------------------------------------------------ -uno::Reference< backenduno::XSchema > BackendAccess::getSchema(const OUString& aComponent) +uno::Reference< backenduno::XSchema > BackendAccess::getSchema(const rtl::OUString& aComponent) { uno::Reference< backenduno::XSchemaSupplier > xSchemaBackend(mBackend, uno::UNO_QUERY_THROW); OSL_ASSERT(xSchemaBackend.is()); @@ -789,7 +784,7 @@ uno::Reference< backenduno::XSchema > BackendAccess::getSchema(const OUString& a sMessage.append(aComponent); sMessage.appendAscii("\" is unknown. [No schema available]"); - OUString const sMsg = sMessage.makeStringAndClear(); + rtl::OUString const sMsg = sMessage.makeStringAndClear(); Logger(mContext).warning(sMsg,"getSchema()","configmgr::BackendAccess"); throw com::sun::star::container::NoSuchElementException(sMsg,xSchemaBackend); } @@ -798,17 +793,17 @@ uno::Reference< backenduno::XSchema > BackendAccess::getSchema(const OUString& a } //------------------------------------------------------------------------------ -OUString BackendAccess::getSchemaVersion(const OUString& aComponent) +rtl::OUString BackendAccess::getSchemaVersion(const rtl::OUString& aComponent) { uno::Reference< backenduno::XVersionedSchemaSupplier > xSchemaBackend(mBackend, uno::UNO_QUERY); if (xSchemaBackend.is()) return xSchemaBackend->getSchemaVersion(aComponent); else - return OUString(); + return rtl::OUString(); } //------------------------------------------------------------------------------ -uno::Sequence< uno::Reference<backenduno::XLayer> > BackendAccess::getLayers(const OUString& aComponent,const RequestOptions& aOptions) +uno::Sequence< uno::Reference<backenduno::XLayer> > BackendAccess::getLayers(const rtl::OUString& aComponent,const RequestOptions& aOptions) { rtl::OUString aEntity = aOptions.getEntity() ; @@ -825,7 +820,7 @@ uno::Sequence< uno::Reference<backenduno::XLayer> > BackendAccess::getLayers(con //------------------------------------------------------------------------------ void BackendAccess::removeRequestListener(INodeDataListener *aListener, const ComponentRequest& aRequest) - CFG_NOTHROW() + SAL_THROW(()) { OSL_PRECOND(aListener, "ERROR: trying to remove a NULL listener"); diff --git a/configmgr/source/backend/backendaccess.hxx b/configmgr/source/backend/backendaccess.hxx index acdefb8fac..2a53cb7a0f 100644 --- a/configmgr/source/backend/backendaccess.hxx +++ b/configmgr/source/backend/backendaccess.hxx @@ -71,50 +71,49 @@ class BackendAccess : public IMergedDataProvider ~BackendAccess(void) ; // IMergedDataProvider - virtual ComponentResult getNodeData(const ComponentRequest& aRequest, + virtual ResultHolder< ComponentInstance > getNodeData(const ComponentRequest& aRequest, ITemplateDataProvider* aTemplateProvider, INodeDataListener *aListener = NULL) - CFG_UNO_THROW_ALL() ; + SAL_THROW((com::sun::star::uno::Exception)) ; virtual void removeRequestListener(INodeDataListener *aListener, const ComponentRequest& aRequest) - CFG_NOTHROW(); + SAL_THROW(()); virtual void updateNodeData(const UpdateRequest& aUpdate) - CFG_UNO_THROW_ALL() ; - virtual NodeResult getDefaultData(const NodeRequest& aRequest) - CFG_UNO_THROW_ALL() ; - virtual TemplateResult getTemplateData(const TemplateRequest& aRequest) - CFG_UNO_THROW_ALL() ; - virtual bool isStrippingDefaults(void) CFG_NOTHROW() { return false ; } + SAL_THROW((com::sun::star::uno::Exception)) ; + virtual ResultHolder< NodeInstance > getDefaultData(const NodeRequest& aRequest) + SAL_THROW((com::sun::star::uno::Exception)) ; + virtual ResultHolder< TemplateInstance > getTemplateData(const TemplateRequest& aRequest) + SAL_THROW((com::sun::star::uno::Exception)) ; private : /** Retrieves the schema of a component. */ - uno::Reference< backenduno::XSchema > getSchema(const OUString& aComponent) ; + uno::Reference< backenduno::XSchema > getSchema(const rtl::OUString& aComponent) ; /** Retrieves the schema version of a component. */ - OUString getSchemaVersion(const OUString& aComponent) ; + rtl::OUString getSchemaVersion(const rtl::OUString& aComponent) ; /** Retrieves the layers for a request. */ - uno::Sequence< uno::Reference<backenduno::XLayer> > getLayers(const OUString& aComponent,const RequestOptions& aOptions) ; + uno::Sequence< uno::Reference<backenduno::XLayer> > getLayers(const rtl::OUString& aComponent,const RequestOptions& aOptions) ; /** Reads merged default data with a given number of layers. */ bool readDefaultData( MergedComponentData & aComponentData, - OUString const & aComponent, + rtl::OUString const & aComponent, RequestOptions const & aOptions, bool bIncludeTemplates, const uno::Reference<backenduno::XLayer> * pLayers, sal_Int32 nNumLayers, ITemplateDataProvider *aTemplateProvider, sal_Int32 * pLayersMerged = 0) - CFG_UNO_THROW_ALL(); + SAL_THROW((com::sun::star::uno::Exception)); /** Merges layers onto component data. */ @@ -122,11 +121,11 @@ class BackendAccess : public IMergedDataProvider MergedComponentData& aData, const uno::Reference<backenduno::XLayer> * pLayers, sal_Int32 aNumLayers, - localehelper::Locale const & aRequestedLocale, - localehelper::LocaleSequence & inoutMergedLocales, + com::sun::star::lang::Locale const & aRequestedLocale, + std::vector< com::sun::star::lang::Locale > & inoutMergedLocales, ITemplateDataProvider *aTemplateProvider, sal_Int32 * pLayersMerged = 0) - CFG_UNO_THROW_ALL(); + SAL_THROW((com::sun::star::uno::Exception)); private : /** Decides if merging should be retried after an exception. @@ -138,7 +137,7 @@ class BackendAccess : public IMergedDataProvider const uno::Any & aMergeException, const uno::Reference<backenduno::XLayer> & aBrokenLayer, bool bUserLayerData) - CFG_UNO_THROW_ALL(); + SAL_THROW((com::sun::star::uno::Exception)); private : /** Get the factory used for service invocation */ diff --git a/configmgr/source/backend/backendfactory.cxx b/configmgr/source/backend/backendfactory.cxx index f9ef286a5e..eda39e38ef 100644 --- a/configmgr/source/backend/backendfactory.cxx +++ b/configmgr/source/backend/backendfactory.cxx @@ -67,7 +67,7 @@ const sal_Char k_DefaultBackendServiceAndImplName[] = K_DefaultBackendSe const sal_Char k_GenericBackendServiceAndImplName[] = "com.sun.star.configuration.backend.Backend" ; // ------------------------------------------------------------------------- -static AsciiServiceName const k_BackendServiceNames [] = +static sal_Char const * const k_BackendServiceNames [] = { k_DefaultBackendServiceAndImplName, k_GenericBackendServiceAndImplName, @@ -109,7 +109,7 @@ const ServiceRegistrationInfo * getDefaultBackendServiceInfo() // ------------------------------------------------------------------------- uno::Reference<uno::XInterface> SAL_CALL - getDefaultBackendSingleton( CreationContext const& xContext ) + getDefaultBackendSingleton( com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > const& xContext ) { OSL_ENSURE( xContext.is(), "ERROR: NULL context has no singletons" ); @@ -146,12 +146,8 @@ uno::Reference<uno::XInterface> SAL_CALL // ------------------------------------------------------------------------- // ------------------------------------------------------------------------- -typedef BackendFactory::CreationContext CreationContext; -typedef uno::Sequence< uno::Any > UnoInitArgs; -// ------------------------------------------------------------------------- - static -UnoInitArgs createInitArgs(ContextReader const & _aContext) +uno::Sequence< uno::Any > createInitArgs(ContextReader const & _aContext) { OSL_ASSERT(_aContext.hasBootstrapContext()); uno::Sequence< uno::Any > aResult( 1 ); @@ -162,50 +158,47 @@ UnoInitArgs createInitArgs(ContextReader const & _aContext) static inline -uno::Reference< uno::XInterface > createService(ContextReader const & _aCtx, UnoInitArgs const & _aInitArgs, OUString const & _aSvc) +uno::Reference< uno::XInterface > createService(ContextReader const & _aCtx, uno::Sequence< uno::Any > const & _aInitArgs, rtl::OUString const & _aSvc) { uno::Reference< lang::XMultiComponentFactory > xFactory = _aCtx.getServiceManager(); OSL_ENSURE(xFactory.is(),"ERROR: ComponentContext has no service manager\n"); - if (!xFactory.is()) throw uno::RuntimeException( OUString::createFromAscii("ERROR: ComponentContext has no service manager\n"), NULL ); + if (!xFactory.is()) throw uno::RuntimeException( rtl::OUString::createFromAscii("ERROR: ComponentContext has no service manager\n"), NULL ); return xFactory->createInstanceWithArgumentsAndContext( _aSvc, _aInitArgs, _aCtx.getBaseContext()); } // ------------------------------------------------------------------------- -typedef uno::Reference< backenduno::XMultiLayerStratum > UnoSingleBackend; -typedef uno::Reference< backenduno::XBackend > UnoBackend; - static -UnoBackend wrapSingleBackend(ContextReader const & _aSettings, UnoInitArgs const & _aInitArgs, UnoSingleBackend const & _xWrappedBackend) +uno::Reference< backenduno::XBackend > wrapSingleBackend(ContextReader const & _aSettings, uno::Sequence< uno::Any > const & _aInitArgs, uno::Reference< backenduno::XMultiLayerStratum > const & _xWrappedBackend) { OSL_ASSERT(_aSettings.hasUnoBackendWrapper() || _aSettings.hasBootstrapContext()); - OUString aWrapperSvc = _aSettings.hasUnoBackendWrapper() ? + rtl::OUString aWrapperSvc = _aSettings.hasUnoBackendWrapper() ? _aSettings.getUnoBackendWrapper() : - OUString::createFromAscii(k_DefaultBackendWrapper); + rtl::OUString::createFromAscii(k_DefaultBackendWrapper); OSL_ENSURE (aWrapperSvc.getLength(), "ERROR: No wrapper service for wrapped configuration"); OSL_ENSURE (_xWrappedBackend.is(), "ERROR: No backend to wrap for wrapped configuration"); sal_Int32 const nBaseArgsCount = _aInitArgs.getLength(); - UnoInitArgs aExtendedArgs( _aInitArgs ); + uno::Sequence< uno::Any > aExtendedArgs( _aInitArgs ); aExtendedArgs.realloc( nBaseArgsCount + 1 ); aExtendedArgs[nBaseArgsCount] <<= _xWrappedBackend; - return UnoBackend::query( createService(_aSettings,aExtendedArgs,aWrapperSvc) ); + return uno::Reference< backenduno::XBackend >::query( createService(_aSettings,aExtendedArgs,aWrapperSvc) ); } // ------------------------------------------------------------------------- static -UnoBackend createOfflineBackend(ContextReader const & _aSettings, UnoInitArgs const & _aInitArgs) +uno::Reference< backenduno::XBackend > createOfflineBackend(ContextReader const & _aSettings, uno::Sequence< uno::Any > const & _aInitArgs) { OSL_ASSERT(_aSettings.hasUnoBackendWrapper() || _aSettings.hasBootstrapContext()); - UnoBackend xResult; + uno::Reference< backenduno::XBackend > xResult; if ( _aSettings.hasUnoBackendWrapper() ) { - OUString const aWrapperSvc = _aSettings.getUnoBackendWrapper(); + rtl::OUString const aWrapperSvc = _aSettings.getUnoBackendWrapper(); - xResult = UnoBackend::query( createService(_aSettings,_aInitArgs,aWrapperSvc) ); + xResult = uno::Reference< backenduno::XBackend >::query( createService(_aSettings,_aInitArgs,aWrapperSvc) ); } return xResult; @@ -213,13 +206,13 @@ UnoBackend createOfflineBackend(ContextReader const & _aSettings, UnoInitArgs co // ------------------------------------------------------------------------- static -uno::Reference< uno::XInterface > createRealBackend(ContextReader const & _aSettings, UnoInitArgs const & _aInitArgs) +uno::Reference< uno::XInterface > createRealBackend(ContextReader const & _aSettings, uno::Sequence< uno::Any > const & _aInitArgs) { OSL_ASSERT(_aSettings.hasUnoBackendService() || _aSettings.hasBootstrapContext()); - OUString const aBackendServiceName = _aSettings.hasUnoBackendService() ? + rtl::OUString const aBackendServiceName = _aSettings.hasUnoBackendService() ? _aSettings.getUnoBackendService() : - OUString::createFromAscii(k_DefaultBackendService); + rtl::OUString::createFromAscii(k_DefaultBackendService); uno::Reference< uno::XInterface > xResult = createService(_aSettings,_aInitArgs,aBackendServiceName); @@ -229,18 +222,18 @@ uno::Reference< uno::XInterface > createRealBackend(ContextReader const & _aSett // ------------------------------------------------------------------------- static -UnoBackend createOnlineBackend(ContextReader const & _aSettings, UnoInitArgs const & _aInitArgs) +uno::Reference< backenduno::XBackend > createOnlineBackend(ContextReader const & _aSettings, uno::Sequence< uno::Any > const & _aInitArgs) { OSL_ENSURE( _aSettings.isUnoBackend(), "ERROR - BackendFactory: For legacy backends use createSessionBackend()"); - UnoBackend xResult; + uno::Reference< backenduno::XBackend > xResult; uno::Reference< uno::XInterface > xRealBackend = createRealBackend(_aSettings,_aInitArgs); if (_aSettings.hasUnoBackendWrapper()) { // try wrapping a single backend - UnoSingleBackend xSingleRealBackend( xRealBackend, uno::UNO_QUERY); + uno::Reference< backenduno::XMultiLayerStratum > xSingleRealBackend( xRealBackend, uno::UNO_QUERY); if (xSingleRealBackend.is()) xResult = wrapSingleBackend(_aSettings,_aInitArgs,xSingleRealBackend); @@ -255,7 +248,7 @@ UnoBackend createOnlineBackend(ContextReader const & _aSettings, UnoInitArgs con if (!xResult.is()) { // try the default wrapper if we only have a single backend - UnoSingleBackend xSingleRealBackend( xRealBackend, uno::UNO_QUERY); + uno::Reference< backenduno::XMultiLayerStratum > xSingleRealBackend( xRealBackend, uno::UNO_QUERY); if (xSingleRealBackend.is()) xResult = wrapSingleBackend(_aSettings,_aInitArgs,xSingleRealBackend); @@ -268,16 +261,16 @@ UnoBackend createOnlineBackend(ContextReader const & _aSettings, UnoInitArgs con } // ------------------------------------------------------------------------- -static UnoBackend createUnoBackend(CreationContext const& _xCtx) +static uno::Reference< backenduno::XBackend > createUnoBackend(com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > const& _xCtx) { ContextReader aSettings(_xCtx); OSL_ENSURE( aSettings.isUnoBackend(), "ERROR - BackendFactory: Legacy backends are not supported any more"); - UnoInitArgs aArguments = createInitArgs(aSettings); + uno::Sequence< uno::Any > aArguments = createInitArgs(aSettings); sal_Bool bOffline = aSettings.hasOfflineSetting() ? aSettings.getOfflineSetting() : !aSettings.hasUnoBackendService(); - UnoBackend xResult; + uno::Reference< backenduno::XBackend > xResult; if (!bOffline) xResult = createOnlineBackend (aSettings,aArguments); @@ -294,9 +287,9 @@ static UnoBackend createUnoBackend(CreationContext const& _xCtx) // ------------------------------------------------------------------------- -uno::Reference<uno::XInterface> SAL_CALL instantiateDefaultBackend( CreationContext const& xTargetContext ) +uno::Reference<uno::XInterface> SAL_CALL instantiateDefaultBackend( com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > const& xTargetContext ) { - CreationContext xContext = UnoContextTunnel::recoverContext(xTargetContext); + com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > xContext = UnoContextTunnel::recoverContext(xTargetContext); try { @@ -309,9 +302,9 @@ uno::Reference<uno::XInterface> SAL_CALL instantiateDefaultBackend( CreationCont } // ------------------------------------------------------------------------- -UnoBackend BackendFactory::getUnoBackend() +uno::Reference< backenduno::XBackend > BackendFactory::getUnoBackend() { - return UnoBackend::query( getDefaultBackendSingleton(m_xCtx) ); + return uno::Reference< backenduno::XBackend >::query( getDefaultBackendSingleton(m_xCtx) ); } // ------------------------------------------------------------------------- @@ -319,7 +312,7 @@ rtl::Reference<IMergedDataProvider> BackendFactory::createBackend() { rtl::Reference< IMergedDataProvider > xBackend; - UnoBackend xBackendService = this->getUnoBackend(); + uno::Reference< backenduno::XBackend > xBackendService = this->getUnoBackend(); if (xBackendService.is()) xBackend = new BackendAccess(xBackendService, m_xCtx); @@ -328,7 +321,7 @@ rtl::Reference<IMergedDataProvider> BackendFactory::createBackend() } // ------------------------------------------------------------------------- -BackendFactory BackendFactory::instance(CreationContext const & _xCtx) +BackendFactory BackendFactory::instance(com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > const & _xCtx) { return BackendFactory(_xCtx); } diff --git a/configmgr/source/backend/backendnotifier.cxx b/configmgr/source/backend/backendnotifier.cxx index be4199c10a..2deb007382 100644 --- a/configmgr/source/backend/backendnotifier.cxx +++ b/configmgr/source/backend/backendnotifier.cxx @@ -65,7 +65,7 @@ void SAL_CALL BackendChangeNotifier::componentDataChanged(const backenduno::Comp throw (::com::sun::star::uno::RuntimeException) { rtl::OUString aComponentName = _aEvent.Component; - ListenerList::iterator aIter = m_aListeners.find(aComponentName); + std::map<rtl::OUString, ComponentNotifier>::iterator aIter = m_aListeners.find(aComponentName); if(aIter != m_aListeners.end()) { aIter->second.notifyListeners(aComponentName); @@ -83,17 +83,17 @@ throw (uno::RuntimeException) m_aListeners.clear(); } // ----------------------------------------------------------------------------- -void BackendChangeNotifier::addListener(INodeDataListener * _xListener, const ComponentRequest& _aRequest) CFG_NOTHROW() +void BackendChangeNotifier::addListener(INodeDataListener * _xListener, const ComponentRequest& _aRequest) SAL_THROW(()) { osl::MutexGuard aListGuard(m_aMutex); OSL_PRECOND(_xListener, "ERROR: trying to register a NULL listener"); ComponentListener aComponentListener(_xListener, _aRequest.getOptions()); - const rtl::OUString aComponentName = _aRequest.getComponentName().toString() ; + const rtl::OUString aComponentName = _aRequest.getComponentName(); //Check if we have a Listener registered for that Component - ListenerList::iterator aIter; + std::map<rtl::OUString, ComponentNotifier>::iterator aIter; aIter = m_aListeners.find(aComponentName); if (aIter == m_aListeners.end()) { @@ -117,15 +117,15 @@ void BackendChangeNotifier::addListener(INodeDataListener * _xListener, const C } // --------------------------------------------------------------------------- -void BackendChangeNotifier::removeListener(INodeDataListener * _xListener, const ComponentRequest& _aRequest) CFG_NOTHROW() +void BackendChangeNotifier::removeListener(INodeDataListener * _xListener, const ComponentRequest& _aRequest) SAL_THROW(()) { osl::MutexGuard aListGuard(m_aMutex); OSL_PRECOND(!m_aListeners.empty(), "BackendChangeNotifier:Cannot Remove Listener, no Listeners Registered"); OSL_PRECOND(_xListener, "ERROR: trying to remove a NULL listener"); - ListenerList::iterator aIter; - rtl::OUString aComponentName = _aRequest.getComponentName().toString() ; + std::map<rtl::OUString, ComponentNotifier>::iterator aIter; + rtl::OUString aComponentName = _aRequest.getComponentName(); aIter = m_aListeners.find(aComponentName); if (aIter == m_aListeners.end()) @@ -185,9 +185,7 @@ void ComponentNotifier::notifyListeners(const rtl::OUString& _aComponent) for( std::list<ComponentListener>::iterator aIter = m_aListenerList.begin(); aIter != m_aListenerList.end(); aIter++) { - ComponentRequest aRequest( configuration::makeName - (_aComponent,configuration::Name::NoValidate()), - (*aIter).m_aOptions ); + ComponentRequest aRequest(_aComponent, (*aIter).m_aOptions); (*aIter).m_aListener->dataChanged(aRequest); } diff --git a/configmgr/source/backend/backendnotifier.hxx b/configmgr/source/backend/backendnotifier.hxx index 62eb6737f2..9ab179832c 100644 --- a/configmgr/source/backend/backendnotifier.hxx +++ b/configmgr/source/backend/backendnotifier.hxx @@ -56,7 +56,7 @@ namespace configmgr namespace lang = ::com::sun::star::lang; namespace backenduno = ::com::sun::star::configuration::backend; // --------------------------------------------------------------------------- - typedef struct ComponentListener + struct ComponentListener { explicit ComponentListener(INodeDataListener * _xListener, RequestOptions _aOptions): @@ -72,7 +72,7 @@ namespace configmgr } INodeDataListener * m_aListener; RequestOptions m_aOptions; - } aComponentListener; + }; /** Class used to store ComponentListener(listener and options) */ @@ -88,10 +88,9 @@ namespace configmgr std::list<ComponentListener> m_aListenerList; }; // --------------------------------------------------------------------------- - typedef ::cppu::WeakImplHelper1<backenduno::XBackendChangesListener> BackendListener_Base; /** Interface providing a multicasting service for changes in the backend */ - class BackendChangeNotifier :public BackendListener_Base + class BackendChangeNotifier :public cppu::WeakImplHelper1<backenduno::XBackendChangesListener> { public: BackendChangeNotifier(const uno::Reference<backenduno::XBackend>& _xBackend); @@ -104,13 +103,12 @@ namespace configmgr throw (uno::RuntimeException); // notification support. /// register a listener for observing changes to the cached data - void addListener(INodeDataListener * _xListener, const ComponentRequest& _aRequest) CFG_NOTHROW(); + void addListener(INodeDataListener * _xListener, const ComponentRequest& _aRequest) SAL_THROW(()); /// unregister a listener previously registered - void removeListener(INodeDataListener * _xListener, const ComponentRequest& _aRequest) CFG_NOTHROW(); + void removeListener(INodeDataListener * _xListener, const ComponentRequest& _aRequest) SAL_THROW(()); private: - typedef std::map<rtl::OUString, ComponentNotifier> ListenerList; osl::Mutex m_aMutex; - ListenerList m_aListeners; + std::map<rtl::OUString, ComponentNotifier> m_aListeners; /** Backend being accessed */ uno::Reference<backenduno::XBackendChangesNotifier> m_aBackend ; diff --git a/configmgr/source/backend/backendstratalistener.hxx b/configmgr/source/backend/backendstratalistener.hxx index 0cf74ec35a..72a4b9cc34 100644 --- a/configmgr/source/backend/backendstratalistener.hxx +++ b/configmgr/source/backend/backendstratalistener.hxx @@ -54,9 +54,7 @@ namespace configmgr namespace backenduno = ::com::sun::star::configuration::backend; // -------------------------------------------------------------------------- - typedef ::cppu::WeakImplHelper1<backenduno::XBackendChangesListener> BackendStrataListener_Base; - - class BackendStrataListener: public BackendStrataListener_Base + class BackendStrataListener: public cppu::WeakImplHelper1<backenduno::XBackendChangesListener> { public: BackendStrataListener(const MultiStratumBackend& aBackend); diff --git a/configmgr/source/backend/basicimporthandler.cxx b/configmgr/source/backend/basicimporthandler.cxx index f5f6f9e419..2cbf3cc41b 100644 --- a/configmgr/source/backend/basicimporthandler.cxx +++ b/configmgr/source/backend/basicimporthandler.cxx @@ -44,7 +44,7 @@ namespace configmgr // ----------------------------------------------------------------------------- BasicImportHandler::BasicImportHandler( - Backend const & xBackend,OUString const & aEntity, const sal_Bool& bNotify) + uno::Reference< backenduno::XBackend > const & xBackend,rtl::OUString const & aEntity, const sal_Bool& bNotify) : m_bSendNotification(bNotify) , m_xBackend(xBackend) , m_aComponentName() @@ -61,15 +61,15 @@ BasicImportHandler::~BasicImportHandler() void SAL_CALL BasicImportHandler::startLayer( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { - m_aComponentName = OUString(); + m_aComponentName = rtl::OUString(); } // ----------------------------------------------------------------------------- void SAL_CALL BasicImportHandler::endLayer( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if ( m_bSendNotification) { @@ -87,11 +87,11 @@ void SAL_CALL OSL_ENSURE(false, "ImportMergeHandler: target backend does not support notifications"); } } - m_aComponentName = OUString(); + m_aComponentName = rtl::OUString(); } // ----------------------------------------------------------------------------- -bool BasicImportHandler::startComponent( const OUString& aName ) +bool BasicImportHandler::startComponent( const rtl::OUString& aName ) { if (hasComponent()) return false; @@ -102,9 +102,9 @@ bool BasicImportHandler::startComponent( const OUString& aName ) void BasicImportHandler::raiseMalformedDataException(sal_Char const * pMsg) { - OUString sMsg = OUString::createFromAscii(pMsg); + rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg); - throw MalformedDataException(sMsg, *this, uno::Any()); + throw backenduno::MalformedDataException(sMsg, *this, uno::Any()); } // ----------------------------------------------------------------------------- diff --git a/configmgr/source/backend/basicimporthandler.hxx b/configmgr/source/backend/basicimporthandler.hxx index b64777f9d4..b62eb0bf3f 100644 --- a/configmgr/source/backend/basicimporthandler.hxx +++ b/configmgr/source/backend/basicimporthandler.hxx @@ -43,53 +43,48 @@ namespace configmgr namespace backend { // ----------------------------------------------------------------------------- - using rtl::OUString; namespace uno = ::com::sun::star::uno; namespace lang = ::com::sun::star::lang; namespace backenduno = ::com::sun::star::configuration::backend; - using backenduno::MalformedDataException; - using backenduno::TemplateIdentifier; // ----------------------------------------------------------------------------- class BasicImportHandler : public cppu::WeakImplHelper1< backenduno::XLayerHandler > { public: - typedef uno::Reference< backenduno::XBackend > Backend; - explicit BasicImportHandler(){} - BasicImportHandler(Backend const & xBackend,OUString const & aEntity = OUString(), const sal_Bool& bNofity= sal_False); + BasicImportHandler(uno::Reference< backenduno::XBackend > const & xBackend,rtl::OUString const & aEntity = rtl::OUString(), const sal_Bool& bNofity= sal_False); ~BasicImportHandler(); // XLayerHandler subset - call these implementations from your derived class implementations protected: virtual void SAL_CALL startLayer( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL endLayer( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); protected: bool hasComponent() const { return m_aComponentName.getLength() != 0; } bool hasEntity() const { return m_aEntity.getLength() != 0; } - OUString getComponent() const { return m_aComponentName; } - OUString getEntity() const { return m_aEntity; } - Backend getBackend() const { return m_xBackend; } + rtl::OUString getComponent() const { return m_aComponentName; } + rtl::OUString getEntity() const { return m_aEntity; } + uno::Reference< backenduno::XBackend > getBackend() const { return m_xBackend; } - bool startComponent( const OUString& aName ); + bool startComponent( const rtl::OUString& aName ); void raiseMalformedDataException(sal_Char const * pMsg); /** If True, notification should be send to backend */ sal_Bool m_bSendNotification; private: - Backend const m_xBackend; - OUString m_aComponentName; - OUString const m_aEntity; + uno::Reference< backenduno::XBackend > const m_xBackend; + rtl::OUString m_aComponentName; + rtl::OUString const m_aEntity; }; // ----------------------------------------------------------------------------- diff --git a/configmgr/source/backend/basicupdatemerger.cxx b/configmgr/source/backend/basicupdatemerger.cxx index 4d68fb75f2..205a062651 100644 --- a/configmgr/source/backend/basicupdatemerger.cxx +++ b/configmgr/source/backend/basicupdatemerger.cxx @@ -52,7 +52,7 @@ namespace configmgr { // ----------------------------------------------------------------------------- -BasicUpdateMerger::BasicUpdateMerger( LayerSource const & _xSourceLayer ) +BasicUpdateMerger::BasicUpdateMerger( uno::Reference< backenduno::XLayer > const & _xSourceLayer ) : m_xSourceLayer(_xSourceLayer) , m_xResultHandler() , m_nNesting(0) @@ -66,18 +66,18 @@ BasicUpdateMerger::~BasicUpdateMerger() } // ----------------------------------------------------------------------------- -void SAL_CALL BasicUpdateMerger::readData( ResultHandler const & _xResultHandler ) - throw ( MalformedDataException, lang::NullPointerException, +void SAL_CALL BasicUpdateMerger::readData( uno::Reference< backenduno::XLayerHandler > const & _xResultHandler ) + throw ( backenduno::MalformedDataException, lang::NullPointerException, lang::WrappedTargetException, uno::RuntimeException) { if (!_xResultHandler.is()) { - OUString sMsg( RTL_CONSTASCII_USTRINGPARAM("UpdateMerger: Error - NULL output handler unexpected") ); + rtl::OUString sMsg( RTL_CONSTASCII_USTRINGPARAM("UpdateMerger: Error - NULL output handler unexpected") ); throw lang::NullPointerException(sMsg,*this); } if (!m_xSourceLayer.is()) { - OUString sMsg( RTL_CONSTASCII_USTRINGPARAM("UpdateMerger: Error - No source layer set") ); + rtl::OUString sMsg( RTL_CONSTASCII_USTRINGPARAM("UpdateMerger: Error - No source layer set") ); throw lang::NullPointerException(sMsg,*this); } @@ -97,7 +97,7 @@ void SAL_CALL BasicUpdateMerger::readData( ResultHandler const & _xResultHandler // ----------------------------------------------------------------------------- void SAL_CALL BasicUpdateMerger::startLayer( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (m_nNesting) raiseMalformedDataException("UpdateMerger: Cannot start layer - layer already in progress"); @@ -109,7 +109,7 @@ void SAL_CALL BasicUpdateMerger::startLayer( ) // ----------------------------------------------------------------------------- void SAL_CALL BasicUpdateMerger::endLayer( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (m_nNesting > 0) raiseMalformedDataException("UpdateMerger: Cannot end layer - data handling still in progress"); @@ -120,8 +120,8 @@ void SAL_CALL BasicUpdateMerger::endLayer( ) } // ----------------------------------------------------------------------------- -void SAL_CALL BasicUpdateMerger::overrideNode( const OUString& aName, sal_Int16 aAttributes, sal_Bool bClear ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL BasicUpdateMerger::overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (!isSkipping()) m_xResultHandler->overrideNode(aName, aAttributes, bClear); @@ -130,8 +130,8 @@ void SAL_CALL BasicUpdateMerger::overrideNode( const OUString& aName, sal_Int16 } // ----------------------------------------------------------------------------- -void SAL_CALL BasicUpdateMerger::addOrReplaceNode( const OUString& aName, sal_Int16 aAttributes ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL BasicUpdateMerger::addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (!isSkipping()) m_xResultHandler->addOrReplaceNode(aName, aAttributes); @@ -140,8 +140,8 @@ void SAL_CALL BasicUpdateMerger::addOrReplaceNode( const OUString& aName, sal_In } // ----------------------------------------------------------------------------- -void SAL_CALL BasicUpdateMerger::addOrReplaceNodeFromTemplate( const OUString& aName, const TemplateIdentifier& aTemplate, sal_Int16 aAttributes ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL BasicUpdateMerger::addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (!isSkipping()) m_xResultHandler->addOrReplaceNodeFromTemplate(aName, aTemplate, aAttributes); @@ -151,7 +151,7 @@ void SAL_CALL BasicUpdateMerger::addOrReplaceNodeFromTemplate( const OUString& a // ----------------------------------------------------------------------------- void SAL_CALL BasicUpdateMerger::endNode( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (!isSkipping()) m_xResultHandler->endNode(); @@ -160,26 +160,26 @@ void SAL_CALL BasicUpdateMerger::endNode( ) } // ----------------------------------------------------------------------------- -void SAL_CALL BasicUpdateMerger::dropNode( const OUString& aName ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL BasicUpdateMerger::dropNode( const rtl::OUString& aName ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (!isSkipping()) m_xResultHandler->dropNode(aName); } // ----------------------------------------------------------------------------- -void SAL_CALL BasicUpdateMerger::overrideProperty( const OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL BasicUpdateMerger::overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (!isSkipping()) m_xResultHandler->overrideProperty(aName, aAttributes, aType, bClear); - pushLevel( OUString() ); // do not match context path to property names + pushLevel( rtl::OUString() ); // do not match context path to property names } // ----------------------------------------------------------------------------- void SAL_CALL BasicUpdateMerger::endProperty( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (!isSkipping()) m_xResultHandler->endProperty(); @@ -189,31 +189,31 @@ void SAL_CALL BasicUpdateMerger::endProperty( ) // ----------------------------------------------------------------------------- void SAL_CALL BasicUpdateMerger::setPropertyValue( const uno::Any& aValue ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (!isSkipping()) m_xResultHandler->setPropertyValue(aValue); } // ----------------------------------------------------------------------------- -void SAL_CALL BasicUpdateMerger::setPropertyValueForLocale( const uno::Any& aValue, const OUString & aLocale ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL BasicUpdateMerger::setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString & aLocale ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (!isSkipping()) m_xResultHandler->setPropertyValueForLocale(aValue,aLocale); } // ----------------------------------------------------------------------------- -void SAL_CALL BasicUpdateMerger::addProperty( const OUString& aName, sal_Int16 aAttributes, const uno::Type& aType ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL BasicUpdateMerger::addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (!isSkipping()) m_xResultHandler->addProperty(aName, aAttributes, aType); } // ----------------------------------------------------------------------------- -void SAL_CALL BasicUpdateMerger::addPropertyWithValue( const OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL BasicUpdateMerger::addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (!isSkipping()) m_xResultHandler->addPropertyWithValue(aName, aAttributes, aValue); @@ -222,9 +222,9 @@ void SAL_CALL BasicUpdateMerger::addPropertyWithValue( const OUString& aName, sa void BasicUpdateMerger::raiseMalformedDataException(sal_Char const * pMsg) { - OUString sMsg = OUString::createFromAscii(pMsg); + rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg); - throw MalformedDataException(sMsg, *this, uno::Any()); + throw backenduno::MalformedDataException(sMsg, *this, uno::Any()); } // ----------------------------------------------------------------------------- @@ -239,7 +239,7 @@ void BasicUpdateMerger::startSkipping() // ----------------------------------------------------------------------------- -void BasicUpdateMerger::pushLevel(OUString const & _aContext) +void BasicUpdateMerger::pushLevel(rtl::OUString const & _aContext) { if (m_nNesting > 0) { @@ -291,7 +291,7 @@ void BasicUpdateMerger::popLevel() } // ----------------------------------------------------------------------------- -void BasicUpdateMerger::findContext(ContextPath const & _aContext) +void BasicUpdateMerger::findContext(std::vector<rtl::OUString> const & _aContext) { // make the context a *reverse* copy of the context path OSL_PRECOND( ! isHandling(), "BasicUpdateMerger: starting context search while still handling data"); @@ -315,7 +315,7 @@ void BasicUpdateMerger::leaveContext() void BasicUpdateMerger::flushContext() { - ContextPath::size_type nNesting = m_aSearchPath.size(); + std::vector<rtl::OUString>::size_type nNesting = m_aSearchPath.size(); while (!m_aSearchPath.empty()) { diff --git a/configmgr/source/backend/basicupdatemerger.hxx b/configmgr/source/backend/basicupdatemerger.hxx index f3ac1ffd7a..e4c233f6e1 100644 --- a/configmgr/source/backend/basicupdatemerger.hxx +++ b/configmgr/source/backend/basicupdatemerger.hxx @@ -47,83 +47,77 @@ namespace configmgr namespace backend { // ----------------------------------------------------------------------------- - using rtl::OUString; namespace uno = ::com::sun::star::uno; namespace lang = ::com::sun::star::lang; namespace backenduno = ::com::sun::star::configuration::backend; - using backenduno::MalformedDataException; - using backenduno::TemplateIdentifier; // ----------------------------------------------------------------------------- class BasicUpdateMerger : public cppu::WeakImplHelper2< backenduno::XLayerHandler, backenduno::XLayer > { public: - typedef uno::Reference< backenduno::XLayerHandler > ResultHandler; - typedef uno::Reference< backenduno::XLayer > LayerSource; - explicit - BasicUpdateMerger(LayerSource const & _xSourceLayer); + BasicUpdateMerger(uno::Reference< backenduno::XLayer > const & _xSourceLayer); ~BasicUpdateMerger(); // XLayerHandler protected: virtual void SAL_CALL startLayer( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL endLayer( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - overrideNode( const OUString& aName, sal_Int16 aAttributes, sal_Bool bClear ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - addOrReplaceNode( const OUString& aName, sal_Int16 aAttributes ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - addOrReplaceNodeFromTemplate( const OUString& aName, const TemplateIdentifier& aTemplate, sal_Int16 aAttributes ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL endNode( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - dropNode( const OUString& aName ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + dropNode( const rtl::OUString& aName ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - overrideProperty( const OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL endProperty( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL setPropertyValue( const uno::Any& aValue ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - setPropertyValueForLocale( const uno::Any& aValue, const OUString & aLocale ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString & aLocale ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - addProperty( const OUString& aName, sal_Int16 aAttributes, const uno::Type& aType ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - addPropertyWithValue( const OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); // XLayer protected: virtual void SAL_CALL readData( const uno::Reference< backenduno::XLayerHandler >& aHandler ) - throw (MalformedDataException, lang::NullPointerException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::NullPointerException, lang::WrappedTargetException, uno::RuntimeException); // new overrideable private: @@ -135,22 +129,21 @@ namespace configmgr bool isSkipping() const { return m_bSkipping; } void startSkipping(); - typedef std::vector<OUString> ContextPath; - void findContext(ContextPath const & _aContext); + void findContext(std::vector<rtl::OUString> const & _aContext); void leaveContext(); - ResultHandler getResultWriter() const { return m_xResultHandler; }; + uno::Reference< backenduno::XLayerHandler > getResultWriter() const { return m_xResultHandler; }; void raiseMalformedDataException(sal_Char const * pMsg); private: - void pushLevel(OUString const & _aLevel); + void pushLevel(rtl::OUString const & _aLevel); void popLevel(); void flushContext(); private: - LayerSource m_xSourceLayer; - ResultHandler m_xResultHandler; - ContextPath m_aSearchPath; + uno::Reference< backenduno::XLayer > m_xSourceLayer; + uno::Reference< backenduno::XLayerHandler > m_xResultHandler; + std::vector<rtl::OUString> m_aSearchPath; sal_Int16 m_nNesting; bool m_bSkipping; diff --git a/configmgr/source/backend/binarycache.cxx b/configmgr/source/backend/binarycache.cxx index f0f0b44899..005e418a0b 100644 --- a/configmgr/source/backend/binarycache.cxx +++ b/configmgr/source/backend/binarycache.cxx @@ -55,25 +55,19 @@ namespace configmgr // ----------------------------------------------------------------------------- namespace backend { - - using ::rtl::OUString; - - const OUString aSettingName( + const rtl::OUString aSettingName( RTL_CONSTASCII_USTRINGPARAM( CONTEXT_ITEM_PREFIX_ "CacheUrl")); // --------------------------------------------------------------------------------------- - static inline bool isValidFileURL (OUString const& _sFileURL) + static inline bool isValidFileURL (rtl::OUString const& _sFileURL) { - using osl::File; - - OUString sSystemPath; - return _sFileURL.getLength() && (File::E_None == File::getSystemPathFromFileURL(_sFileURL, sSystemPath)); + rtl::OUString sSystemPath; + return _sFileURL.getLength() && (osl::File::E_None == osl::File::getSystemPathFromFileURL(_sFileURL, sSystemPath)); } // ----------------------------------------------------------------------------- // --------------------------------------------------------------------------------------- static bool implEnsureAbsoluteURL(rtl::OUString & _rsURL) // also strips embedded dots etc. { - using osl::File; if (!_rsURL.getLength()) return false; @@ -88,7 +82,7 @@ namespace configmgr OSL_VERIFY(tools::getProcessWorkingDir(&sBasePath)); rtl::OUString sAbsolute; - if ( File::E_None == File::getAbsoluteFileURL(sBasePath, _rsURL, sAbsolute)) + if ( osl::File::E_None == osl::File::getAbsoluteFileURL(sBasePath, _rsURL, sAbsolute)) { _rsURL = sAbsolute; return isValidFileURL(_rsURL); @@ -104,7 +98,7 @@ namespace configmgr static const sal_Unicode kPathSeparator = '/' ; static const char kBinarySuffix[] = ".dat" ; - OUString BinaryCache::getCacheFileURL(const OUString& aComponent) const + rtl::OUString BinaryCache::getCacheFileURL(const rtl::OUString& aComponent) const { rtl::OUStringBuffer retCode (mBaseURL); retCode.append(kPathSeparator) ; @@ -112,7 +106,7 @@ namespace configmgr retCode.append(aComponent) ; retCode.appendAscii(RTL_CONSTASCII_STRINGPARAM(kBinarySuffix)); - OUString aResult = retCode.makeStringAndClear() ; + rtl::OUString aResult = retCode.makeStringAndClear() ; if (isValidFileURL(aResult)) { @@ -121,7 +115,7 @@ namespace configmgr else { OSL_ENSURE(false, "Component File URL is invalid"); - return OUString(); + return rtl::OUString(); } } // ----------------------------------------------------------------------------- @@ -134,7 +128,7 @@ namespace configmgr //initialise the base URL ContextReader aReader(xContext); - OUString sCacheUrl; + rtl::OUString sCacheUrl; if (!aReader.isAdminService()) { mbCacheEnabled = (aReader.getBestContext()->getValueByName(aSettingName) >>= sCacheUrl) @@ -162,7 +156,7 @@ namespace configmgr } // ----------------------------------------------------------------------------- - void BinaryCache::setOwnerEntity(const OUString & aOwnerEntity) + void BinaryCache::setOwnerEntity(const rtl::OUString & aOwnerEntity) { OSL_PRECOND(mOwnerEntity.getLength() == 0, "Owner entity of cache already set"); mOwnerEntity = aOwnerEntity; @@ -186,12 +180,12 @@ namespace configmgr } // ----------------------------------------------------------------------------- bool BinaryCache::readComponentData(MergedComponentData & aComponentData, - MultiServiceFactory const & aFactory, - OUString const & aComponent, - OUString const & aSchemaVersion, - OUString const & aEntity, - localehelper::Locale const & aRequestedLocale, - localehelper::LocaleSequence & outKnownLocales, + uno::Reference< lang::XMultiServiceFactory > const & aFactory, + rtl::OUString const & aComponent, + rtl::OUString const & aSchemaVersion, + rtl::OUString const & aEntity, + com::sun::star::lang::Locale const & aRequestedLocale, + std::vector< com::sun::star::lang::Locale > & outKnownLocales, const uno::Reference<backenduno::XLayer> * pLayers, sal_Int32 nNumLayers, bool bIncludeTemplates) @@ -221,11 +215,11 @@ namespace configmgr // ----------------------------------------------------------------------------- bool BinaryCache::writeComponentData(MergedComponentData const & aComponentData, - MultiServiceFactory const & aFactory, - OUString const & aComponent, - OUString const & aSchemaVersion, - OUString const & aEntity, - localehelper::LocaleSequence const & aKnownLocales, + uno::Reference< lang::XMultiServiceFactory > const & aFactory, + rtl::OUString const & aComponent, + rtl::OUString const & aSchemaVersion, + rtl::OUString const & aEntity, + std::vector< com::sun::star::lang::Locale > const & aKnownLocales, const uno::Reference<backenduno::XLayer> * pLayers, sal_Int32 nNumLayers) { diff --git a/configmgr/source/backend/binarycache.hxx b/configmgr/source/backend/binarycache.hxx index 47cfe1a64d..f4506a12b1 100644 --- a/configmgr/source/backend/binarycache.hxx +++ b/configmgr/source/backend/binarycache.hxx @@ -50,7 +50,6 @@ namespace configmgr // ----------------------------------------------------------------------------- class MergedComponentData; - typedef uno::Reference< lang::XMultiServiceFactory > MultiServiceFactory; // ----------------------------------------------------------------------------- class BinaryCache @@ -67,22 +66,22 @@ namespace configmgr rtl::OUString getCacheFileURL(rtl::OUString const & aComponent) const; bool readComponentData(MergedComponentData & aComponentData, - MultiServiceFactory const & aFactory, + uno::Reference< lang::XMultiServiceFactory > const & aFactory, rtl::OUString const & aComponent, rtl::OUString const & aSchemaVersion, rtl::OUString const & aEntity, - localehelper::Locale const & aRequestedLocale, - localehelper::LocaleSequence & outKnownLocales, + com::sun::star::lang::Locale const & aRequestedLocale, + std::vector< com::sun::star::lang::Locale > & outKnownLocales, const uno::Reference<backenduno::XLayer> * pLayers, sal_Int32 nNumLayers, bool bIncludeTemplates = true); bool writeComponentData(MergedComponentData const & aComponentData, - MultiServiceFactory const & aFactory, + uno::Reference< lang::XMultiServiceFactory > const & aFactory, rtl::OUString const & aComponent, rtl::OUString const & aSchemaVersion, rtl::OUString const & aEntity, - localehelper::LocaleSequence const & aKnownLocales, + std::vector< com::sun::star::lang::Locale > const & aKnownLocales, const uno::Reference<backenduno::XLayer> * pLayers, sal_Int32 nNumLayers); private: diff --git a/configmgr/source/backend/binaryreader.cxx b/configmgr/source/backend/binaryreader.cxx index 8661c723fb..c6e21db004 100644 --- a/configmgr/source/backend/binaryreader.cxx +++ b/configmgr/source/backend/binaryreader.cxx @@ -63,8 +63,6 @@ namespace configmgr // ----------------------------------------------------------------------------- namespace backend { - using ::rtl::OUString; - using namespace ::osl; namespace uno = com::sun::star::uno; namespace io = com::sun::star::io; @@ -190,7 +188,7 @@ namespace configmgr } static void raiseBufferError() { - OUString sMsg = OUString::createFromAscii("Cannot allocate Buffer: Too large"); + rtl::OUString sMsg = rtl::OUString::createFromAscii("Cannot allocate Buffer: Too large"); throw io:: BufferSizeExceededException(sMsg, NULL); } // ------------------------------------------------------------------------- @@ -223,7 +221,7 @@ namespace configmgr if (nRead != nLength) { rtl_freeMemory (pBuffer); - OUString sMsg = OUString::createFromAscii("BinaryCache - Could not read entire size of file: "); + rtl::OUString sMsg = rtl::OUString::createFromAscii("BinaryCache - Could not read entire size of file: "); throw io::UnexpectedEOFException(sMsg.concat(rFileUrl),NULL); } m_pBuffer = pBuffer; @@ -243,7 +241,7 @@ namespace configmgr { if (!m_pBuffer) { - OUString sMsg = OUString::createFromAscii("BinaryCache - Stream is not open. No data available for reading."); + rtl::OUString sMsg = rtl::OUString::createFromAscii("BinaryCache - Stream is not open. No data available for reading."); throw io::NotConnectedException(sMsg,*this); } OSL_ASSERT(m_nLength >= m_nOffset); @@ -255,7 +253,7 @@ namespace configmgr { if (nRequest < 0) { - OUString sMsg = OUString::createFromAscii("BinaryCache - Invalid read request - negative byte count requested."); + rtl::OUString sMsg = rtl::OUString::createFromAscii("BinaryCache - Invalid read request - negative byte count requested."); throw io::BufferSizeExceededException(sMsg,*this); } sal_uInt32 const uRequest = sal_uInt32(nRequest); @@ -269,7 +267,7 @@ namespace configmgr sal_uInt32 const nAvail = checkAvail (); if (nRequest > nAvail) { - OUString sMsg = OUString::createFromAscii("BinaryCache - Invalid file format - read past end-of-file."); + rtl::OUString sMsg = rtl::OUString::createFromAscii("BinaryCache - Invalid file format - read past end-of-file."); throw io::UnexpectedEOFException(sMsg,*this); } sal_uInt8 const * pData = m_pBuffer + m_nOffset; @@ -491,9 +489,8 @@ namespace configmgr (sal_uInt32(pData[2]) << 8) | (sal_uInt32(pData[3]) << 0) ); - using binary::STR_ASCII_MASK; - bool bIsAscii = (nLength & STR_ASCII_MASK) == STR_ASCII_MASK; - nLength &=~STR_ASCII_MASK; + bool bIsAscii = (nLength & binary::STR_ASCII_MASK) == binary::STR_ASCII_MASK; + nLength &=~binary::STR_ASCII_MASK; rtl::OUString result; if (nLength != 0) @@ -617,7 +614,7 @@ namespace configmgr // -------------------------------------------------------------------------- - void BinaryReader::read (Binary &_aValue) + void BinaryReader::read (uno::Sequence< sal_Int8 > &_aValue) SAL_THROW( (io::IOException, uno::RuntimeException) ) { readSequence(*this, _aValue); @@ -625,7 +622,7 @@ namespace configmgr // -------------------------------------------------------------------------- - void BinaryReader::read (StringList &_aValue) + void BinaryReader::read (uno::Sequence< rtl::OUString > &_aValue) SAL_THROW( (io::IOException, uno::RuntimeException) ) { readSequence(*this, _aValue); @@ -633,8 +630,7 @@ namespace configmgr // -------------------------------------------------------------------------- - typedef BinaryReader::Binary Binary; - Binary const * const for_binary = 0; + uno::Sequence< sal_Int8 > const * const for_binary = 0; #define CASE_READ_SEQUENCE(TYPE_CLASS, DATA_TYPE) \ case TYPE_CLASS: \ @@ -668,7 +664,7 @@ namespace configmgr case uno::TypeClass_SEQUENCE: if (_aElementType == ::getCppuType(for_binary)) { - Binary aData; + uno::Sequence< sal_Int8 > aData; readSequence(_rReader, aData); _aValue <<= aData; break; diff --git a/configmgr/source/backend/binaryreader.hxx b/configmgr/source/backend/binaryreader.hxx index 36d50fc18f..1b7a4de4a9 100644 --- a/configmgr/source/backend/binaryreader.hxx +++ b/configmgr/source/backend/binaryreader.hxx @@ -47,8 +47,6 @@ namespace configmgr namespace io = css::io; namespace uno = css::uno; namespace lang = css::lang; - - typedef uno::Reference<lang::XMultiServiceFactory> MultiServiceFactory; // ----------------------------------------------------------------------------- class BinaryReader { @@ -66,9 +64,6 @@ namespace configmgr public: bool open() SAL_THROW( (io::IOException, uno::RuntimeException) ); - typedef uno::Sequence< sal_Int8 > Binary; - typedef uno::Sequence< rtl::OUString > StringList; - void read(sal_Bool &_nValue) SAL_THROW( (io::IOException, uno::RuntimeException) ); void read(sal_Int8 &_nValue) SAL_THROW( (io::IOException, uno::RuntimeException) ); void read(sal_Int16 &_nValue) SAL_THROW( (io::IOException, uno::RuntimeException) ); @@ -76,8 +71,8 @@ namespace configmgr void read(sal_Int64 &_nValue) SAL_THROW( (io::IOException, uno::RuntimeException) ); void read(double &_nValue) SAL_THROW( (io::IOException, uno::RuntimeException) ); void read(rtl::OUString& _aStr) SAL_THROW( (io::IOException, uno::RuntimeException) ); - void read(Binary &_aValue) SAL_THROW( (io::IOException, uno::RuntimeException) ); - void read(StringList &_aValue) SAL_THROW( (io::IOException, uno::RuntimeException) ); + void read(uno::Sequence< sal_Int8 > &_aValue) SAL_THROW( (io::IOException, uno::RuntimeException) ); + void read(uno::Sequence< rtl::OUString > &_aValue) SAL_THROW( (io::IOException, uno::RuntimeException) ); private: inline uno::Reference<io::XDataInputStream> getDataInputStream(); diff --git a/configmgr/source/backend/binaryreadhandler.cxx b/configmgr/source/backend/binaryreadhandler.cxx index a1216d2f6d..eefca28952 100644 --- a/configmgr/source/backend/binaryreadhandler.cxx +++ b/configmgr/source/backend/binaryreadhandler.cxx @@ -46,7 +46,6 @@ namespace configmgr { - using namespace binary; // ----------------------------------------------------------------------------- namespace backend { @@ -58,7 +57,7 @@ namespace configmgr // ----------------------------------------------------------------------------- BinaryReadHandler::BinaryReadHandler(rtl::OUString const & _aFileURL, rtl::OUString const & _aComponentName, - MultiServiceFactory const & ) + uno::Reference<lang::XMultiServiceFactory> const & ) : m_BinaryReader(_aFileURL) , m_aNodeFactory() , m_aComponentName(_aComponentName) @@ -71,15 +70,15 @@ namespace configmgr // ----------------------------------------------------------------------------- static inline - bool isRequestingNoLocale(localehelper::Locale const & aRequestedLocale) + bool isRequestingNoLocale(com::sun::star::lang::Locale const & aRequestedLocale) { - OUString const & aLanguage = aRequestedLocale.Language; + rtl::OUString const & aLanguage = aRequestedLocale.Language; return aLanguage.getLength() == 0 || localehelper::isDefaultLanguage(aLanguage); } // ----------------------------------------------------------------------------- static - bool supportsLocale(uno::Sequence< OUString > const & aStoredLocales, OUString const & aRequestedLocale) + bool supportsLocale(uno::Sequence< rtl::OUString > const & aStoredLocales, rtl::OUString const & aRequestedLocale) { for (sal_Int32 ix=0; ix<aStoredLocales.getLength(); ++ix) if (aStoredLocales[ix].equalsIgnoreAsciiCase(aRequestedLocale)) @@ -90,7 +89,7 @@ namespace configmgr // ----------------------------------------------------------------------------- static - bool supportsAll(uno::Sequence< OUString > const & aStoredLocales, uno::Sequence< OUString > const & aRequestedLocales) + bool supportsAll(uno::Sequence< rtl::OUString > const & aStoredLocales, uno::Sequence< rtl::OUString > const & aRequestedLocales) { for (sal_Int32 jx=0; jx<aRequestedLocales.getLength(); ++jx) if (!supportsLocale(aStoredLocales,aRequestedLocales[jx])) @@ -102,9 +101,9 @@ namespace configmgr bool BinaryReadHandler::verifyFileHeader( const uno::Reference<backenduno::XLayer> * pLayers, sal_Int32 nNumLayers, - const OUString& _aSchemaVersion, - localehelper::Locale const & aRequestedLocale, - localehelper::LocaleSequence & outKnownLocales) + const rtl::OUString& _aSchemaVersion, + com::sun::star::lang::Locale const & aRequestedLocale, + std::vector< com::sun::star::lang::Locale > & outKnownLocales) { try { @@ -112,7 +111,7 @@ namespace configmgr sal_Int16 nMagic, nVersion; m_BinaryReader.read(nMagic); m_BinaryReader.read(nVersion); - if (nMagic !=CFG_BINARY_MAGIC || nVersion != CFG_BINARY_VERSION ) + if (nMagic !=binary::CFG_BINARY_MAGIC || nVersion != binary::CFG_BINARY_VERSION ) return false; rtl::OUString aSchemaVersion; @@ -133,7 +132,7 @@ namespace configmgr else if (!localehelper::designatesAllLocales(aRequestedLocale)) { // one particular locale requested - OUString const aIsoLocale = localehelper::makeIsoLocale(aRequestedLocale); + rtl::OUString const aIsoLocale = localehelper::makeIsoLocale(aRequestedLocale); if (!supportsLocale(aKnownLocales,aIsoLocale)) { // a locale we didn't load previously @@ -205,19 +204,19 @@ namespace configmgr return true; } // ----------------------------------------------------------------------------- - NodeType::Type BinaryReadHandler::readNodeType() + binary::NodeType::Type BinaryReadHandler::readNodeType() SAL_THROW( (io::IOException, uno::RuntimeException) ) { - NodeType::Type eType = NodeType::invalid; + binary::NodeType::Type eType = binary::NodeType::invalid; sal_Int8 nValue; m_BinaryReader.read(nValue); sal_uInt8 const nRightValue( nValue ); - if ( (nRightValue & NodeType::nodetype_mask) == nRightValue ) - eType = NodeType::Type(nRightValue); + if ( (nRightValue & binary::NodeType::nodetype_mask) == nRightValue ) + eType = binary::NodeType::Type(nRightValue); - if (eType == NodeType::invalid) + if (eType == binary::NodeType::invalid) { OSL_ENSURE(false, "unknown or unhandled node type"); throw io::WrongFormatException(); @@ -227,32 +226,32 @@ namespace configmgr } // ----------------------------------------------------------------------------- - ValueFlags::Type BinaryReadHandler::readValueFlags(bool& bSeq, bool& bHasValue, bool& bHasDefault ) + binary::ValueFlags::Type BinaryReadHandler::readValueFlags(bool& bSeq, bool& bHasValue, bool& bHasDefault ) SAL_THROW( (io::IOException, uno::RuntimeException) ) { sal_Int8 nValue; m_BinaryReader.read(nValue); sal_uInt8 const nRightValue( nValue ); - ValueFlags::Type eType = ValueFlags::Type(nRightValue & ValueFlags::basictype_mask); - if ( eType >= ValueFlags::val_invalid) + binary::ValueFlags::Type eType = binary::ValueFlags::Type(nRightValue & binary::ValueFlags::basictype_mask); + if ( eType >= binary::ValueFlags::val_invalid) { OSL_ENSURE(false, "unknown or unhandled value type"); throw io::WrongFormatException(); } - if (nRightValue & ValueFlags::seq) + if (nRightValue & binary::ValueFlags::seq) bSeq = true; else bSeq = false; - if (nRightValue & ValueFlags::first_value_NULL) + if (nRightValue & binary::ValueFlags::first_value_NULL) bHasValue = false; else bHasValue = true; - if (nRightValue & ValueFlags::second_value_NULL) + if (nRightValue & binary::ValueFlags::second_value_NULL) bHasDefault = false; else bHasDefault = true; @@ -321,7 +320,7 @@ namespace configmgr } // ----------------------------------------------------------------------------- - uno::Type convertValueTypeToType(ValueFlags::Type eBasicValueType, bool bSeq) + uno::Type convertValueTypeToType(binary::ValueFlags::Type eBasicValueType, bool bSeq) { uno::Type aType; @@ -331,28 +330,28 @@ namespace configmgr { // --------------- Simple types --------------- - case ValueFlags::val_boolean: + case binary::ValueFlags::val_boolean: aType = SimpleTypeHelper::getBooleanType(); break; - case ValueFlags::val_int16: + case binary::ValueFlags::val_int16: aType = SimpleTypeHelper::getShortType(); break; - case ValueFlags::val_int32: + case binary::ValueFlags::val_int32: aType = SimpleTypeHelper::getIntType(); break; - case ValueFlags::val_int64: + case binary::ValueFlags::val_int64: aType = SimpleTypeHelper::getLongType(); break; - case ValueFlags::val_double: + case binary::ValueFlags::val_double: aType = SimpleTypeHelper::getDoubleType(); break; - case ValueFlags::val_string: + case binary::ValueFlags::val_string: aType = SimpleTypeHelper::getStringType(); break; - case ValueFlags::val_binary: + case binary::ValueFlags::val_binary: aType = SimpleTypeHelper::getBinaryType(); break; - case ValueFlags::val_any: + case binary::ValueFlags::val_any: aType = SimpleTypeHelper::getAnyType(); break; default: @@ -365,26 +364,26 @@ namespace configmgr // ------------ Sequences ------------ switch(eBasicValueType) { - case ValueFlags::val_boolean: + case binary::ValueFlags::val_boolean: aType = ::getCppuType(static_cast<uno::Sequence<sal_Bool> const*>(0)); break; - case ValueFlags::val_int16: + case binary::ValueFlags::val_int16: aType = ::getCppuType(static_cast<uno::Sequence<sal_Int16> const*>(0)); break; - case ValueFlags::val_int32: + case binary::ValueFlags::val_int32: aType = ::getCppuType(static_cast<uno::Sequence<sal_Int32> const*>(0)); break; - case ValueFlags::val_int64: + case binary::ValueFlags::val_int64: aType = ::getCppuType(static_cast<uno::Sequence<sal_Int64> const*>(0)); break; - case ValueFlags::val_double: + case binary::ValueFlags::val_double: aType = ::getCppuType(static_cast<uno::Sequence<double> const*>(0)); break; - case ValueFlags::val_string: + case binary::ValueFlags::val_string: aType = ::getCppuType(static_cast<uno::Sequence<rtl::OUString> const*>(0)); break; - case ValueFlags::val_binary: - aType = ::getCppuType(static_cast<uno::Sequence<BinaryReader::Binary> const*>(0)); + case binary::ValueFlags::val_binary: + aType = ::getCppuType(static_cast<uno::Sequence< uno::Sequence< sal_Int8 > > const*>(0)); break; default: OSL_ENSURE(false,"Invalid sequence value type"); @@ -404,7 +403,7 @@ namespace configmgr bool bHasValue = false; bool bHasDefault = false; - ValueFlags::Type eBasicType = readValueFlags(bSeq, bHasValue, bHasDefault); + binary::ValueFlags::Type eBasicType = readValueFlags(bSeq, bHasValue, bHasDefault); readAttributes(_aAttributes); readName(_aName); @@ -412,12 +411,12 @@ namespace configmgr { switch(eBasicType) { - case ValueFlags::val_any: + case binary::ValueFlags::val_any: { OSL_ENSURE(false,"Node of type Any cannot have value"); throw io::WrongFormatException(); } - case ValueFlags::val_string: + case binary::ValueFlags::val_string: { rtl::OUString aStr; if (bHasValue) @@ -426,7 +425,7 @@ namespace configmgr readAsAny(m_BinaryReader, _aDefaultValue, _aType, aStr); break; } - case ValueFlags::val_boolean: + case binary::ValueFlags::val_boolean: { sal_Bool nValue; if (bHasValue) @@ -435,7 +434,7 @@ namespace configmgr readAsAny(m_BinaryReader,_aDefaultValue, _aType, nValue); break; } - case ValueFlags::val_int16: + case binary::ValueFlags::val_int16: { sal_Int16 nValue; if (bHasValue) @@ -444,7 +443,7 @@ namespace configmgr readAsAny(m_BinaryReader,_aDefaultValue, _aType, nValue); break; } - case ValueFlags::val_int32: + case binary::ValueFlags::val_int32: { sal_Int32 nValue; if (bHasValue) @@ -453,7 +452,7 @@ namespace configmgr readAsAny(m_BinaryReader,_aDefaultValue, _aType, nValue); break; } - case ValueFlags::val_int64: + case binary::ValueFlags::val_int64: { sal_Int64 nValue; if (bHasValue) @@ -462,7 +461,7 @@ namespace configmgr readAsAny(m_BinaryReader,_aDefaultValue, _aType, nValue); break; } - case ValueFlags::val_double: + case binary::ValueFlags::val_double: { double nValue; if (bHasValue) @@ -471,9 +470,9 @@ namespace configmgr readAsAny(m_BinaryReader, _aDefaultValue, _aType, nValue); break; } - case ValueFlags::val_binary: + case binary::ValueFlags::val_binary: { - BinaryReader::Binary aValue; + uno::Sequence< sal_Int8 > aValue; if (bHasValue) readAsAny(m_BinaryReader,_aValue, _aType, aValue); if (bHasDefault) @@ -508,9 +507,9 @@ namespace configmgr std::auto_ptr<ISubtree> BinaryReadHandler::readComponentTree() SAL_THROW( (io::IOException, uno::RuntimeException) ) { - NodeType::Type eType = this->readNodeType(); + binary::NodeType::Type eType = this->readNodeType(); - if (eType != NodeType::component) + if (eType != binary::NodeType::component) { // TODO: search for component tree OSL_ENSURE(false, "binary Cache: unexpected tree type for component data"); @@ -523,9 +522,9 @@ namespace configmgr std::auto_ptr<ISubtree> BinaryReadHandler::readTemplatesTree() SAL_THROW( (io::IOException, uno::RuntimeException) ) { - NodeType::Type eType = this->readNodeType(); + binary::NodeType::Type eType = this->readNodeType(); - if (eType != NodeType::templates) + if (eType != binary::NodeType::templates) { // TODO: search for templates tree OSL_ENSURE(false, "binary Cache: unexpected tree type for template data"); @@ -545,23 +544,23 @@ namespace configmgr node::Attributes aAttributes; const bool not_extensible = false; - NodeType::Type eType = this->readNodeType(); + binary::NodeType::Type eType = this->readNodeType(); switch (eType) { - case NodeType::groupnode: + case binary::NodeType::groupnode: { this->readGroup(aName, aAttributes); pTree = m_aNodeFactory.createGroup(aName,not_extensible,aAttributes); break; } - case NodeType::setnode: + case binary::NodeType::setnode: { backenduno::TemplateIdentifier aTemplate; this->readSet(aName, aAttributes,aTemplate.Name, aTemplate.Component); pTree = m_aNodeFactory.createSet(aName,aTemplate,not_extensible,aAttributes); break; } - case NodeType::nodata: + case binary::NodeType::nodata: break; default: @@ -576,7 +575,7 @@ namespace configmgr //read terminating stop node eType = this->readNodeType(); - OSL_ENSURE(NodeType::stop == eType, "Missing stop node to mark end of tree"); + OSL_ENSURE(binary::NodeType::stop == eType, "Missing stop node to mark end of tree"); } return pTree; } @@ -585,9 +584,9 @@ namespace configmgr // ----------------------------------------------------------------------------- bool BinaryReadHandler::validateHeader( const uno::Reference<backenduno::XLayer> * pLayers, sal_Int32 nNumLayers, - const OUString& _aSchemaVersion, - localehelper::Locale const & aRequestedLocale, - localehelper::LocaleSequence & outKnownLocales) + const rtl::OUString& _aSchemaVersion, + com::sun::star::lang::Locale const & aRequestedLocale, + std::vector< com::sun::star::lang::Locale > & outKnownLocales) SAL_THROW( (io::IOException, uno::RuntimeException) ) { @@ -599,13 +598,13 @@ namespace configmgr return false; //Check if layers are uptodate - std::vector <OUString> timeStamps(nNumLayers); + std::vector <rtl::OUString> timeStamps(nNumLayers); for (sal_Int32 i = 0 ; i < nNumLayers ; ++ i) { uno::Reference<util::XTimeStamped> xTimeStamp = uno::Reference<util::XTimeStamped>(pLayers[i], uno::UNO_QUERY); if (xTimeStamp.is()) { - OUString aTimeStamp = xTimeStamp->getTimestamp(); + rtl::OUString aTimeStamp = xTimeStamp->getTimestamp(); timeStamps[i] = aTimeStamp; } } @@ -615,15 +614,15 @@ namespace configmgr // ----------------------------------------------------------------------------- void BinaryReadHandler::readChildren(ISubtree & rTree ) { - OSL_ASSERT(!NodeType::stop); // loop stops at stop node - while (NodeType::Type eType = this->readNodeType()) + OSL_ASSERT(!binary::NodeType::stop); // loop stops at stop node + while (binary::NodeType::Type eType = this->readNodeType()) { rtl::OUString aName; node::Attributes aAttributes; const bool not_extensible = false; switch (eType) { - case NodeType::groupnode: + case binary::NodeType::groupnode: { this->readGroup(aName, aAttributes); @@ -638,7 +637,7 @@ namespace configmgr rTree.addChild(base_ptr(pNewNode)); break; } - case NodeType::setnode: + case binary::NodeType::setnode: { backenduno::TemplateIdentifier aTemplate; this->readSet(aName, aAttributes,aTemplate.Name, aTemplate.Component); @@ -654,7 +653,7 @@ namespace configmgr rTree.addChild(base_ptr(pNewSetNode)); break; } - case NodeType::valuenode: + case binary::NodeType::valuenode: { uno::Any aValue; uno::Any aDefaultValue; diff --git a/configmgr/source/backend/binaryreadhandler.hxx b/configmgr/source/backend/binaryreadhandler.hxx index 3cdfcc90b8..7a7e75a607 100644 --- a/configmgr/source/backend/binaryreadhandler.hxx +++ b/configmgr/source/backend/binaryreadhandler.hxx @@ -70,14 +70,14 @@ namespace configmgr rtl::OUString m_aComponentName; public: - BinaryReadHandler(rtl::OUString const & _aFileURL, rtl::OUString const & _aComponentName, MultiServiceFactory const & _aFactory); + BinaryReadHandler(rtl::OUString const & _aFileURL, rtl::OUString const & _aComponentName, uno::Reference<lang::XMultiServiceFactory> const & _aFactory); ~BinaryReadHandler(); bool validateHeader( const uno::Reference<backenduno::XLayer> * pLayers, sal_Int32 nNumLayers, - const OUString& _aSchemaVersion, - localehelper::Locale const & aRequestedLocale, - localehelper::LocaleSequence & outKnownLocales) + const rtl::OUString& _aSchemaVersion, + com::sun::star::lang::Locale const & aRequestedLocale, + std::vector< com::sun::star::lang::Locale > & outKnownLocales) SAL_THROW( (io::IOException, uno::RuntimeException) ); std::auto_ptr<ISubtree> readComponentTree() @@ -96,9 +96,9 @@ namespace configmgr private: bool verifyFileHeader( const uno::Reference<backenduno::XLayer> * pLayers, sal_Int32 nNumLayers, - const OUString& _aSchemaVersion, - localehelper::Locale const & aRequestedLocale, - localehelper::LocaleSequence & outKnownLocales); + const rtl::OUString& _aSchemaVersion, + com::sun::star::lang::Locale const & aRequestedLocale, + std::vector< com::sun::star::lang::Locale > & outKnownLocales); bool isUptodate(const std::vector<rtl::OUString> & _timeStamps) SAL_THROW( (io::IOException, uno::RuntimeException) ); diff --git a/configmgr/source/backend/binarytype.hxx b/configmgr/source/backend/binarytype.hxx index 9ccb526723..11e187a719 100644 --- a/configmgr/source/backend/binarytype.hxx +++ b/configmgr/source/backend/binarytype.hxx @@ -37,7 +37,6 @@ namespace configmgr valuetype_mask = 0x1F, pairstate_mask = first_value_NULL | second_value_NULL }; - typedef sal_uInt8 Field; } namespace NodeType @@ -56,7 +55,6 @@ namespace configmgr nodetype_mask = 0xE0 }; - typedef sal_uInt8 Field; } } } diff --git a/configmgr/source/backend/binarywritehandler.cxx b/configmgr/source/backend/binarywritehandler.cxx index 9ce37f4ccb..bb168cb8a4 100644 --- a/configmgr/source/backend/binarywritehandler.cxx +++ b/configmgr/source/backend/binarywritehandler.cxx @@ -43,16 +43,14 @@ namespace configmgr namespace backend { - using ::rtl::OUString; namespace css = com::sun::star; namespace util = css::util ; - using namespace binary; // ----------------------------------------------------------------------------- BinaryWriteHandler::BinaryWriteHandler( rtl::OUString const & _aFileURL, rtl::OUString const & _aComponentName, - MultiServiceFactory const & _aFactory) + uno::Reference<lang::XMultiServiceFactory> const & _aFactory) : m_BinaryWriter(_aFileURL,_aFactory) , m_aComponentName(_aComponentName) { @@ -60,45 +58,45 @@ namespace configmgr } // ----------------------------------------------------------------------------- static - ValueFlags::Type convertTypeToValueType(uno::Type const& _aType) + binary::ValueFlags::Type convertTypeToValueType(uno::Type const& _aType) { - ValueFlags::Type eType = ValueFlags::val_invalid; + binary::ValueFlags::Type eType = binary::ValueFlags::val_invalid; uno::TypeClass const aClass = _aType.getTypeClass(); switch(aClass) { case uno::TypeClass_ANY: - eType = ValueFlags::val_any; + eType = binary::ValueFlags::val_any; break; case uno::TypeClass_BOOLEAN: - eType = ValueFlags::val_boolean; + eType = binary::ValueFlags::val_boolean; break; case uno::TypeClass_SHORT: - eType = ValueFlags::val_int16; + eType = binary::ValueFlags::val_int16; break; case uno::TypeClass_LONG: - eType = ValueFlags::val_int32; + eType = binary::ValueFlags::val_int32; break; case uno::TypeClass_HYPER: - eType = ValueFlags::val_int64; + eType = binary::ValueFlags::val_int64; break; case uno::TypeClass_DOUBLE: - eType = ValueFlags::val_double; + eType = binary::ValueFlags::val_double; break; case uno::TypeClass_STRING: - eType = ValueFlags::val_string; + eType = binary::ValueFlags::val_string; break; case uno::TypeClass_SEQUENCE: if (_aType == SimpleTypeHelper::getBinaryType()) { - eType = ValueFlags::val_binary; + eType = binary::ValueFlags::val_binary; } else { uno::Type aType = configmgr::getSequenceElementType(_aType); eType = convertTypeToValueType(aType); - OSL_ENSURE(!(eType & ValueFlags::seq), "Binary Writer - Invalid value type: Multiple nesting of sequences"); - eType = ValueFlags::Type( eType | ValueFlags::seq ); + OSL_ENSURE(!(eType & binary::ValueFlags::seq), "Binary Writer - Invalid value type: Multiple nesting of sequences"); + eType = binary::ValueFlags::Type( eType | binary::ValueFlags::seq ); } break; default: @@ -177,7 +175,7 @@ namespace configmgr CASE_WRITE_SEQUENCE( uno::TypeClass_DOUBLE, double ); - CASE_WRITE_SEQUENCE( uno::TypeClass_STRING, OUString ); + CASE_WRITE_SEQUENCE( uno::TypeClass_STRING, rtl::OUString ); CASE_WRITE_SEQUENCE( uno::TypeClass_SEQUENCE, uno::Sequence<sal_Int8> ); @@ -235,7 +233,7 @@ namespace configmgr } case uno::TypeClass_STRING: { - OUString aStr; + rtl::OUString aStr; writeFromAny(_rWriter, _aValue, aStr); break; } @@ -271,12 +269,12 @@ namespace configmgr // ----------------------------------------------------------------------------- void BinaryWriteHandler::writeFileHeader( rtl::OUString const & _aSchemaVersion, - const uno::Sequence<OUString> & aKnownLocales, - const uno::Sequence<OUString> & aDataLocales ) + const uno::Sequence<rtl::OUString> & aKnownLocales, + const uno::Sequence<rtl::OUString> & aDataLocales ) SAL_THROW( (io::IOException, uno::RuntimeException) ) { - m_BinaryWriter.write(CFG_BINARY_MAGIC); - m_BinaryWriter.write(CFG_BINARY_VERSION); + m_BinaryWriter.write(binary::CFG_BINARY_MAGIC); + m_BinaryWriter.write(binary::CFG_BINARY_VERSION); m_BinaryWriter.write(_aSchemaVersion); writeSequence(m_BinaryWriter,aKnownLocales); writeSequence(m_BinaryWriter,aDataLocales); @@ -315,14 +313,14 @@ namespace configmgr { uno::Reference<util::XTimeStamped> xTimeStamp = uno::Reference<util::XTimeStamped>(pLayers[i], uno::UNO_QUERY); - OUString aTimeStamp = xTimeStamp.is() ? xTimeStamp->getTimestamp() : OUString(); + rtl::OUString aTimeStamp = xTimeStamp.is() ? xTimeStamp->getTimestamp() : rtl::OUString(); m_BinaryWriter.write(aTimeStamp); } } // ----------------------------------------------------------------------------- - void BinaryWriteHandler::writeNodeType(NodeType::Type _eType) + void BinaryWriteHandler::writeNodeType(binary::NodeType::Type _eType) SAL_THROW( (io::IOException, uno::RuntimeException) ) { sal_Int8 nValue = static_cast< sal_Int8 >( _eType ); @@ -362,14 +360,14 @@ namespace configmgr SAL_THROW( (io::IOException, uno::RuntimeException) ) { //write value flags - ValueFlags::Type eType = convertTypeToValueType(_aType); + binary::ValueFlags::Type eType = convertTypeToValueType(_aType); sal_Int8 nValueType = sal_Int8(eType); bool hasUserValue = _aUserValue.hasValue(); bool hasDefault = _aDefaultValue.hasValue(); - if (!hasUserValue) nValueType |= ValueFlags::first_value_NULL; - if (!hasDefault) nValueType |= ValueFlags::second_value_NULL; + if (!hasUserValue) nValueType |= binary::ValueFlags::first_value_NULL; + if (!hasDefault) nValueType |= binary::ValueFlags::second_value_NULL; m_BinaryWriter.write(nValueType); writeAttributes(_aAttributes ); @@ -399,7 +397,7 @@ namespace configmgr void BinaryWriteHandler::writeComponentTree(const ISubtree * _pComponentTree) SAL_THROW( (io::IOException, uno::RuntimeException) ) { - this->writeNodeType(NodeType::component); + this->writeNodeType(binary::NodeType::component); if (_pComponentTree) { this->writeTree(*_pComponentTree); @@ -407,7 +405,7 @@ namespace configmgr } else { - this->writeNodeType(NodeType::nodata); + this->writeNodeType(binary::NodeType::nodata); } } // ----------------------------------------------------------------------------- @@ -415,7 +413,7 @@ namespace configmgr void BinaryWriteHandler::writeTemplatesTree(const ISubtree * _pTemplatesTree) SAL_THROW( (io::IOException, uno::RuntimeException) ) { - this->writeNodeType(NodeType::templates); + this->writeNodeType(binary::NodeType::templates); if (_pTemplatesTree) { this->writeTree(*_pTemplatesTree); @@ -423,7 +421,7 @@ namespace configmgr } else { - this->writeNodeType(NodeType::nodata); + this->writeNodeType(binary::NodeType::nodata); } } // ----------------------------------------------------------------------------- @@ -433,7 +431,7 @@ namespace configmgr { if ( rTree.isSetNode() ) { - this->writeNodeType(NodeType::setnode); + this->writeNodeType(binary::NodeType::setnode); this->writeSetNode( rTree.getName(), rTree.getElementTemplateName(), rTree.getElementTemplateModule(), @@ -441,7 +439,7 @@ namespace configmgr } else { - this->writeNodeType(NodeType::groupnode); + this->writeNodeType(binary::NodeType::groupnode); this->writeGroupNode( rTree.getName(), rTree.getAttributes() ); } @@ -460,7 +458,7 @@ namespace configmgr void BinaryWriteHandler::handle(const ValueNode & rValue) { - this->writeNodeType(NodeType::valuenode); + this->writeNodeType(binary::NodeType::valuenode); this->writeValueNode( rValue.getName(), rValue.getAttributes(), @@ -472,8 +470,8 @@ namespace configmgr bool BinaryWriteHandler::generateHeader(const uno::Reference<backenduno::XLayer> * pLayers, sal_Int32 nNumLayers, - const OUString& aEntity, - const localehelper::LocaleSequence & aKnownLocales ) + const rtl::OUString& aEntity, + const std::vector< com::sun::star::lang::Locale > & aKnownLocales ) SAL_THROW( (io::IOException, uno::RuntimeException) ) { //Open the writer diff --git a/configmgr/source/backend/binarywritehandler.hxx b/configmgr/source/backend/binarywritehandler.hxx index bf9f93cd9c..366b4c78df 100644 --- a/configmgr/source/backend/binarywritehandler.hxx +++ b/configmgr/source/backend/binarywritehandler.hxx @@ -56,12 +56,12 @@ namespace configmgr rtl::OUString m_aComponentName; public: - BinaryWriteHandler(rtl::OUString const & _aFileURL, rtl::OUString const & _aComponentName, MultiServiceFactory const & _aFactory); + BinaryWriteHandler(rtl::OUString const & _aFileURL, rtl::OUString const & _aComponentName, uno::Reference<lang::XMultiServiceFactory> const & _aFactory); bool generateHeader( const uno::Reference<backenduno::XLayer> * pLayers, sal_Int32 nNumLayers, - const OUString& aEntity, - const localehelper::LocaleSequence & aKnownLocales ) + const rtl::OUString& aEntity, + const std::vector< com::sun::star::lang::Locale > & aKnownLocales ) SAL_THROW( (io::IOException, uno::RuntimeException) ); void writeComponentTree(const ISubtree * _pComponentTree) @@ -77,8 +77,8 @@ namespace configmgr virtual void handle(ValueNode const & aValue); private: void writeFileHeader( rtl::OUString const & _aSchemaVersion, - const uno::Sequence<OUString> & aKnownLocales, - const uno::Sequence<OUString> & aDataLocales ) + const uno::Sequence<rtl::OUString> & aKnownLocales, + const uno::Sequence<rtl::OUString> & aDataLocales ) SAL_THROW( (io::IOException, uno::RuntimeException) ); void writeLayerInfoList(uno::Reference<backenduno::XLayer> const * pLayers, sal_Int32 nNumlayers) diff --git a/configmgr/source/backend/binarywriter.cxx b/configmgr/source/backend/binarywriter.cxx index fba858beb4..fafe25f3f1 100644 --- a/configmgr/source/backend/binarywriter.cxx +++ b/configmgr/source/backend/binarywriter.cxx @@ -51,10 +51,6 @@ namespace configmgr // ----------------------------------------------------------------------------- namespace backend { - using namespace ::rtl; - using namespace ::std; - using namespace ::com::sun::star; - using namespace ::com::sun::star::uno; namespace uno = com::sun::star::uno; namespace io = com::sun::star::io; diff --git a/configmgr/source/backend/binarywriter.hxx b/configmgr/source/backend/binarywriter.hxx index 7f482e40df..58c11b82c9 100644 --- a/configmgr/source/backend/binarywriter.hxx +++ b/configmgr/source/backend/binarywriter.hxx @@ -47,8 +47,6 @@ namespace configmgr namespace io = css::io; namespace uno = css::uno; namespace lang = css::lang; - - typedef uno::Reference<lang::XMultiServiceFactory> MultiServiceFactory; // ----------------------------------------------------------------------------- class BinaryWriter @@ -59,7 +57,7 @@ namespace configmgr uno::Reference< io::XDataOutputStream > m_xDataOutputStream; public: - BinaryWriter(rtl::OUString const& m_aFilename, MultiServiceFactory const& _rxServiceProvider); + BinaryWriter(rtl::OUString const& m_aFilename, uno::Reference<lang::XMultiServiceFactory> const& _rxServiceProvider); ~BinaryWriter(); bool open() SAL_THROW( (io::IOException, uno::RuntimeException) ); diff --git a/configmgr/source/backend/componentdatahelper.cxx b/configmgr/source/backend/componentdatahelper.cxx index f7857d1fc0..0007ac1bb7 100644 --- a/configmgr/source/backend/componentdatahelper.cxx +++ b/configmgr/source/backend/componentdatahelper.cxx @@ -46,7 +46,7 @@ #include <com/sun/star/beans/UnknownPropertyException.hpp> // ----------------------------------------------------------------------------- -#define OUSTR( str ) OUString( RTL_CONSTASCII_USTRINGPARAM(str) ) +#define OUSTR( str ) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(str) ) // ----------------------------------------------------------------------------- namespace configmgr { @@ -58,22 +58,20 @@ namespace configmgr namespace lang = ::com::sun::star::lang; namespace beans = ::com::sun::star::beans; namespace container = ::com::sun::star::container; - - using backenduno::MalformedDataException; // ----------------------------------------------------------------------------- -DataBuilderContext::DataBuilderContext( UnoContext const & xContext ) +DataBuilderContext::DataBuilderContext( uno::Reference< uno::XComponentContext > const & xContext ) : m_aLogger(xContext) , m_aParentStack() , m_aActiveComponent() , m_pContext() -, m_aExpectedComponentName(OUString()) +, m_aExpectedComponentName(rtl::OUString()) { } // ----------------------------------------------------------------------------- -DataBuilderContext::DataBuilderContext( UnoContext const & xContext, uno::XInterface * _pContext, ITemplateDataProvider* aTemplateProvider ) +DataBuilderContext::DataBuilderContext( uno::Reference< uno::XComponentContext > const & xContext, uno::XInterface * _pContext, ITemplateDataProvider* aTemplateProvider ) : m_aLogger(xContext) , m_aParentStack() , m_aActiveComponent() @@ -85,7 +83,7 @@ DataBuilderContext::DataBuilderContext( UnoContext const & xContext, uno::XInter } // ----------------------------------------------------------------------------- -DataBuilderContext::DataBuilderContext( UnoContext const & xContext, uno::XInterface * _pContext, const OUString& aExpectedComponentName, ITemplateDataProvider* aTemplateProvider ) +DataBuilderContext::DataBuilderContext( uno::Reference< uno::XComponentContext > const & xContext, uno::XInterface * _pContext, const rtl::OUString& aExpectedComponentName, ITemplateDataProvider* aTemplateProvider ) : m_aLogger(xContext) , m_aParentStack() , m_aActiveComponent() @@ -117,76 +115,76 @@ DataBuilderContext::~DataBuilderContext( ) // ----------------------------------------------------------------------------- void DataBuilderContext::raiseMalformedDataException(sal_Char const * _pText) const - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException, com::sun::star::uno::RuntimeException)) { - OUString const sMessage = makeMessageWithPath(_pText); + rtl::OUString const sMessage = makeMessageWithPath(_pText); m_aLogger.error(sMessage,"parse","configmgr::backend::DataBuilder"); - throw MalformedDataException(sMessage, m_pContext, uno::Any()); + throw backenduno::MalformedDataException(sMessage, m_pContext, uno::Any()); } // ----------------------------------------------------------------------------- void DataBuilderContext::raiseIllegalTypeException(sal_Char const * _pText) const - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException, com::sun::star::uno::RuntimeException)) { - OUString const sMessage = makeMessageWithPath(_pText); + rtl::OUString const sMessage = makeMessageWithPath(_pText); beans::IllegalTypeException e(sMessage, m_pContext); - OUString const sFullMessage = OUSTR("Illegal Type: ").concat(sMessage); + rtl::OUString const sFullMessage = OUSTR("Illegal Type: ").concat(sMessage); m_aLogger.error(sFullMessage,"parse","configmgr::backend::DataBuilder"); - throw MalformedDataException(sFullMessage, m_pContext, uno::makeAny(e)); + throw backenduno::MalformedDataException(sFullMessage, m_pContext, uno::makeAny(e)); } // ----------------------------------------------------------------------------- void DataBuilderContext::raiseIllegalArgumentException(sal_Char const * _pText, sal_Int16 _nPos) const - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)) { - OUString const sMessage = makeMessageWithPath(_pText); + rtl::OUString const sMessage = makeMessageWithPath(_pText); lang::IllegalArgumentException e(sMessage, m_pContext, _nPos); - OUString const sFullMessage = OUSTR("Illegal Argument: ").concat(sMessage); + rtl::OUString const sFullMessage = OUSTR("Illegal Argument: ").concat(sMessage); m_aLogger.error(sFullMessage,"parse","configmgr::backend::DataBuilder"); - throw MalformedDataException(sFullMessage, m_pContext, uno::makeAny(e)); + throw backenduno::MalformedDataException(sFullMessage, m_pContext, uno::makeAny(e)); } // ----------------------------------------------------------------------------- -void DataBuilderContext::raiseNoSuchElementException(sal_Char const * _pText, OUString const & _sElement) const - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) +void DataBuilderContext::raiseNoSuchElementException(sal_Char const * _pText, rtl::OUString const & _sElement) const + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)) { - OUString const sMessage = makeMessageWithName(_pText,_sElement); + rtl::OUString const sMessage = makeMessageWithName(_pText,_sElement); container::NoSuchElementException e(sMessage, m_pContext); - OUString const sFullMessage = OUSTR("No Such Node: ").concat(sMessage); + rtl::OUString const sFullMessage = OUSTR("No Such Node: ").concat(sMessage); m_aLogger.error(sFullMessage,"parse","configmgr::backend::DataBuilder"); - throw MalformedDataException(sFullMessage, m_pContext, uno::makeAny(e)); + throw backenduno::MalformedDataException(sFullMessage, m_pContext, uno::makeAny(e)); } // ----------------------------------------------------------------------------- -void DataBuilderContext::raiseElementExistException(sal_Char const * _pText, OUString const & _sElement) const - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) +void DataBuilderContext::raiseElementExistException(sal_Char const * _pText, rtl::OUString const & _sElement) const + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)) { - OUString const sMessage = makeMessageWithName(_pText,_sElement); + rtl::OUString const sMessage = makeMessageWithName(_pText,_sElement); container::ElementExistException e(sMessage, m_pContext); - OUString const sFullMessage = OUSTR("Node Already Exists: ").concat(sMessage); + rtl::OUString const sFullMessage = OUSTR("Node Already Exists: ").concat(sMessage); m_aLogger.error(sFullMessage,"parse","configmgr::backend::DataBuilder"); - throw MalformedDataException(sFullMessage, m_pContext, uno::makeAny(e)); + throw backenduno::MalformedDataException(sFullMessage, m_pContext, uno::makeAny(e)); } // ----------------------------------------------------------------------------- -void DataBuilderContext::raisePropertyExistException(sal_Char const * _pText, OUString const & _sElement) const - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) +void DataBuilderContext::raisePropertyExistException(sal_Char const * _pText, rtl::OUString const & _sElement) const + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)) { - OUString const sMessage = makeMessageWithName(_pText,_sElement); + rtl::OUString const sMessage = makeMessageWithName(_pText,_sElement); beans::PropertyExistException e(sMessage, m_pContext); - OUString const sFullMessage = OUSTR("No Such Property: ").concat(sMessage); + rtl::OUString const sFullMessage = OUSTR("No Such Property: ").concat(sMessage); m_aLogger.error(sFullMessage,"parse","configmgr::backend::DataBuilder"); - throw MalformedDataException(sFullMessage, m_pContext, uno::makeAny(e)); + throw backenduno::MalformedDataException(sFullMessage, m_pContext, uno::makeAny(e)); } // ----------------------------------------------------------------------------- -OUString DataBuilderContext::makeMessageWithPath(sal_Char const * _pText) const - CFG_UNO_THROW_RTE( ) +rtl::OUString DataBuilderContext::makeMessageWithPath(sal_Char const * _pText) const + SAL_THROW((com::sun::star::uno::RuntimeException)) { rtl::OUStringBuffer sMessage; sMessage.appendAscii(_pText); @@ -197,8 +195,8 @@ OUString DataBuilderContext::makeMessageWithPath(sal_Char const * _pText) const } // ----------------------------------------------------------------------------- -OUString DataBuilderContext::makeMessageWithName(sal_Char const * _pText, OUString const & _aName) const - CFG_UNO_THROW_RTE( ) +rtl::OUString DataBuilderContext::makeMessageWithName(sal_Char const * _pText, rtl::OUString const & _aName) const + SAL_THROW((com::sun::star::uno::RuntimeException)) { rtl::OUStringBuffer sMessage; sMessage.appendAscii(_pText); @@ -213,7 +211,7 @@ OUString DataBuilderContext::makeMessageWithName(sal_Char const * _pText, OUStri // ----------------------------------------------------------------------------- const sal_Unicode k_pathsep = '/'; -OUString DataBuilderContext::getNodeParentagePath() const +rtl::OUString DataBuilderContext::getNodeParentagePath() const { rtl::OUStringBuffer path; @@ -228,7 +226,7 @@ OUString DataBuilderContext::getNodeParentagePath() const } // ----------------------------------------------------------------------------- -OUString DataBuilderContext::getNodePath(OUString const & aNodeName) const +rtl::OUString DataBuilderContext::getNodePath(rtl::OUString const & aNodeName) const { rtl::OUStringBuffer path( getNodeParentagePath() ); @@ -248,7 +246,7 @@ bool DataBuilderContext::isDone() const // ----------------------------------------------------------------------------- ISubtree & DataBuilderContext::implGetCurrentParent() const - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)) { if (m_aParentStack.empty()) raiseMalformedDataException("Invalid Component Data: Operation requires open parent node."); @@ -260,7 +258,7 @@ ISubtree & DataBuilderContext::implGetCurrentParent() const // ----------------------------------------------------------------------------- bool DataBuilderContext::isWritable(INode const * pNode) const - CFG_NOTHROW( ) + SAL_THROW(()) { OSL_PRECOND(pNode,"Unexpected NULL node pointer"); return pNode->getAttributes().isWritable(); @@ -269,7 +267,7 @@ bool DataBuilderContext::isWritable(INode const * pNode) const // ----------------------------------------------------------------------------- bool DataBuilderContext::isRemovable(ISubtree const * pItem) const - CFG_NOTHROW( ) + SAL_THROW(()) { OSL_PRECOND(pItem,"Unexpected NULL item pointer"); return pItem->getAttributes().isRemovable(); @@ -278,7 +276,7 @@ bool DataBuilderContext::isRemovable(ISubtree const * pItem) const // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- -OUString DataBuilderContext::getTemplateComponent( const TemplateIdentifier& aItemType ) const +rtl::OUString DataBuilderContext::getTemplateComponent( const backenduno::TemplateIdentifier& aItemType ) const { if (aItemType.Component.getLength() != 0) return aItemType.Component; @@ -288,9 +286,9 @@ OUString DataBuilderContext::getTemplateComponent( const TemplateIdentifier& aIt } // ----------------------------------------------------------------------------- -TemplateIdentifier DataBuilderContext::completeComponent( const TemplateIdentifier& aItemType ) const +backenduno::TemplateIdentifier DataBuilderContext::completeComponent( const backenduno::TemplateIdentifier& aItemType ) const { - TemplateIdentifier aComplete(aItemType); + backenduno::TemplateIdentifier aComplete(aItemType); if (aComplete.Component.getLength() == 0) aComplete.Component = getActiveComponent(); @@ -299,14 +297,14 @@ TemplateIdentifier DataBuilderContext::completeComponent( const TemplateIdentifi // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- -TemplateIdentifier DataBuilderContext::getCurrentItemType() const - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) +backenduno::TemplateIdentifier DataBuilderContext::getCurrentItemType() const + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)) { ISubtree const * pCurrentSet = getCurrentParent().asISubtree(); if (!pCurrentSet || !pCurrentSet->isSetNode()) raiseMalformedDataException("Component Builder Context: Cannot add/replace node - context is not a set"); - TemplateIdentifier aCompleteType; + backenduno::TemplateIdentifier aCompleteType; aCompleteType.Name = pCurrentSet->getElementTemplateName(); aCompleteType.Component = pCurrentSet->getElementTemplateModule(); @@ -315,14 +313,14 @@ TemplateIdentifier DataBuilderContext::getCurrentItemType() const } // ----------------------------------------------------------------------------- -TemplateIdentifier DataBuilderContext::getValidItemType(TemplateIdentifier const & aItemType) const - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) +backenduno::TemplateIdentifier DataBuilderContext::getValidItemType(backenduno::TemplateIdentifier const & aItemType) const + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)) { ISubtree const * pCurrentSet = getCurrentParent().asISubtree(); if (!pCurrentSet || !pCurrentSet->isSetNode()) raiseMalformedDataException("Component Builder Context: Cannot add/replace node - context is not a set"); - TemplateIdentifier aCompleteType = completeComponent( aItemType ); + backenduno::TemplateIdentifier aCompleteType = completeComponent( aItemType ); // for now only a single item-type is supported if (aCompleteType.Name != pCurrentSet->getElementTemplateName()) @@ -336,7 +334,7 @@ TemplateIdentifier DataBuilderContext::getValidItemType(TemplateIdentifier const // ----------------------------------------------------------------------------- ISubtree * DataBuilderContext::addNodeToCurrent(std::auto_ptr<ISubtree> _aNode) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)) { OSL_PRECOND(_aNode.get(), "ERROR: Adding a NULL node"); @@ -348,7 +346,7 @@ ISubtree * DataBuilderContext::addNodeToCurrent(std::auto_ptr<ISubtree> _aNode // ----------------------------------------------------------------------------- ISubtree * DataBuilderContext::addLocalizedToCurrent(std::auto_ptr<ISubtree> _aNode) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)) { OSL_PRECOND(_aNode.get(), "ERROR: Adding a NULL node"); @@ -360,7 +358,7 @@ ISubtree * DataBuilderContext::addLocalizedToCurrent(std::auto_ptr<ISubtree> _ // ----------------------------------------------------------------------------- ValueNode * DataBuilderContext::addPropertyToCurrent(std::auto_ptr<ValueNode> _aNode, bool _bMayReplace) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)) { OSL_PRECOND(_aNode.get(), "ERROR: Adding a NULL node"); OSL_PRECOND(!_bMayReplace || _aNode->getAttributes().isReplacedForUser(), "Wrong status for added property"); @@ -396,33 +394,33 @@ void DataBuilderContext::markCurrentMerged() // ----------------------------------------------------------------------------- bool DataBuilderContext::isProperty(INode * pProp) const - CFG_UNO_THROW_RTE( ) + SAL_THROW((com::sun::star::uno::RuntimeException)) { OSL_PRECOND(pProp, "ERROR: Unexpected NULL node"); if (pProp == NULL) { - OUString sMsg = makeMessageWithName("INTERNAL ERROR (DataBuilderContext): Trying to inspect NULL node",OUString() ); + rtl::OUString sMsg = makeMessageWithName("INTERNAL ERROR (DataBuilderContext): Trying to inspect NULL node",rtl::OUString() ); throw uno::RuntimeException( sMsg, m_pContext ); } if ( ISubtree * pTree = pProp->asISubtree() ) return isLocalizedValueSet( *pTree ); - OSL_ENSURE( pProp->ISA(ValueNode), "Unexpected node type"); + OSL_ASSERT(dynamic_cast< ValueNode * >(pProp) != 0); return true; } // ----------------------------------------------------------------------------- -INode * DataBuilderContext::findChild(OUString const & _aName) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) +INode * DataBuilderContext::findChild(rtl::OUString const & _aName) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)) { return getCurrentParent().getChild(_aName); } // ----------------------------------------------------------------------------- -INode * DataBuilderContext::findProperty(OUString const & _aName) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) +INode * DataBuilderContext::findProperty(rtl::OUString const & _aName) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)) { INode * pResult = findChild(_aName); if (pResult && !isProperty(pResult)) @@ -433,8 +431,8 @@ INode * DataBuilderContext::findProperty(OUString const & _aName) } // ----------------------------------------------------------------------------- -ISubtree * DataBuilderContext::findNode(OUString const & _aName) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) +ISubtree * DataBuilderContext::findNode(rtl::OUString const & _aName) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)) { INode * pResult = findChild(_aName); @@ -444,20 +442,20 @@ ISubtree * DataBuilderContext::findNode(OUString const & _aName) if (!isNode(pResult)) raiseMalformedDataException("Component Builder Context: Found an existing property, where an inner node was expected"); - OSL_ASSERT(pResult->ISA(ISubtree)); + OSL_ASSERT(dynamic_cast< ISubtree * >(pResult) != 0); return pResult->asISubtree(); } // ----------------------------------------------------------------------------- void DataBuilderContext::pushNode(ISubtree * pTree) - CFG_UNO_THROW_RTE( ) + SAL_THROW((com::sun::star::uno::RuntimeException)) { OSL_PRECOND(hasActiveComponent(), "Component Builder Context: Entering a node without having an active component"); OSL_PRECOND(pTree, "ERROR: Pushing a NULL tree"); if (pTree == NULL) { - OUString sMsg = makeMessageWithName("INTERNAL ERROR (DataBuilderContext): Trying to push NULL tree",OUString() ); + rtl::OUString sMsg = makeMessageWithName("INTERNAL ERROR (DataBuilderContext): Trying to push NULL tree",rtl::OUString() ); throw uno::RuntimeException( sMsg, m_pContext ); } m_aParentStack.push(pTree); @@ -465,7 +463,7 @@ void DataBuilderContext::pushNode(ISubtree * pTree) // ----------------------------------------------------------------------------- void DataBuilderContext::popNode() - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)) { OSL_PRECOND(hasActiveComponent(), "Component Builder Context: Leaving a node without having an active component"); if (m_aParentStack.empty()) @@ -477,8 +475,8 @@ void DataBuilderContext::popNode() } // ----------------------------------------------------------------------------- -void DataBuilderContext::startActiveComponent(OUString const & _aComponent) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) +void DataBuilderContext::startActiveComponent(rtl::OUString const & _aComponent) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)) { OSL_PRECOND(!hasActiveComponent(), "Component Builder Context: Component is already active"); OSL_PRECOND(m_aParentStack.empty(), "Component Builder Context: Starting Component/Template while inside a node"); @@ -498,7 +496,7 @@ void DataBuilderContext::startActiveComponent(OUString const & _aComponent) // ----------------------------------------------------------------------------- void DataBuilderContext::endActiveComponent() - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)) { OSL_PRECOND( hasActiveComponent(), "Component Builder Context: No Component active"); OSL_PRECOND(m_aParentStack.empty(), "Component Builder Context: Ending Component/Template while inside a node"); @@ -506,12 +504,12 @@ void DataBuilderContext::endActiveComponent() if (!m_aParentStack.empty()) raiseMalformedDataException("Invalid Component Data: Ending component while node is still open"); - m_aActiveComponent = OUString(); + m_aActiveComponent = rtl::OUString(); OSL_POSTCOND(!hasActiveComponent(), "Component Builder Context: Could not end Component/Template"); } // ----------------------------------------------------------------------------- -TemplateResult DataBuilderContext::getTemplateData (TemplateRequest const & _aRequest ) +ResultHolder< TemplateInstance > DataBuilderContext::getTemplateData (TemplateRequest const & _aRequest ) { return(m_aTemplateProvider->getTemplateData (_aRequest)); } @@ -523,7 +521,7 @@ ComponentDataFactory::ComponentDataFactory() } // ----------------------------------------------------------------------------- -std::auto_ptr<ISubtree> ComponentDataFactory::createGroup( OUString const & _aName, +std::auto_ptr<ISubtree> ComponentDataFactory::createGroup( rtl::OUString const & _aName, bool _bExtensible, node::Attributes const & _aAttributes) const { @@ -542,8 +540,8 @@ std::auto_ptr<ISubtree> ComponentDataFactory::createGroup( OUString const & _aNa } // ----------------------------------------------------------------------------- -std::auto_ptr<ISubtree> ComponentDataFactory::createSet(OUString const & _aName, - TemplateIdentifier const & _aItemType, +std::auto_ptr<ISubtree> ComponentDataFactory::createSet(rtl::OUString const & _aName, + backenduno::TemplateIdentifier const & _aItemType, bool _bExtensible, node::Attributes const & _aAttributes) const { @@ -558,7 +556,7 @@ std::auto_ptr<ISubtree> ComponentDataFactory::createSet(OUString const & _aName, } // ----------------------------------------------------------------------------- -std::auto_ptr<ISubtree> ComponentDataFactory::createLocalizedContainer( OUString const & _aName, +std::auto_ptr<ISubtree> ComponentDataFactory::createLocalizedContainer( rtl::OUString const & _aName, uno::Type const & _aValueType, node::Attributes const & _aAttributes) const { @@ -581,8 +579,8 @@ namespace } // ----------------------------------------------------------------------------- -std::auto_ptr<ISubtree> ComponentDataFactory::createPlaceHolder(OUString const & _aName, - TemplateIdentifier const & _aInstanceType) const +std::auto_ptr<ISubtree> ComponentDataFactory::createPlaceHolder(rtl::OUString const & _aName, + backenduno::TemplateIdentifier const & _aInstanceType) const { return getNodeFactory().createSetNode( _aName, INSTANCE_MARKER + _aInstanceType.Name, @@ -597,11 +595,11 @@ bool ComponentDataFactory::isInstancePlaceHolder(ISubtree const & _aInstanceTree } // ----------------------------------------------------------------------------- -TemplateIdentifier ComponentDataFactory::getInstanceType(ISubtree const & _aInstanceTree) +backenduno::TemplateIdentifier ComponentDataFactory::getInstanceType(ISubtree const & _aInstanceTree) { OSL_ENSURE( isInstancePlaceHolder(_aInstanceTree), "Instance placeholder tree expected" ); - TemplateIdentifier aResult; + backenduno::TemplateIdentifier aResult; if (isInstancePlaceHolder(_aInstanceTree)) { diff --git a/configmgr/source/backend/componentdatahelper.hxx b/configmgr/source/backend/componentdatahelper.hxx index a3c1f71992..f482274fca 100644 --- a/configmgr/source/backend/componentdatahelper.hxx +++ b/configmgr/source/backend/componentdatahelper.hxx @@ -61,124 +61,119 @@ namespace configmgr namespace uno = ::com::sun::star::uno; namespace backenduno = ::com::sun::star::configuration::backend; - using backenduno::TemplateIdentifier; - - using ::rtl::OUString; - // ----------------------------------------------------------------------------- class DataBuilderContext { Logger m_aLogger; Stack< ISubtree * > m_aParentStack; - OUString m_aActiveComponent; + rtl::OUString m_aActiveComponent; uno::XInterface * m_pContext; - OUString m_aExpectedComponentName; + rtl::OUString m_aExpectedComponentName; ITemplateDataProvider * m_aTemplateProvider; public: - typedef uno::Reference< uno::XComponentContext > UnoContext; - explicit DataBuilderContext(UnoContext const & xContext); - DataBuilderContext(UnoContext const & xContext, uno::XInterface * _pContext , ITemplateDataProvider* aTemplateProvider = NULL); - DataBuilderContext(UnoContext const & xContext, uno::XInterface * _pContext, const OUString& aExpectedComponentName,ITemplateDataProvider* aTemplateProvider = NULL ); + explicit DataBuilderContext(uno::Reference< uno::XComponentContext > const & xContext); + DataBuilderContext(uno::Reference< uno::XComponentContext > const & xContext, uno::XInterface * _pContext , ITemplateDataProvider* aTemplateProvider = NULL); + DataBuilderContext(uno::Reference< uno::XComponentContext > const & xContext, uno::XInterface * _pContext, const rtl::OUString& aExpectedComponentName,ITemplateDataProvider* aTemplateProvider = NULL ); DataBuilderContext(DataBuilderContext const & aBaseContext, uno::XInterface * _pContext); ~DataBuilderContext(); bool isDone() const; bool hasActiveComponent() const { return m_aActiveComponent.getLength() != 0; } - OUString getActiveComponent() const { return m_aActiveComponent; } + rtl::OUString getActiveComponent() const { return m_aActiveComponent; } ISubtree & getCurrentParent() - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)) { return implGetCurrentParent(); } ISubtree const & getCurrentParent() const - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)) { return implGetCurrentParent(); } node::Attributes getCurrentAttributes() const - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)) { return implGetCurrentParent().getAttributes(); } ITemplateDataProvider * getTemplateProvider() const { return m_aTemplateProvider; } - OUString getTemplateComponent(TemplateIdentifier const & aItemType ) const; + rtl::OUString getTemplateComponent(backenduno::TemplateIdentifier const & aItemType ) const; - TemplateIdentifier completeComponent(TemplateIdentifier const & aItemType ) const; + backenduno::TemplateIdentifier completeComponent(backenduno::TemplateIdentifier const & aItemType ) const; - TemplateIdentifier getCurrentItemType() const - CFG_UNO_THROW1( configuration::backend::MalformedDataException ); - TemplateIdentifier getValidItemType(TemplateIdentifier const & aItemType) const - CFG_UNO_THROW1( configuration::backend::MalformedDataException ); + backenduno::TemplateIdentifier getCurrentItemType() const + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)); + backenduno::TemplateIdentifier getValidItemType(backenduno::TemplateIdentifier const & aItemType) const + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)); - void startActiveComponent(OUString const & _aComponent) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ); + void startActiveComponent(rtl::OUString const & _aComponent) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)); void endActiveComponent() - CFG_UNO_THROW1( configuration::backend::MalformedDataException ); + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)); bool isProperty(INode * pProp) const - CFG_UNO_THROW_RTE(); + SAL_THROW((com::sun::star::uno::RuntimeException)); - bool isNode(INode * pNode) const CFG_UNO_THROW_RTE() + bool isNode(INode * pNode) const SAL_THROW((com::sun::star::uno::RuntimeException)) { return !isProperty(pNode); } void pushNode(ISubtree * pTree) - CFG_UNO_THROW_RTE(); + SAL_THROW((com::sun::star::uno::RuntimeException)); void popNode() - CFG_UNO_THROW1( configuration::backend::MalformedDataException ); + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)); - INode * findProperty(OUString const & _aName) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ); - ISubtree * findNode(OUString const & _aName) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ); + INode * findProperty(rtl::OUString const & _aName) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)); + ISubtree * findNode(rtl::OUString const & _aName) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)); bool isWritable(INode const * pNode) const - CFG_NOTHROW( ); + SAL_THROW(()); bool isRemovable(ISubtree const * pItem) const - CFG_NOTHROW( ); + SAL_THROW(()); ISubtree * addNodeToCurrent(std::auto_ptr<ISubtree> _aNode) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ); + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)); ISubtree * addLocalizedToCurrent(std::auto_ptr<ISubtree> _aNode) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ); + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)); ValueNode * addPropertyToCurrent(std::auto_ptr<ValueNode> _aNode, bool _bMayReplace = false) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ); + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)); void markCurrentMerged(); // Logging support Logger const & getLogger() const { return m_aLogger; } - OUString getNodeParentagePath() const; - OUString getNodePath(OUString const & aNodeName) const; + rtl::OUString getNodeParentagePath() const; + rtl::OUString getNodePath(rtl::OUString const & aNodeName) const; // Exception support void raiseMalformedDataException (sal_Char const * _pText) const - CFG_UNO_THROW1( configuration::backend::MalformedDataException ); + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)); void raiseIllegalArgumentException (sal_Char const * _pText, sal_Int16 _nPos = 0) const - CFG_UNO_THROW1( configuration::backend::MalformedDataException ); - void raiseElementExistException (sal_Char const * _pText, OUString const & _sElement) const - CFG_UNO_THROW1( configuration::backend::MalformedDataException ); - void raiseNoSuchElementException (sal_Char const * _pText, OUString const & _sElement) const - CFG_UNO_THROW1( configuration::backend::MalformedDataException ); - void raisePropertyExistException (sal_Char const * _pText, OUString const & _sElement) const - CFG_UNO_THROW1( configuration::backend::MalformedDataException ); + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)); + void raiseElementExistException (sal_Char const * _pText, rtl::OUString const & _sElement) const + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)); + void raiseNoSuchElementException (sal_Char const * _pText, rtl::OUString const & _sElement) const + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)); + void raisePropertyExistException (sal_Char const * _pText, rtl::OUString const & _sElement) const + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)); void raiseIllegalTypeException (sal_Char const * _pText) const - CFG_UNO_THROW1( configuration::backend::MalformedDataException ); - TemplateResult getTemplateData (TemplateRequest const & _aRequest ); + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)); + ResultHolder< TemplateInstance > getTemplateData (TemplateRequest const & _aRequest ); private: - INode * findChild(OUString const & _aName) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ); + INode * findChild(rtl::OUString const & _aName) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)); - OUString makeMessageWithPath(sal_Char const * _pText) const - CFG_UNO_THROW_RTE( ); + rtl::OUString makeMessageWithPath(sal_Char const * _pText) const + SAL_THROW((com::sun::star::uno::RuntimeException)); - OUString makeMessageWithName(sal_Char const * _pText, OUString const & _aName) const - CFG_UNO_THROW_RTE( ); + rtl::OUString makeMessageWithName(sal_Char const * _pText, rtl::OUString const & _aName) const + SAL_THROW((com::sun::star::uno::RuntimeException)); ISubtree & implGetCurrentParent() const - CFG_UNO_THROW1( configuration::backend::MalformedDataException ); + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)); }; // ----------------------------------------------------------------------------- @@ -196,24 +191,24 @@ namespace configmgr public: OTreeNodeFactory& getNodeFactory() const { return m_rNodeFactory; } - std::auto_ptr<ISubtree> createGroup(OUString const & _aName, + std::auto_ptr<ISubtree> createGroup(rtl::OUString const & _aName, bool _bExtensible, node::Attributes const & _aAttributes) const; - std::auto_ptr<ISubtree> createSet( OUString const & _aName, - TemplateIdentifier const & aItemType, + std::auto_ptr<ISubtree> createSet( rtl::OUString const & _aName, + backenduno::TemplateIdentifier const & aItemType, bool _bExtensible, node::Attributes const & _aAttributes) const; - std::auto_ptr<ISubtree> createLocalizedContainer(OUString const & _aName, + std::auto_ptr<ISubtree> createLocalizedContainer(rtl::OUString const & _aName, uno::Type const & _aValueType, node::Attributes const & _aAttributes) const; - std::auto_ptr<ISubtree> createPlaceHolder(OUString const & _aName, - TemplateIdentifier const & _aInstanceType) const; + std::auto_ptr<ISubtree> createPlaceHolder(rtl::OUString const & _aName, + backenduno::TemplateIdentifier const & _aInstanceType) const; static bool isInstancePlaceHolder(ISubtree const & _aInstanceTree); - static TemplateIdentifier getInstanceType(ISubtree const & _aInstanceTree); + static backenduno::TemplateIdentifier getInstanceType(ISubtree const & _aInstanceTree); }; // ----------------------------------------------------------------------------- } // namespace backend diff --git a/configmgr/source/backend/emptylayer.cxx b/configmgr/source/backend/emptylayer.cxx index c1a52f770d..bd174556ee 100644 --- a/configmgr/source/backend/emptylayer.cxx +++ b/configmgr/source/backend/emptylayer.cxx @@ -90,7 +90,7 @@ namespace configmgr aHandler->endLayer(); } else - throw lang::NullPointerException(OUString::createFromAscii("EmptyLayer: Null Handler"),*this); + throw lang::NullPointerException(rtl::OUString::createFromAscii("EmptyLayer: Null Handler"),*this); } // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- @@ -128,21 +128,21 @@ namespace configmgr } // ----------------------------------------------------------------------------- - void SAL_CALL RequireEmptyLayer::overrideNode( const OUString& /*aName*/, sal_Int16 /*aAttributes*/, sal_Bool /*bClear*/ ) + void SAL_CALL RequireEmptyLayer::overrideNode( const rtl::OUString& /*aName*/, sal_Int16 /*aAttributes*/, sal_Bool /*bClear*/ ) throw (backenduno::MalformedDataException, uno::RuntimeException) { failNotEmpty(); } // ----------------------------------------------------------------------------- - void SAL_CALL RequireEmptyLayer::addOrReplaceNode( const OUString& /*aName*/, sal_Int16 /*aAttributes*/ ) + void SAL_CALL RequireEmptyLayer::addOrReplaceNode( const rtl::OUString& /*aName*/, sal_Int16 /*aAttributes*/ ) throw (backenduno::MalformedDataException, uno::RuntimeException) { failNotEmpty(); } // ----------------------------------------------------------------------------- - void SAL_CALL RequireEmptyLayer::addOrReplaceNodeFromTemplate( const OUString& /*aName*/, const backenduno::TemplateIdentifier& /*aTemplate*/, sal_Int16 /*aAttributes*/) + void SAL_CALL RequireEmptyLayer::addOrReplaceNodeFromTemplate( const rtl::OUString& /*aName*/, const backenduno::TemplateIdentifier& /*aTemplate*/, sal_Int16 /*aAttributes*/) throw (backenduno::MalformedDataException, uno::RuntimeException) { failNotEmpty(); @@ -156,28 +156,28 @@ namespace configmgr } // ----------------------------------------------------------------------------- - void SAL_CALL RequireEmptyLayer::dropNode( const OUString& /*aName*/ ) + void SAL_CALL RequireEmptyLayer::dropNode( const rtl::OUString& /*aName*/ ) throw (backenduno::MalformedDataException, uno::RuntimeException) { failNotEmpty(); } // ----------------------------------------------------------------------------- - void SAL_CALL RequireEmptyLayer::addProperty( const OUString& /*aName*/, sal_Int16 /*aAttributes*/, const uno::Type& /*aType*/ ) + void SAL_CALL RequireEmptyLayer::addProperty( const rtl::OUString& /*aName*/, sal_Int16 /*aAttributes*/, const uno::Type& /*aType*/ ) throw (backenduno::MalformedDataException, uno::RuntimeException) { failNotEmpty(); } // ----------------------------------------------------------------------------- - void SAL_CALL RequireEmptyLayer::addPropertyWithValue( const OUString& /*aName*/, sal_Int16 /*aAttributes*/, const uno::Any& /*aValue*/ ) + void SAL_CALL RequireEmptyLayer::addPropertyWithValue( const rtl::OUString& /*aName*/, sal_Int16 /*aAttributes*/, const uno::Any& /*aValue*/ ) throw (backenduno::MalformedDataException, uno::RuntimeException) { failNotEmpty(); } // ----------------------------------------------------------------------------- - void SAL_CALL RequireEmptyLayer::overrideProperty( const OUString& /*aName*/, sal_Int16 /*aAttributes*/, const uno::Type& /*aType*/, sal_Bool /*bClear*/ ) + void SAL_CALL RequireEmptyLayer::overrideProperty( const rtl::OUString& /*aName*/, sal_Int16 /*aAttributes*/, const uno::Type& /*aType*/, sal_Bool /*bClear*/ ) throw (backenduno::MalformedDataException, uno::RuntimeException) { failNotEmpty(); @@ -198,7 +198,7 @@ namespace configmgr } // ----------------------------------------------------------------------------- - void SAL_CALL RequireEmptyLayer::setPropertyValueForLocale( const uno::Any& /*aValue*/, const OUString& /*aLocale*/ ) + void SAL_CALL RequireEmptyLayer::setPropertyValueForLocale( const uno::Any& /*aValue*/, const rtl::OUString& /*aLocale*/ ) throw (backenduno::MalformedDataException, uno::RuntimeException) { failNotEmpty(); @@ -212,7 +212,7 @@ namespace configmgr m_bStarted = false; OSL_ASSERT(pMsg); - OUString sMsg = OUString::createFromAscii(pMsg); + rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg); throw backenduno::MalformedDataException( sMsg, *this, uno::Any() ); } diff --git a/configmgr/source/backend/emptylayerimpl.hxx b/configmgr/source/backend/emptylayerimpl.hxx index bed98152f7..3c57face40 100644 --- a/configmgr/source/backend/emptylayerimpl.hxx +++ b/configmgr/source/backend/emptylayerimpl.hxx @@ -42,7 +42,6 @@ namespace configmgr namespace backend { // ----------------------------------------------------------------------------- - using rtl::OUString; namespace uno = ::com::sun::star::uno; namespace lang = ::com::sun::star::lang; namespace backenduno = ::com::sun::star::configuration::backend; @@ -80,15 +79,15 @@ namespace configmgr throw (backenduno::MalformedDataException, uno::RuntimeException); virtual void SAL_CALL - overrideNode( const OUString& aName, sal_Int16 aAttributes, sal_Bool bClear ) + overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear ) throw (backenduno::MalformedDataException, uno::RuntimeException); virtual void SAL_CALL - addOrReplaceNode( const OUString& aName, sal_Int16 aAttributes ) + addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes ) throw (backenduno::MalformedDataException, uno::RuntimeException); virtual void SAL_CALL - addOrReplaceNodeFromTemplate( const OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes ) + addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes ) throw (backenduno::MalformedDataException, uno::RuntimeException); virtual void SAL_CALL @@ -96,19 +95,19 @@ namespace configmgr throw (backenduno::MalformedDataException, uno::RuntimeException); virtual void SAL_CALL - dropNode( const OUString& aName ) + dropNode( const rtl::OUString& aName ) throw (backenduno::MalformedDataException, uno::RuntimeException); virtual void SAL_CALL - overrideProperty( const OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear ) + overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear ) throw (backenduno::MalformedDataException, uno::RuntimeException); virtual void SAL_CALL - addProperty( const OUString& aName, sal_Int16 aAttributes, const uno::Type& aType ) + addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType ) throw (backenduno::MalformedDataException, uno::RuntimeException); virtual void SAL_CALL - addPropertyWithValue( const OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue ) + addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue ) throw (backenduno::MalformedDataException, uno::RuntimeException); virtual void SAL_CALL @@ -120,7 +119,7 @@ namespace configmgr throw (backenduno::MalformedDataException, uno::RuntimeException); virtual void SAL_CALL - setPropertyValueForLocale( const uno::Any& aValue, const OUString& aLocale ) + setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString& aLocale ) throw (backenduno::MalformedDataException, uno::RuntimeException); private: diff --git a/configmgr/source/backend/importmergehandler.cxx b/configmgr/source/backend/importmergehandler.cxx index 1a13e2a2e2..df863cbc88 100644 --- a/configmgr/source/backend/importmergehandler.cxx +++ b/configmgr/source/backend/importmergehandler.cxx @@ -50,7 +50,7 @@ namespace configmgr // ----------------------------------------------------------------------------- ImportMergeHandler::ImportMergeHandler( - Backend const & xTargetBackend, Mode mode, OUString const & aEntity, sal_Bool const & bNotify ) + uno::Reference< backenduno::XBackend > const & xTargetBackend, Mode mode, rtl::OUString const & aEntity, sal_Bool const & bNotify ) : BasicImportHandler(xTargetBackend,aEntity, bNotify) , m_xOutputHandler() , m_mode(mode) @@ -77,7 +77,7 @@ inline void ImportMergeHandler::checkStarted() } // ----------------------------------------------------------------------------- -inline ImportMergeHandler::OutputHandler ImportMergeHandler::getOutputHandler() +inline uno::Reference< backenduno::XUpdateHandler > ImportMergeHandler::getOutputHandler() { checkStarted(); return m_xOutputHandler; @@ -93,7 +93,7 @@ bool setHandlerProperty(uno::Reference< uno::XInterface > const & xHandler, char try { uno::Sequence< uno::Any > aArgs(1); - aArgs[0] <<= beans::NamedValue( OUString::createFromAscii(property), uno::makeAny(value) ); + aArgs[0] <<= beans::NamedValue( rtl::OUString::createFromAscii(property), uno::makeAny(value) ); xInitHandler->initialize(aArgs); return true; } @@ -114,14 +114,12 @@ bool setHandlerProperty(uno::Reference< uno::XInterface > const & xHandler, char return false; } // ----------------------------------------------------------------------------- -ImportMergeHandler::OutputHandler ImportMergeHandler::createOutputHandler() +uno::Reference< backenduno::XUpdateHandler > ImportMergeHandler::createOutputHandler() { - using rtl::OUStringBuffer; - OSL_PRECOND( hasComponent(), "Trying to create output-handler for Import Merger without setting a component first") ; - OUString const aComponentName = this->getComponent(); + rtl::OUString const aComponentName = this->getComponent(); - OutputHandler xOutputHandler; + uno::Reference< backenduno::XUpdateHandler > xOutputHandler; try { xOutputHandler = hasEntity() ? getBackend()->getUpdateHandler(aComponentName,getEntity()) @@ -129,7 +127,7 @@ ImportMergeHandler::OutputHandler ImportMergeHandler::createOutputHandler() } catch (lang::NoSupportException & e) { - OUStringBuffer sMessage; + rtl::OUStringBuffer sMessage; sMessage.appendAscii("configmgr::backend::ImportHandler: "); sMessage.appendAscii("Could not get output handler for component ").append(aComponentName); sMessage.appendAscii(": Backend does not support updates - ").append( e.Message ); @@ -138,7 +136,7 @@ ImportMergeHandler::OutputHandler ImportMergeHandler::createOutputHandler() } catch (lang::IllegalArgumentException & e) { - OUStringBuffer sMessage; + rtl::OUStringBuffer sMessage; sMessage.appendAscii("configmgr::backend::ImportHandler: "); sMessage.appendAscii("Could not get output handler for component ").append(aComponentName); sMessage.appendAscii(" due to a backend exception: ").append( e.Message ); @@ -148,7 +146,7 @@ ImportMergeHandler::OutputHandler ImportMergeHandler::createOutputHandler() if (!xOutputHandler.is()) { - OUStringBuffer sMessage; + rtl::OUStringBuffer sMessage; sMessage.appendAscii("configmgr::backend::ImportHandler: "); sMessage.appendAscii("Cannot import. ERROR - The backend returns a NULL handler for component ") .append(aComponentName).append( sal_Unicode('.') ); @@ -172,7 +170,7 @@ ImportMergeHandler::OutputHandler ImportMergeHandler::createOutputHandler() // XLayerHandler void SAL_CALL ImportMergeHandler::startLayer( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { m_xOutputHandler.clear(); @@ -181,7 +179,7 @@ void SAL_CALL ImportMergeHandler::startLayer( ) // ----------------------------------------------------------------------------- void SAL_CALL ImportMergeHandler::endLayer( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (isStarted()) try @@ -190,7 +188,7 @@ void SAL_CALL ImportMergeHandler::endLayer( ) } catch (lang::IllegalAccessException & iae) { - OUString const sMsg(RTL_CONSTASCII_USTRINGPARAM("ImportHandler - no write access to layer: ")); + rtl::OUString const sMsg(RTL_CONSTASCII_USTRINGPARAM("ImportHandler - no write access to layer: ")); throw lang::WrappedTargetException(sMsg.concat(iae.Message),*this,uno::makeAny(iae)); } @@ -199,8 +197,8 @@ void SAL_CALL ImportMergeHandler::endLayer( ) } // ----------------------------------------------------------------------------- -void SAL_CALL ImportMergeHandler::overrideNode( const OUString& aName, sal_Int16 aAttributes, sal_Bool bClear ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL ImportMergeHandler::overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (!isStarted() && startComponent(aName)) try @@ -209,7 +207,7 @@ void SAL_CALL ImportMergeHandler::overrideNode( const OUString& aName, sal_Int16 } catch (lang::IllegalAccessException & iae) { - OUString const sMsg(RTL_CONSTASCII_USTRINGPARAM("ImportHandler - no write access to layer: ")); + rtl::OUString const sMsg(RTL_CONSTASCII_USTRINGPARAM("ImportHandler - no write access to layer: ")); throw lang::WrappedTargetException(sMsg.concat(iae.Message),*this,uno::makeAny(iae)); } @@ -220,36 +218,36 @@ void SAL_CALL ImportMergeHandler::overrideNode( const OUString& aName, sal_Int16 } // ----------------------------------------------------------------------------- -void SAL_CALL ImportMergeHandler::addOrReplaceNode( const OUString& aName, sal_Int16 aAttributes ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL ImportMergeHandler::addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { getOutputHandler()->addOrReplaceNode(aName,aAttributes); } // ----------------------------------------------------------------------------- -void SAL_CALL ImportMergeHandler::addOrReplaceNodeFromTemplate( const OUString& aName, const TemplateIdentifier& aTemplate, sal_Int16 aAttributes ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL ImportMergeHandler::addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { getOutputHandler()->addOrReplaceNodeFromTemplate(aName,aAttributes,aTemplate); } // ----------------------------------------------------------------------------- void SAL_CALL ImportMergeHandler::endNode( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { getOutputHandler()->endNode(); } // ----------------------------------------------------------------------------- -void SAL_CALL ImportMergeHandler::dropNode( const OUString& aName ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL ImportMergeHandler::dropNode( const rtl::OUString& aName ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { getOutputHandler()->removeNode(aName); } // ----------------------------------------------------------------------------- -void SAL_CALL ImportMergeHandler::overrideProperty( const OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL ImportMergeHandler::overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { (void) bClear; // avoid warning about unused parameter OSL_ENSURE(!bClear,"'clear' operation not supported on import"); @@ -258,35 +256,35 @@ void SAL_CALL ImportMergeHandler::overrideProperty( const OUString& aName, sal_I // ----------------------------------------------------------------------------- void SAL_CALL ImportMergeHandler::endProperty( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { getOutputHandler()->endProperty(); } // ----------------------------------------------------------------------------- void SAL_CALL ImportMergeHandler::setPropertyValue( const uno::Any& aValue ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { getOutputHandler()->setPropertyValue(aValue); } // ----------------------------------------------------------------------------- -void SAL_CALL ImportMergeHandler::setPropertyValueForLocale( const uno::Any& aValue, const OUString & aLocale ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL ImportMergeHandler::setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString & aLocale ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { getOutputHandler()->setPropertyValueForLocale(aValue,aLocale); } // ----------------------------------------------------------------------------- -void SAL_CALL ImportMergeHandler::addProperty( const OUString& aName, sal_Int16 aAttributes, const uno::Type& aType ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL ImportMergeHandler::addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { getOutputHandler()->addOrReplaceProperty(aName, aAttributes, aType); } // ----------------------------------------------------------------------------- -void SAL_CALL ImportMergeHandler::addPropertyWithValue( const OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL ImportMergeHandler::addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { getOutputHandler()->addOrReplacePropertyWithValue(aName, aAttributes, aValue); } diff --git a/configmgr/source/backend/importmergehandler.hxx b/configmgr/source/backend/importmergehandler.hxx index 44a3c81dbf..8e0983856c 100644 --- a/configmgr/source/backend/importmergehandler.hxx +++ b/configmgr/source/backend/importmergehandler.hxx @@ -41,12 +41,9 @@ namespace configmgr namespace backend { // ----------------------------------------------------------------------------- - using rtl::OUString; namespace uno = ::com::sun::star::uno; namespace lang = ::com::sun::star::lang; namespace backenduno = ::com::sun::star::configuration::backend; - using backenduno::MalformedDataException; - using backenduno::TemplateIdentifier; // ----------------------------------------------------------------------------- class ImportMergeHandler : public BasicImportHandler @@ -60,74 +57,72 @@ namespace configmgr }; explicit - ImportMergeHandler(Backend const & xTargetBackend, Mode mode, - OUString const & aEntity = OUString(), sal_Bool const & bNotify = sal_False); + ImportMergeHandler(uno::Reference< backenduno::XBackend > const & xTargetBackend, Mode mode, + rtl::OUString const & aEntity = rtl::OUString(), sal_Bool const & bNotify = sal_False); // XLayerHandler protected: virtual void SAL_CALL startLayer( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL endLayer( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - overrideNode( const OUString& aName, sal_Int16 aAttributes, sal_Bool bClear ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - addOrReplaceNode( const OUString& aName, sal_Int16 aAttributes ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - addOrReplaceNodeFromTemplate( const OUString& aName, const TemplateIdentifier& aTemplate, sal_Int16 aAttributes ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL endNode( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - dropNode( const OUString& aName ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + dropNode( const rtl::OUString& aName ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - overrideProperty( const OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL endProperty( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL setPropertyValue( const uno::Any& aValue ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - setPropertyValueForLocale( const uno::Any& aValue, const OUString & aLocale ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString & aLocale ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - addProperty( const OUString& aName, sal_Int16 aAttributes, const uno::Type& aType ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - addPropertyWithValue( const OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); private: - typedef uno::Reference< backenduno::XUpdateHandler > OutputHandler; - bool isStarted() const; void checkStarted(); void failNotStarted(); - OutputHandler getOutputHandler(); + uno::Reference< backenduno::XUpdateHandler > getOutputHandler(); - OutputHandler createOutputHandler(); + uno::Reference< backenduno::XUpdateHandler > createOutputHandler(); private: - OutputHandler m_xOutputHandler; + uno::Reference< backenduno::XUpdateHandler > m_xOutputHandler; Mode m_mode; }; // ----------------------------------------------------------------------------- diff --git a/configmgr/source/backend/importsvc.cxx b/configmgr/source/backend/importsvc.cxx index 8a3779ee8c..0e20097e1e 100644 --- a/configmgr/source/backend/importsvc.cxx +++ b/configmgr/source/backend/importsvc.cxx @@ -54,7 +54,7 @@ namespace configmgr // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- -AsciiServiceName const aMergeImporterServices[] = +sal_Char const * const aMergeImporterServices[] = { "com.sun.star.configuration.backend.MergeImporter", 0, @@ -72,35 +72,35 @@ const ServiceRegistrationInfo* getMergeImportServiceInfo() { return getRegistrationInfo(& aMergeImporterSI); } // ----------------------------------------------------------------------------- -MergeImportService::MergeImportService(CreationArg _xContext) +MergeImportService::MergeImportService(uno::Reference< uno::XComponentContext > const & _xContext) : ImportService(_xContext, &aMergeImporterSI) { } // ----------------------------------------------------------------------------- uno::Reference< uno::XInterface > SAL_CALL instantiateMergeImporter -( CreationContext const& xContext ) +( uno::Reference< uno::XComponentContext > const& xContext ) { return * new MergeImportService( xContext ); } // ----------------------------------------------------------------------------- -MergeImportService::InputHandler MergeImportService::createImportHandler(Backend const & xBackend, OUString const & aEntity) +uno::Reference< backenduno::XLayerHandler > MergeImportService::createImportHandler(uno::Reference< backenduno::XBackend > const & xBackend, rtl::OUString const & aEntity) { if (!xBackend.is()) { - OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("configmgr::backend::ImportService: Trying to import without a backend. No default backend could be created") ); + rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("configmgr::backend::ImportService: Trying to import without a backend. No default backend could be created") ); throw lang::NullPointerException(sMessage,*this); } - InputHandler aHandler( new ImportMergeHandler(xBackend, ImportMergeHandler::merge, aEntity, m_bSendNotification) ); + uno::Reference< backenduno::XLayerHandler > aHandler( new ImportMergeHandler(xBackend, ImportMergeHandler::merge, aEntity, m_bSendNotification) ); return aHandler; } // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- -AsciiServiceName const aCopyImporterServices[] = +sal_Char const * const aCopyImporterServices[] = { "com.sun.star.configuration.backend.CopyImporter", 0, @@ -118,35 +118,35 @@ const ServiceRegistrationInfo* getCopyImportServiceInfo() { return getRegistrationInfo(& aCopyImporterSI); } // ----------------------------------------------------------------------------- -CopyImportService::CopyImportService(CreationArg _xContext) +CopyImportService::CopyImportService(uno::Reference< uno::XComponentContext > const & _xContext) : ImportService(_xContext, &aCopyImporterSI) { } // ----------------------------------------------------------------------------- uno::Reference< uno::XInterface > SAL_CALL instantiateCopyImporter -( CreationContext const& xContext ) +( uno::Reference< uno::XComponentContext > const& xContext ) { return * new CopyImportService( xContext ); } // ----------------------------------------------------------------------------- -CopyImportService::InputHandler CopyImportService::createImportHandler(Backend const & xBackend, OUString const & aEntity) +uno::Reference< backenduno::XLayerHandler > CopyImportService::createImportHandler(uno::Reference< backenduno::XBackend > const & xBackend, rtl::OUString const & aEntity) { if (!xBackend.is()) { - OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("configmgr::backend::ImportService: Trying to import without a backend. No default backend could be created") ); + rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("configmgr::backend::ImportService: Trying to import without a backend. No default backend could be created") ); throw lang::NullPointerException(sMessage,*this); } ImportMergeHandler::Mode aMode = m_bOverwrite ? ImportMergeHandler::copy : ImportMergeHandler::no_overwrite; - InputHandler aHandler( new ImportMergeHandler(xBackend,aMode,aEntity) ); + uno::Reference< backenduno::XLayerHandler > aHandler( new ImportMergeHandler(xBackend,aMode,aEntity) ); return aHandler; } // ----------------------------------------------------------------------------- -sal_Bool CopyImportService::setImplementationProperty(OUString const & aName, uno::Any const & aValue) +sal_Bool CopyImportService::setImplementationProperty(rtl::OUString const & aName, uno::Any const & aValue) { if (aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Overwrite"))) { @@ -159,7 +159,7 @@ sal_Bool CopyImportService::setImplementationProperty(OUString const & aName, un // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- -ImportService::ImportService(CreationArg _xContext, ServiceInfoHelper const & aSvcInfo ) +ImportService::ImportService(uno::Reference< uno::XComponentContext > const & _xContext, ServiceInfoHelper const & aSvcInfo ) : m_bSendNotification(false) , m_aMutex() , m_xContext(_xContext) @@ -168,7 +168,7 @@ ImportService::ImportService(CreationArg _xContext, ServiceInfoHelper const & aS { if (!m_xContext.is()) { - OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration Importer: Unexpected NULL context")); + rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration Importer: Unexpected NULL context")); throw lang::NullPointerException(sMessage,NULL); } } @@ -178,13 +178,13 @@ ImportService::~ImportService() {} // ----------------------------------------------------------------------------- -ImportService::Backend ImportService::createDefaultBackend() const +uno::Reference< backenduno::XBackend > ImportService::createDefaultBackend() const { return BackendFactory::instance( m_xContext ).getUnoBackend(); } // ----------------------------------------------------------------------------- -sal_Bool ImportService::setImplementationProperty(OUString const & aName, uno::Any const & aValue) +sal_Bool ImportService::setImplementationProperty(rtl::OUString const & aName, uno::Any const & aValue) { if (aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Notify"))) { @@ -205,7 +205,7 @@ void SAL_CALL if (sal_Int32(nCount) != aArguments.getLength()) { - OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Too many arguments to initialize a Configuration Importer")); + rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Too many arguments to initialize a Configuration Importer")); throw lang::IllegalArgumentException(sMessage,*this,0); } @@ -219,7 +219,7 @@ void SAL_CALL continue; } - OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Cannot use argument to initialize a Configuration Importer" + rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Cannot use argument to initialize a Configuration Importer" "- NamedValue expected")); throw lang::IllegalArgumentException(sMessage,*this,i+1); } @@ -257,7 +257,7 @@ void SAL_CALL { if (!aBackend.is()) { - OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("configmgr::backend::ImportService: Trying to set a NULL backend") ); + rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("configmgr::backend::ImportService: Trying to set a NULL backend") ); throw lang::NullPointerException(sMessage,*this); } @@ -268,42 +268,42 @@ void SAL_CALL void SAL_CALL ImportService::importLayer( const uno::Reference< backenduno::XLayer >& aLayer ) - throw ( MalformedDataException, + throw ( backenduno::MalformedDataException, lang::WrappedTargetException, lang::IllegalArgumentException, lang::NullPointerException, uno::RuntimeException) { if (!aLayer.is()) { - OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("configmgr::backend::ImportService: Trying to import a NULL layer") ); + rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("configmgr::backend::ImportService: Trying to import a NULL layer") ); throw lang::NullPointerException(sMessage,*this); } - InputHandler aInputHandler = createImportHandler( getTargetBackend() ); + uno::Reference< backenduno::XLayerHandler > aInputHandler = createImportHandler( getTargetBackend() ); aLayer->readData( aInputHandler ); } // ----------------------------------------------------------------------------- void SAL_CALL - ImportService::importLayerForEntity( const uno::Reference< backenduno::XLayer >& aLayer, const OUString& aEntity ) - throw ( MalformedDataException, + ImportService::importLayerForEntity( const uno::Reference< backenduno::XLayer >& aLayer, const rtl::OUString& aEntity ) + throw ( backenduno::MalformedDataException, lang::WrappedTargetException, lang::IllegalArgumentException, lang::NullPointerException, uno::RuntimeException) { if (!aLayer.is()) { - OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("configmgr::backend::ImportService: Trying to import a NULL layer") ); + rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("configmgr::backend::ImportService: Trying to import a NULL layer") ); throw lang::NullPointerException(sMessage,*this); } - InputHandler aInputHandler = createImportHandler( getTargetBackend(), aEntity ); + uno::Reference< backenduno::XLayerHandler > aInputHandler = createImportHandler( getTargetBackend(), aEntity ); aLayer->readData( aInputHandler ); } // ----------------------------------------------------------------------------- // XServiceInfo -OUString SAL_CALL +rtl::OUString SAL_CALL ImportService::getImplementationName( ) throw (uno::RuntimeException) { @@ -313,7 +313,7 @@ OUString SAL_CALL sal_Bool SAL_CALL - ImportService::supportsService( const OUString& ServiceName ) + ImportService::supportsService( const rtl::OUString& ServiceName ) throw (uno::RuntimeException) { return getServiceInfo().supportsService( ServiceName ); diff --git a/configmgr/source/backend/importsvc.hxx b/configmgr/source/backend/importsvc.hxx index d76a686b87..a539882097 100644 --- a/configmgr/source/backend/importsvc.hxx +++ b/configmgr/source/backend/importsvc.hxx @@ -48,7 +48,6 @@ namespace configmgr namespace backend { // ----------------------------------------------------------------------------- - using rtl::OUString; namespace uno = ::com::sun::star::uno; namespace lang = ::com::sun::star::lang; namespace backenduno = ::com::sun::star::configuration::backend; @@ -61,10 +60,8 @@ namespace configmgr > { public: - typedef uno::Reference< uno::XComponentContext > const & CreationArg; - explicit - ImportService(CreationArg _xContext, ServiceInfoHelper const & aSvcInfo); + ImportService(uno::Reference< uno::XComponentContext > const & _xContext, ServiceInfoHelper const & aSvcInfo); ~ImportService(); // XInitialization @@ -73,15 +70,15 @@ namespace configmgr throw (uno::Exception, uno::RuntimeException); // XServiceInfo - virtual OUString SAL_CALL + virtual rtl::OUString SAL_CALL getImplementationName( ) throw (uno::RuntimeException); virtual sal_Bool SAL_CALL - supportsService( const OUString& ServiceName ) + supportsService( const rtl::OUString& ServiceName ) throw (uno::RuntimeException); - virtual uno::Sequence< OUString > SAL_CALL + virtual uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (uno::RuntimeException); @@ -101,31 +98,26 @@ namespace configmgr lang::NullPointerException, uno::RuntimeException); virtual void SAL_CALL - importLayerForEntity( const uno::Reference< backenduno::XLayer >& aLayer, const OUString& aEntity ) + importLayerForEntity( const uno::Reference< backenduno::XLayer >& aLayer, const rtl::OUString& aEntity ) throw ( backenduno::MalformedDataException, lang::WrappedTargetException, lang::IllegalArgumentException, lang::NullPointerException, uno::RuntimeException); protected: - typedef uno::Reference< uno::XComponentContext > Context; - typedef uno::Reference< lang::XMultiServiceFactory > ServiceFactory; - typedef uno::Reference< backenduno::XBackend > Backend; - typedef uno::Reference< backenduno::XLayerHandler > InputHandler; - - Backend createDefaultBackend() const; + uno::Reference< backenduno::XBackend > createDefaultBackend() const; - //ServiceFactory getServiceFactory() const + //uno::Reference< lang::XMultiServiceFactory > getServiceFactory() const - virtual sal_Bool setImplementationProperty( OUString const & aName, uno::Any const & aValue); - /** Notify Backend of import */ + virtual sal_Bool setImplementationProperty( rtl::OUString const & aName, uno::Any const & aValue); + /** Notify backend of import */ sal_Bool m_bSendNotification; private: // is pure virtual to allow different import services - virtual InputHandler createImportHandler(Backend const & xBackend, OUString const & aEntity = OUString()) = 0; + virtual uno::Reference< backenduno::XLayerHandler > createImportHandler(uno::Reference< backenduno::XBackend > const & xBackend, rtl::OUString const & aEntity = rtl::OUString()) = 0; private: osl::Mutex m_aMutex; - Context m_xContext; - Backend m_xDestinationBackend; + uno::Reference< uno::XComponentContext > m_xContext; + uno::Reference< backenduno::XBackend > m_xDestinationBackend; ServiceInfoHelper m_aServiceInfo; @@ -137,19 +129,19 @@ namespace configmgr class MergeImportService : public ImportService { public: - explicit MergeImportService(CreationArg _xContext); + explicit MergeImportService(uno::Reference< uno::XComponentContext > const & _xContext); private: - InputHandler createImportHandler(Backend const & xBackend, OUString const & aEntity); + uno::Reference< backenduno::XLayerHandler > createImportHandler(uno::Reference< backenduno::XBackend > const & xBackend, rtl::OUString const & aEntity); }; // ----------------------------------------------------------------------------- class CopyImportService : public ImportService { public: - explicit CopyImportService(CreationArg _xContext); + explicit CopyImportService(uno::Reference< uno::XComponentContext > const & _xContext); private: - InputHandler createImportHandler(Backend const & xBackend, OUString const & aEntity); - sal_Bool setImplementationProperty( OUString const & aName, uno::Any const & aValue); + uno::Reference< backenduno::XLayerHandler > createImportHandler(uno::Reference< backenduno::XBackend > const & xBackend, rtl::OUString const & aEntity); + sal_Bool setImplementationProperty( rtl::OUString const & aName, uno::Any const & aValue); private: sal_Bool m_bOverwrite; }; diff --git a/configmgr/source/backend/layerdefaultremover.cxx b/configmgr/source/backend/layerdefaultremover.cxx index 1aebdfa0d5..6cfe71a9d6 100644 --- a/configmgr/source/backend/layerdefaultremover.cxx +++ b/configmgr/source/backend/layerdefaultremover.cxx @@ -44,7 +44,7 @@ namespace configmgr namespace uno = ::com::sun::star::uno; // ----------------------------------------------------------------------------- - LayerDefaultRemover::LayerDefaultRemover(ResultHandler const & _xResultHandler) + LayerDefaultRemover::LayerDefaultRemover(uno::Reference< backenduno::XLayerHandler > const & _xResultHandler) :m_xResultHandler(_xResultHandler) { } @@ -68,7 +68,7 @@ namespace configmgr // ----------------------------------------------------------------------------- void SAL_CALL LayerDefaultRemover::startLayer( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { clearPendingProperty(); m_xResultHandler->startLayer(); @@ -76,7 +76,7 @@ namespace configmgr // ----------------------------------------------------------------------------- void SAL_CALL LayerDefaultRemover::endLayer( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (hasPendingProperty()) { @@ -94,8 +94,8 @@ namespace configmgr } // ----------------------------------------------------------------------------- - void SAL_CALL LayerDefaultRemover::overrideNode( const OUString& aName, sal_Int16 aAttributes, sal_Bool bClear ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + void SAL_CALL LayerDefaultRemover::overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (hasPendingProperty()) { @@ -115,16 +115,16 @@ namespace configmgr } // ----------------------------------------------------------------------------- - void SAL_CALL LayerDefaultRemover::addOrReplaceNode( const OUString& aName, sal_Int16 aAttributes ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + void SAL_CALL LayerDefaultRemover::addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { playBackNodeStack(); m_xResultHandler->addOrReplaceNode(aName, aAttributes); } // ----------------------------------------------------------------------------- - void SAL_CALL LayerDefaultRemover::addOrReplaceNodeFromTemplate( const OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + void SAL_CALL LayerDefaultRemover::addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { playBackNodeStack(); m_xResultHandler->addOrReplaceNodeFromTemplate(aName,aTemplate,aAttributes); @@ -132,7 +132,7 @@ namespace configmgr // ----------------------------------------------------------------------------- void SAL_CALL LayerDefaultRemover::endNode( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (hasPendingProperty()) { @@ -151,32 +151,32 @@ namespace configmgr } // ----------------------------------------------------------------------------- - void SAL_CALL LayerDefaultRemover::dropNode( const OUString& aName ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + void SAL_CALL LayerDefaultRemover::dropNode( const rtl::OUString& aName ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { playBackNodeStack(); m_xResultHandler->dropNode(aName); } // ----------------------------------------------------------------------------- - void SAL_CALL LayerDefaultRemover::addProperty( const OUString& aName, sal_Int16 aAttributes, const uno::Type& aType ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + void SAL_CALL LayerDefaultRemover::addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { playBackNodeStack(); m_xResultHandler->addProperty (aName,aAttributes,aType); } // ----------------------------------------------------------------------------- - void SAL_CALL LayerDefaultRemover::addPropertyWithValue( const OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + void SAL_CALL LayerDefaultRemover::addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { playBackNodeStack(); m_xResultHandler->addPropertyWithValue(aName,aAttributes,aValue); } // ----------------------------------------------------------------------------- - void SAL_CALL LayerDefaultRemover::overrideProperty( const OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + void SAL_CALL LayerDefaultRemover::overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (hasPendingProperty()) { @@ -186,7 +186,7 @@ namespace configmgr } if (aAttributes != 0 || bClear) { - m_aPropName.Name=OUString(); + m_aPropName.Name=rtl::OUString(); playBackNodeStack(); m_xResultHandler->overrideProperty(aName,aAttributes,aType,bClear); } @@ -199,7 +199,7 @@ namespace configmgr // ----------------------------------------------------------------------------- void SAL_CALL LayerDefaultRemover::endProperty( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (hasPendingProperty()) { @@ -211,15 +211,15 @@ namespace configmgr // ----------------------------------------------------------------------------- void SAL_CALL LayerDefaultRemover::setPropertyValue( const uno::Any& aValue ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { playBackNodeStack(true); m_xResultHandler->setPropertyValue(aValue); } // ----------------------------------------------------------------------------- - void SAL_CALL LayerDefaultRemover::setPropertyValueForLocale( const uno::Any& aValue, const OUString& aLocale ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + void SAL_CALL LayerDefaultRemover::setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString& aLocale ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { playBackNodeStack(true); m_xResultHandler->setPropertyValueForLocale(aValue,aLocale); @@ -242,7 +242,7 @@ namespace configmgr } if (!m_aNodeStack.empty()) { - for (NodeStack::iterator aIter = m_aNodeStack.begin(); + for (std::vector<rtl::OUString>::iterator aIter = m_aNodeStack.begin(); aIter != m_aNodeStack.end(); aIter++) { m_xResultHandler->overrideNode(*aIter, 0,false); @@ -263,7 +263,7 @@ namespace configmgr void LayerDefaultRemover::raiseMalformedDataException(sal_Char const * pMsg) { OSL_ASSERT(pMsg); - OUString sMsg = OUString::createFromAscii(pMsg); + rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg); throw backenduno::MalformedDataException( sMsg, *this, uno::Any() ); } diff --git a/configmgr/source/backend/layerdefaultremover.hxx b/configmgr/source/backend/layerdefaultremover.hxx index b249f7c666..784b7f7a53 100644 --- a/configmgr/source/backend/layerdefaultremover.hxx +++ b/configmgr/source/backend/layerdefaultremover.hxx @@ -47,75 +47,71 @@ namespace configmgr namespace backend { // ----------------------------------------------------------------------------- - using rtl::OUString; namespace uno = ::com::sun::star::uno; namespace lang = ::com::sun::star::lang; namespace backenduno = ::com::sun::star::configuration::backend; - - using backenduno::MalformedDataException; // ----------------------------------------------------------------------------- class LayerDefaultRemover : public cppu::WeakImplHelper1<backenduno::XLayerHandler> { public: - typedef uno::Reference< backenduno::XLayerHandler > ResultHandler; explicit - LayerDefaultRemover(ResultHandler const & _xResultHandler); + LayerDefaultRemover(uno::Reference< backenduno::XLayerHandler > const & _xResultHandler); virtual ~LayerDefaultRemover(); // XLayerHandler public: virtual void SAL_CALL startLayer( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL endLayer( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - overrideNode( const OUString& aName, sal_Int16 aAttributes, sal_Bool bClear ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - addOrReplaceNode( const OUString& aName, sal_Int16 aAttributes ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - addOrReplaceNodeFromTemplate( const OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL endNode( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - dropNode( const OUString& aName ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + dropNode( const rtl::OUString& aName ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - overrideProperty( const OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - addProperty( const OUString& aName, sal_Int16 aAttributes, const uno::Type& aType ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - addPropertyWithValue( const OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL endProperty( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL setPropertyValue( const uno::Any& aValue ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - setPropertyValueForLocale( const uno::Any& aValue, const OUString& aLocale ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString& aLocale ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); private: void playBackNodeStack( bool bPlayProperty=false); @@ -123,12 +119,11 @@ namespace configmgr inline bool hasPendingProperty(); inline void clearPendingProperty(); private: - ResultHandler m_xResultHandler; - typedef std::vector<OUString> NodeStack; - NodeStack m_aNodeStack; + uno::Reference< backenduno::XLayerHandler > m_xResultHandler; + std::vector<rtl::OUString> m_aNodeStack; struct PropertyStruct { - OUString Name; + rtl::OUString Name; uno::Type Type; }m_aPropName; }; diff --git a/configmgr/source/backend/layermerge.cxx b/configmgr/source/backend/layermerge.cxx index 63dbb38540..05c11577ea 100644 --- a/configmgr/source/backend/layermerge.cxx +++ b/configmgr/source/backend/layermerge.cxx @@ -69,20 +69,18 @@ namespace configmgr struct LayerMergeHandler::Converter { - typedef uno::Reference< com::sun::star::script::XTypeConverter > TypeConverter; - explicit - Converter(Context const & xContext); + Converter(uno::Reference< uno::XComponentContext > const & xContext); uno::Any convertValue(uno::Type const & _aTargetType, uno::Any const & _aValue); - static TypeConverter createTCV(Context const & xContext); + static uno::Reference< com::sun::star::script::XTypeConverter > createTCV(uno::Reference< uno::XComponentContext > const & xContext); ValueConverter m_aConverter; bool m_bConvertData; }; // ----------------------------------------------------------------------------- -LayerMergeHandler::LayerMergeHandler(Context const & xContext, MergedComponentData & _rData, ITemplateDataProvider* aTemplateProvider ) +LayerMergeHandler::LayerMergeHandler(uno::Reference< uno::XComponentContext > const & xContext, MergedComponentData & _rData, ITemplateDataProvider* aTemplateProvider ) : m_rData(_rData) //, m_aContext(xContext,static_cast<backenduno::XLayerHandler*>(this),aTemplateProvider ) , m_aContext(xContext) @@ -117,7 +115,7 @@ void LayerMergeHandler::prepareLayer() } // ----------------------------------------------------------------------------- -bool LayerMergeHandler::prepareSublayer(OUString const & aLocale) +bool LayerMergeHandler::prepareSublayer(rtl::OUString const & aLocale) { OSL_ENSURE(isDone(), "LayerMergeHandler: Warning: Previous layer not terminated properly"); if (!isDone()) @@ -196,7 +194,7 @@ void LayerMergeHandler::propagateAttributes(ISubtree & _rParent) // ----------------------------------------------------------------------------- node::Attributes LayerMergeHandler::makePropertyAttributes(sal_Int16 aSchemaAttributes) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)) { const sal_uInt16 k_allPropertySchemaAttributes = SchemaAttribute::REQUIRED; @@ -228,7 +226,7 @@ node::Attributes LayerMergeHandler::makePropertyAttributes(sal_Int16 aSchemaAttr // ----------------------------------------------------------------------------- void LayerMergeHandler::checkPropertyType(uno::Type const & _aType) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)) { OSL_ASSERT(m_pProperty); @@ -285,7 +283,7 @@ void LayerMergeHandler::checkPropertyType(uno::Type const & _aType) // ----------------------------------------------------------------------------- void LayerMergeHandler::setValueAndCheck(ValueNode& _rValueNode, uno::Any const & _aValue) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)) { if (_aValue.hasValue() && m_pConverter && m_pConverter->m_bConvertData) { @@ -304,8 +302,8 @@ void LayerMergeHandler::setValueAndCheck(ValueNode& _rValueNode, uno::Any const } // ----------------------------------------------------------------------------- -void LayerMergeHandler::setLocalizedValue(ISubtree * pProperty, uno::Any const & _aValue, OUString const & _aLocale) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) +void LayerMergeHandler::setLocalizedValue(ISubtree * pProperty, uno::Any const & _aValue, rtl::OUString const & _aLocale) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)) { if (ISubtree * pLocalizedCont = pProperty->asISubtree()) { @@ -362,7 +360,7 @@ void LayerMergeHandler::setLocalizedValue(ISubtree * pProperty, uno::Any const & // ----------------------------------------------------------------------------- void LayerMergeHandler::applyPropertyValue(uno::Any const & _aValue) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)) { OSL_ASSERT(m_pProperty); @@ -385,8 +383,8 @@ void LayerMergeHandler::applyPropertyValue(uno::Any const & _aValue) } // ----------------------------------------------------------------------------- -void LayerMergeHandler::applyPropertyValue(uno::Any const & _aValue, OUString const & _aLocale) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) +void LayerMergeHandler::applyPropertyValue(uno::Any const & _aValue, rtl::OUString const & _aLocale) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)) { OSL_ASSERT(m_pProperty); @@ -414,7 +412,7 @@ void LayerMergeHandler::applyPropertyValue(uno::Any const & _aValue, OUString co // ----------------------------------------------------------------------------- void LayerMergeHandler::applyAttributes(INode * pNode, sal_Int16 aNodeAttributes) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)) { sal_Int16 const k_allNodeAttributes = NodeAttribute::MANDATORY | @@ -492,7 +490,7 @@ void logRejection(DataBuilderContext const & aContext, INode * pNode, bool bMand // ----------------------------------------------------------------------------- bool LayerMergeHandler::startOverride(INode * pNode, sal_Bool bClear) /* ensure writable, mark merged */ - CFG_NOTHROW( ) + SAL_THROW(()) { OSL_PRECOND(pNode,"startOverride: non-NULL base node required"); if (!m_aContext.isWritable(pNode)) @@ -517,7 +515,7 @@ bool LayerMergeHandler::startOverride(INode * pNode, sal_Bool bClear) /* ensure // ----------------------------------------------------------------------------- void LayerMergeHandler::ensureUnchanged(INode const * pNode) const - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)) { // to do: change state handling to detect this within sets OSL_PRECOND(pNode,"INTERNAL ERROR: Unexpected NULL node pointer"); @@ -533,7 +531,7 @@ void LayerMergeHandler::ensureUnchanged(INode const * pNode) const // XLayerHandler void SAL_CALL LayerMergeHandler::startLayer( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { ISubtree * pSchema = m_rData.getSchemaTree(); OSL_ENSURE(pSchema,"No base data to merge layer into"); @@ -541,7 +539,7 @@ void SAL_CALL LayerMergeHandler::startLayer( ) if (!pSchema) { m_aContext.getLogger().error("No schema data for merging layer", "startLayer", "configmgr::LayerMergeHandler"); - throw uno::RuntimeException(OUString::createFromAscii("Layer merging: No data to merge with"),*this); + throw uno::RuntimeException(rtl::OUString::createFromAscii("Layer merging: No data to merge with"),*this); } m_aContext.startActiveComponent(pSchema->getName()); @@ -556,7 +554,7 @@ void SAL_CALL LayerMergeHandler::startLayer( ) // ----------------------------------------------------------------------------- void SAL_CALL LayerMergeHandler::endLayer( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (this->isSkipping()) m_aContext.raiseMalformedDataException("Layer merging: Unmatched data being skipped was not terminated properly."); @@ -570,8 +568,8 @@ void SAL_CALL LayerMergeHandler::endLayer( ) } // ----------------------------------------------------------------------------- -void LayerMergeHandler::overrideLayerRoot( const OUString& aName, sal_Int16 aAttributes, sal_Bool bClear ) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) +void LayerMergeHandler::overrideLayerRoot( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear ) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)) { OSL_PRECOND( m_aContext.hasActiveComponent(), "Layer merging: active component is not set"); OSL_PRECOND( m_aContext.isDone(), "Layer merging: node is not root"); @@ -625,8 +623,8 @@ void LayerMergeHandler::implOverrideNode( } } -void SAL_CALL LayerMergeHandler::overrideNode( const OUString& aName, sal_Int16 aAttributes, sal_Bool bClear ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL LayerMergeHandler::overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (this->isSkipping()) { @@ -657,8 +655,8 @@ void SAL_CALL LayerMergeHandler::overrideNode( const OUString& aName, sal_Int16 } // ----------------------------------------------------------------------------- -void LayerMergeHandler::implAddOrReplaceNode( const OUString& aName, const TemplateIdentifier& aTemplate, sal_Int16 aAttributes ) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ) +void LayerMergeHandler::implAddOrReplaceNode( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes ) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)) { ISubtree * pReplacedNode = m_aContext.findNode(aName); if (pReplacedNode) @@ -686,8 +684,7 @@ void LayerMergeHandler::implAddOrReplaceNode( const OUString& aName, const Templ } else { - TemplateRequest aTemplateRequest(configuration::makeName(aTemplate.Name, configuration::Name::NoValidate()), - configuration::makeName(aTemplate.Component, configuration::Name::NoValidate()) ); + TemplateRequest aTemplateRequest(aTemplate.Name, aTemplate.Component); apNewInstance = m_aContext.getTemplateData( aTemplateRequest ).extractDataAndClear(); if (apNewInstance.get()) apNewInstance->setName( aName ); @@ -710,8 +707,8 @@ void LayerMergeHandler::implAddOrReplaceNode( const OUString& aName, const Templ } // ----------------------------------------------------------------------------- -void SAL_CALL LayerMergeHandler::addOrReplaceNode( const OUString& aName, sal_Int16 aAttributes ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL LayerMergeHandler::addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (this->isSkipping()) { @@ -723,8 +720,8 @@ void SAL_CALL LayerMergeHandler::addOrReplaceNode( const OUString& aName, sal_In } // ----------------------------------------------------------------------------- -void SAL_CALL LayerMergeHandler::addOrReplaceNodeFromTemplate( const OUString& aName, const TemplateIdentifier& aTemplate, sal_Int16 aAttributes ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL LayerMergeHandler::addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (this->isSkipping()) { @@ -738,7 +735,7 @@ void SAL_CALL LayerMergeHandler::addOrReplaceNodeFromTemplate( const OUString& a // ----------------------------------------------------------------------------- void SAL_CALL LayerMergeHandler::endNode( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (this->leaveSkippedNode()) return; @@ -749,8 +746,8 @@ void SAL_CALL LayerMergeHandler::endNode( ) } // ----------------------------------------------------------------------------- -void SAL_CALL LayerMergeHandler::dropNode( const OUString& aName ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL LayerMergeHandler::dropNode( const rtl::OUString& aName ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (this->isSkipping()) return; @@ -785,8 +782,8 @@ void SAL_CALL LayerMergeHandler::dropNode( const OUString& aName ) } // ----------------------------------------------------------------------------- -void SAL_CALL LayerMergeHandler::overrideProperty( const OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL LayerMergeHandler::overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (this->isSkipping()) { @@ -825,7 +822,7 @@ void SAL_CALL LayerMergeHandler::overrideProperty( const OUString& aName, sal_In // ----------------------------------------------------------------------------- void SAL_CALL LayerMergeHandler::endProperty( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (this->leaveSkippedNode()) return; @@ -841,8 +838,8 @@ void SAL_CALL LayerMergeHandler::endProperty( ) } // ----------------------------------------------------------------------------- -void SAL_CALL LayerMergeHandler::addProperty( const OUString& aName, sal_Int16 aAttributes, const uno::Type& aType ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL LayerMergeHandler::addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (this->isSkipping()) return; @@ -861,8 +858,8 @@ void SAL_CALL LayerMergeHandler::addProperty( const OUString& aName, sal_Int16 a } // ----------------------------------------------------------------------------- -void SAL_CALL LayerMergeHandler::addPropertyWithValue( const OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL LayerMergeHandler::addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (this->isSkipping()) return; @@ -881,7 +878,7 @@ void SAL_CALL LayerMergeHandler::addPropertyWithValue( const OUString& aName, sa // ----------------------------------------------------------------------------- void SAL_CALL LayerMergeHandler::setPropertyValue( const uno::Any& aValue ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (this->isSkipping()) return; @@ -897,8 +894,8 @@ void SAL_CALL LayerMergeHandler::setPropertyValue( const uno::Any& aValue ) } // ----------------------------------------------------------------------------- -void SAL_CALL LayerMergeHandler::setPropertyValueForLocale( const uno::Any& aValue, OUString const & aLocale ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL LayerMergeHandler::setPropertyValueForLocale( const uno::Any& aValue, rtl::OUString const & aLocale ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (this->isSkipping()) return; @@ -915,38 +912,36 @@ void SAL_CALL LayerMergeHandler::setPropertyValueForLocale( const uno::Any& aVal // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- -LayerMergeHandler::Converter::TypeConverter - LayerMergeHandler::Converter::createTCV(Context const & xContext) +uno::Reference< com::sun::star::script::XTypeConverter > + LayerMergeHandler::Converter::createTCV(uno::Reference< uno::XComponentContext > const & xContext) { OSL_ENSURE(xContext.is(),"Cannot create TypeConverter for LayerMergeHandler without a Context"); uno::Reference< lang::XMultiComponentFactory > xFactory = xContext->getServiceManager(); OSL_ENSURE(xFactory.is(),"Cannot create TypeConverter for LayerMergeHandler without a ServiceManager"); - TypeConverter xTCV; + uno::Reference< com::sun::star::script::XTypeConverter > xTCV; if (xFactory.is()) { static const rtl::OUString k_sTCVService(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter")); - xTCV = TypeConverter::query(xFactory->createInstanceWithContext(k_sTCVService,xContext)); + xTCV = uno::Reference< com::sun::star::script::XTypeConverter >::query(xFactory->createInstanceWithContext(k_sTCVService,xContext)); } return xTCV; } // ----------------------------------------------------------------------------- -LayerMergeHandler::Converter::Converter(Context const & xContext) +LayerMergeHandler::Converter::Converter(uno::Reference< uno::XComponentContext > const & xContext) : m_aConverter( createTCV(xContext) ) , m_bConvertData(false) { } // ----------------------------------------------------------------------------- -typedef uno::Sequence< sal_Int8 > Binary; -// ----------------------------------------------------------------------------- static inline uno::Type getBinaryDataType() { - Binary const * const forBinary = 0; + uno::Sequence< sal_Int8 > const * const forBinary = 0; return ::getCppuType(forBinary); } // ----------------------------------------------------------------------------- @@ -962,12 +957,12 @@ uno::Any LayerMergeHandler::Converter::convertValue(uno::Type const & _aTargetTy if (m_aConverter.isList()) { - uno::Sequence< OUString > aStringList; + uno::Sequence< rtl::OUString > aStringList; if (_aValue >>= aStringList) return m_aConverter.convertListToAny(aStringList); } - OUString aContent; + rtl::OUString aContent; if (_aValue >>= aContent) return m_aConverter.convertToAny(aContent); diff --git a/configmgr/source/backend/layermerge.hxx b/configmgr/source/backend/layermerge.hxx index 31a7da45cd..c21e5d1a91 100644 --- a/configmgr/source/backend/layermerge.hxx +++ b/configmgr/source/backend/layermerge.hxx @@ -49,24 +49,19 @@ namespace configmgr namespace lang = ::com::sun::star::lang; namespace backenduno = ::com::sun::star::configuration::backend; - using backenduno::MalformedDataException; // ----------------------------------------------------------------------------- - typedef ::cppu::WeakImplHelper1<backenduno::XLayerHandler> LayerMergeHandler_Base; - class LayerMergeHandler - : public LayerMergeHandler_Base + : public cppu::WeakImplHelper1<backenduno::XLayerHandler> { public: - typedef uno::Reference< uno::XComponentContext > Context; - explicit - LayerMergeHandler(Context const & _xContext, MergedComponentData & _rData, ITemplateDataProvider* aTemplateProvider = NULL); + LayerMergeHandler(uno::Reference< uno::XComponentContext > const & _xContext, MergedComponentData & _rData, ITemplateDataProvider* aTemplateProvider = NULL); virtual ~LayerMergeHandler(); // prepare merging void prepareLayer(); - bool prepareSublayer(OUString const & aLocale); + bool prepareSublayer(rtl::OUString const & aLocale); // checking the result bool isDone() const { return m_aContext.isDone(); } @@ -76,94 +71,94 @@ namespace configmgr public: virtual void SAL_CALL startLayer( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL endLayer( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - overrideNode( const OUString& aName, sal_Int16 aAttributes, sal_Bool bClear ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - addOrReplaceNode( const OUString& aName, sal_Int16 aAttributes ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - addOrReplaceNodeFromTemplate( const OUString& aName, const TemplateIdentifier& aTemplate, sal_Int16 aAttributes ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL endNode( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - dropNode( const OUString& aName ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + dropNode( const rtl::OUString& aName ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - overrideProperty( const OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - addProperty( const OUString& aName, sal_Int16 aAttributes, const uno::Type& aType ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - addPropertyWithValue( const OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL endProperty( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL setPropertyValue( const uno::Any& aValue ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - setPropertyValueForLocale( const uno::Any& aValue, const OUString & aLocale ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString & aLocale ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); private: void propagateAttributes(ISubtree & _rParent); node::Attributes makePropertyAttributes(sal_Int16 aSchemaAttributes) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ); + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)); void checkPropertyType(uno::Type const & _aType) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ); + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)); void applyPropertyValue(uno::Any const & _aValue) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ); + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)); - void applyPropertyValue(uno::Any const & _aValue, OUString const & _aLocale) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ); + void applyPropertyValue(uno::Any const & _aValue, rtl::OUString const & _aLocale) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)); void applyAttributes(INode * pNode, sal_Int16 aNodeAttributes) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ); + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)); - void overrideLayerRoot( const OUString& aName, sal_Int16 aAttributes, sal_Bool bClear ) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ); + void overrideLayerRoot( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear ) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)); bool startOverride(INode * pNode, sal_Bool bClear) /* check if writable, mark merged */ - CFG_NOTHROW( ); + SAL_THROW(()); void implOverrideNode( ISubtree * node, sal_Int16 attributes, bool clear); - void implAddOrReplaceNode(const OUString& aName, const TemplateIdentifier& aTemplate, sal_Int16 aAttributes) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ); + void implAddOrReplaceNode(const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)); void ensureUnchanged(INode const * pNode) const - CFG_UNO_THROW1( configuration::backend::MalformedDataException ); + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)); - void setLocalizedValue(ISubtree * pProperty, uno::Any const & _aValue, OUString const & _aLocale) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ); + void setLocalizedValue(ISubtree * pProperty, uno::Any const & _aValue, rtl::OUString const & _aLocale) + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)); void setValueAndCheck(ValueNode & _rValueNode, uno::Any const & _aValue) - CFG_UNO_THROW1( configuration::backend::MalformedDataException ); + SAL_THROW((com::sun::star::configuration::backend::MalformedDataException , com::sun::star::uno::RuntimeException)); private: void skipNode() { ++m_nSkipping; } bool isSkipping() const { return m_nSkipping != 0; } @@ -173,7 +168,7 @@ namespace configmgr MergedComponentData & m_rData; DataBuilderContext m_aContext; ComponentDataFactory m_aFactory; - OUString m_aLocale; + rtl::OUString m_aLocale; INode * m_pProperty; Converter * m_pConverter; diff --git a/configmgr/source/backend/layerupdate.cxx b/configmgr/source/backend/layerupdate.cxx index 0a87900c3c..8bbb401b39 100644 --- a/configmgr/source/backend/layerupdate.cxx +++ b/configmgr/source/backend/layerupdate.cxx @@ -67,7 +67,7 @@ LayerUpdate & LayerUpdate::operator =(LayerUpdate const & _aOther) } // ----------------------------------------------------------------------------- -void LayerUpdate::setContextNode(NodeUpdateRef const & _xContextNode) +void LayerUpdate::setContextNode(rtl::Reference<NodeUpdate> const & _xContextNode) { m_xContextNode = _xContextNode; if (_xContextNode.is()) @@ -78,27 +78,26 @@ void LayerUpdate::setContextNode(NodeUpdateRef const & _xContextNode) } // ----------------------------------------------------------------------------- -void LayerUpdate::makeContextPath(OUString const & _aPath) +void LayerUpdate::makeContextPath(rtl::OUString const & _aPath) { - using configuration::AbsolutePath; - AbsolutePath const aParsedPath = configuration::AbsolutePath::parse(_aPath); + configuration::AbsolutePath const aParsedPath = configuration::AbsolutePath::parse(_aPath); m_aContextPath.clear(); m_aContextPath.reserve( aParsedPath.getDepth() ); - for (AbsolutePath::Iterator it = aParsedPath.begin(); it != aParsedPath.end(); ++it) + for (std::vector<configuration::Path::Component>::const_reverse_iterator it = aParsedPath.begin(); it != aParsedPath.end(); ++it) { - m_aContextPath.push_back( it->getName().toString() ); + m_aContextPath.push_back( it->getName() ); } } // ----------------------------------------------------------------------------- -NodeUpdateRef LayerUpdate::getContextNode() const +rtl::Reference<NodeUpdate> LayerUpdate::getContextNode() const { return m_xContextNode; } // ----------------------------------------------------------------------------- -LayerUpdate::ContextPath const & LayerUpdate::getContextPath() const +std::vector<rtl::OUString> const & LayerUpdate::getContextPath() const { OSL_PRECOND( m_xContextNode.is(), "Cannot get context path without context node" ); diff --git a/configmgr/source/backend/layerupdate.hxx b/configmgr/source/backend/layerupdate.hxx index 80587159e3..dfedfa9b5a 100644 --- a/configmgr/source/backend/layerupdate.hxx +++ b/configmgr/source/backend/layerupdate.hxx @@ -52,37 +52,30 @@ namespace configmgr // ----------------------------------------------------------------------------- namespace uno = ::com::sun::star::uno; namespace backenduno = ::com::sun::star::configuration::backend; - - using rtl::OUString; // ----------------------------------------------------------------------------- class NodeUpdate; - typedef rtl::Reference<NodeUpdate> NodeUpdateRef; class LayerUpdate { public: - typedef uno::Reference< backenduno::XLayerHandler > LayerWriter; - LayerUpdate(); LayerUpdate(LayerUpdate const & _aOther); ~LayerUpdate(); LayerUpdate & operator =(LayerUpdate const & _aOther); public: - typedef std::vector<OUString> ContextPath; - bool isEmpty() const { return ! m_xContextNode.is(); } - NodeUpdateRef getContextNode() const; - ContextPath const & getContextPath() const; + rtl::Reference<NodeUpdate> getContextNode() const; + std::vector<rtl::OUString> const & getContextPath() const; - void setContextNode(NodeUpdateRef const & _xContextNode); + void setContextNode(rtl::Reference<NodeUpdate> const & _xContextNode); private: - void makeContextPath(OUString const & _aContextPath); + void makeContextPath(rtl::OUString const & _aContextPath); private: - NodeUpdateRef m_xContextNode; - ContextPath m_aContextPath; + rtl::Reference<NodeUpdate> m_xContextNode; + std::vector<rtl::OUString> m_aContextPath; }; // ----------------------------------------------------------------------------- diff --git a/configmgr/source/backend/layerupdatebuilder.cxx b/configmgr/source/backend/layerupdatebuilder.cxx index 7cd5288a9f..a461316096 100644 --- a/configmgr/source/backend/layerupdatebuilder.cxx +++ b/configmgr/source/backend/layerupdatebuilder.cxx @@ -83,7 +83,7 @@ bool LayerUpdateBuilder::init() if (m_pCurrentNode) return false; LayerUpdate & update = data(); - m_pCurrentNode = new NodeModification(NULL, OUString(), 0, 0, false); + m_pCurrentNode = new NodeModification(NULL, rtl::OUString(), 0, 0, false); update.setContextNode(m_pCurrentNode); OSL_ENSURE(m_pCurrentProp == NULL, "LayerUpdateBuilder: Internal error: got a current property for a new context"); @@ -92,12 +92,12 @@ bool LayerUpdateBuilder::init() } // ----------------------------------------------------------------------------- -bool LayerUpdateBuilder::modifyNode(OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, sal_Bool _bReset) +bool LayerUpdateBuilder::modifyNode(rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, sal_Bool _bReset) { OSL_PRECOND(m_pCurrentNode && !m_pCurrentProp, "LayerUpdateBuilder: Illegal state for this operation"); NodeUpdate * pNewNode = new NodeModification(m_pCurrentNode,_aName,_nFlags,_nFlagsMask,_bReset); - ElementUpdateRef xNewNode(pNewNode); + rtl::Reference<ElementUpdate> xNewNode(pNewNode); if (!m_pCurrentNode->addNodeUpdate(xNewNode)) return false; @@ -107,7 +107,7 @@ bool LayerUpdateBuilder::modifyNode(OUString const & _aName, sal_Int16 _nFlags, } // ----------------------------------------------------------------------------- -bool LayerUpdateBuilder::replaceNode(OUString const & _aName, sal_Int16 _nFlags, backenduno::TemplateIdentifier const * _pTemplate) +bool LayerUpdateBuilder::replaceNode(rtl::OUString const & _aName, sal_Int16 _nFlags, backenduno::TemplateIdentifier const * _pTemplate) { OSL_PRECOND(m_pCurrentNode && !m_pCurrentProp, "LayerUpdateBuilder: Illegal state for this operation"); @@ -115,7 +115,7 @@ bool LayerUpdateBuilder::replaceNode(OUString const & _aName, sal_Int16 _nFlags, new NodeReplace(m_pCurrentNode,_aName,_nFlags,_pTemplate->Name,_pTemplate->Component) : new NodeReplace(m_pCurrentNode,_aName,_nFlags); - ElementUpdateRef xNewNode(pNewNode); + rtl::Reference<ElementUpdate> xNewNode(pNewNode); if (!m_pCurrentNode->addNodeUpdate(xNewNode)) return false; @@ -136,13 +136,13 @@ bool LayerUpdateBuilder::finishNode() } // ----------------------------------------------------------------------------- -bool LayerUpdateBuilder::removeNode(OUString const & _aName) +bool LayerUpdateBuilder::removeNode(rtl::OUString const & _aName) { OSL_PRECOND(m_pCurrentNode && !m_pCurrentProp, "LayerUpdateBuilder: Illegal state for this operation"); NodeDrop * pNewNode = new NodeDrop(m_pCurrentNode,_aName); - ElementUpdateRef xNewNode(pNewNode); + rtl::Reference<ElementUpdate> xNewNode(pNewNode); if (!m_pCurrentNode->addNodeUpdate(xNewNode)) return false; @@ -151,12 +151,12 @@ bool LayerUpdateBuilder::removeNode(OUString const & _aName) } // ----------------------------------------------------------------------------- -bool LayerUpdateBuilder::modifyProperty(OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, uno::Type const & _aType) +bool LayerUpdateBuilder::modifyProperty(rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, uno::Type const & _aType) { OSL_PRECOND(m_pCurrentNode && !m_pCurrentProp, "LayerUpdateBuilder: Illegal state for this operation"); PropertyUpdate * pNewProp = new PropertyUpdate(m_pCurrentNode,_aName,_nFlags,_nFlagsMask,_aType); - ElementUpdateRef xNewProp(pNewProp); + rtl::Reference<ElementUpdate> xNewProp(pNewProp); if (!m_pCurrentNode->addPropertyUpdate(xNewProp)) return false; @@ -174,7 +174,7 @@ bool LayerUpdateBuilder::setPropertyValue(uno::Any const & _aValue) } // ----------------------------------------------------------------------------- -bool LayerUpdateBuilder::setPropertyValueForLocale(uno::Any const & _aValue, OUString const & _aLocale) +bool LayerUpdateBuilder::setPropertyValueForLocale(uno::Any const & _aValue, rtl::OUString const & _aLocale) { OSL_PRECOND(m_pCurrentProp, "LayerUpdateBuilder: Illegal state for property operation"); @@ -190,7 +190,7 @@ bool LayerUpdateBuilder::resetPropertyValue() } // ----------------------------------------------------------------------------- -bool LayerUpdateBuilder::resetPropertyValueForLocale(OUString const & _aLocale) +bool LayerUpdateBuilder::resetPropertyValueForLocale(rtl::OUString const & _aLocale) { OSL_PRECOND(m_pCurrentProp, "LayerUpdateBuilder: Illegal state for property operation"); @@ -211,13 +211,13 @@ bool LayerUpdateBuilder::finishProperty() } // ----------------------------------------------------------------------------- -bool LayerUpdateBuilder::addNullProperty(OUString const & _aName, sal_Int16 _nFlags, uno::Type const & _aType) +bool LayerUpdateBuilder::addNullProperty(rtl::OUString const & _aName, sal_Int16 _nFlags, uno::Type const & _aType) { OSL_PRECOND(m_pCurrentNode && !m_pCurrentProp, "LayerUpdateBuilder: Illegal state for this operation"); PropertyAdd * pNewProp = new PropertyAdd(m_pCurrentNode,_aName,_nFlags,_aType); - ElementUpdateRef xNewProp(pNewProp); + rtl::Reference<ElementUpdate> xNewProp(pNewProp); if (!m_pCurrentNode->addPropertyUpdate(xNewProp)) return false; @@ -226,13 +226,13 @@ bool LayerUpdateBuilder::addNullProperty(OUString const & _aName, sal_Int16 _nFl } // ----------------------------------------------------------------------------- -bool LayerUpdateBuilder::addProperty(OUString const & _aName, sal_Int16 _nFlags, uno::Any const & _aValue) +bool LayerUpdateBuilder::addProperty(rtl::OUString const & _aName, sal_Int16 _nFlags, uno::Any const & _aValue) { OSL_PRECOND(m_pCurrentNode && !m_pCurrentProp, "LayerUpdateBuilder: Illegal state for this operation"); PropertyAdd * pNewProp = new PropertyAdd(m_pCurrentNode,_aName,_nFlags,_aValue); - ElementUpdateRef xNewProp(pNewProp); + rtl::Reference<ElementUpdate> xNewProp(pNewProp); if (!m_pCurrentNode->addPropertyUpdate(xNewProp)) return false; @@ -241,13 +241,13 @@ bool LayerUpdateBuilder::addProperty(OUString const & _aName, sal_Int16 _nFlags, } // ----------------------------------------------------------------------------- -bool LayerUpdateBuilder::resetProperty(OUString const & _aName) +bool LayerUpdateBuilder::resetProperty(rtl::OUString const & _aName) { OSL_PRECOND(m_pCurrentNode && !m_pCurrentProp, "LayerUpdateBuilder: Illegal state for this operation"); PropertyReset * pNewProp = new PropertyReset(m_pCurrentNode,_aName); - ElementUpdateRef xNewProp(pNewProp); + rtl::Reference<ElementUpdate> xNewProp(pNewProp); if (!m_pCurrentNode->addPropertyUpdate(xNewProp)) return false; diff --git a/configmgr/source/backend/layerupdatebuilder.hxx b/configmgr/source/backend/layerupdatebuilder.hxx index bd32f13a08..47e4b38612 100644 --- a/configmgr/source/backend/layerupdatebuilder.hxx +++ b/configmgr/source/backend/layerupdatebuilder.hxx @@ -46,7 +46,6 @@ namespace configmgr namespace backend { // ----------------------------------------------------------------------------- - using rtl::OUString; namespace uno = ::com::sun::star::uno; namespace backenduno = ::com::sun::star::configuration::backend; // ----------------------------------------------------------------------------- @@ -65,22 +64,22 @@ namespace configmgr /// initialize the update bool init(); - bool modifyNode(OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, sal_Bool _bReset); - bool replaceNode(OUString const & _aName, sal_Int16 _nFlags, backenduno::TemplateIdentifier const * _pTemplate = NULL); + bool modifyNode(rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, sal_Bool _bReset); + bool replaceNode(rtl::OUString const & _aName, sal_Int16 _nFlags, backenduno::TemplateIdentifier const * _pTemplate = NULL); bool finishNode(); - bool removeNode(OUString const & _aName); + bool removeNode(rtl::OUString const & _aName); - bool modifyProperty(OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, uno::Type const & _aType); + bool modifyProperty(rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, uno::Type const & _aType); bool setPropertyValue(uno::Any const & _aValue); - bool setPropertyValueForLocale(uno::Any const & _aValue, OUString const & _aLocale); + bool setPropertyValueForLocale(uno::Any const & _aValue, rtl::OUString const & _aLocale); bool resetPropertyValue(); - bool resetPropertyValueForLocale(OUString const & _aLocale); + bool resetPropertyValueForLocale(rtl::OUString const & _aLocale); bool finishProperty(); - bool addNullProperty(OUString const & _aName, sal_Int16 _nFlags, uno::Type const & _aType); - bool addProperty(OUString const & _aName, sal_Int16 _nFlags, uno::Any const & _aValue); - bool resetProperty(OUString const & _aName); + bool addNullProperty(rtl::OUString const & _aName, sal_Int16 _nFlags, uno::Type const & _aType); + bool addProperty(rtl::OUString const & _aName, sal_Int16 _nFlags, uno::Any const & _aValue); + bool resetProperty(rtl::OUString const & _aName); bool finish(); void clear(); diff --git a/configmgr/source/backend/layerupdatehandler.cxx b/configmgr/source/backend/layerupdatehandler.cxx index dcbf512bb6..99ffd0db88 100644 --- a/configmgr/source/backend/layerupdatehandler.cxx +++ b/configmgr/source/backend/layerupdatehandler.cxx @@ -42,7 +42,7 @@ #include <com/sun/star/beans/PropertyExistException.hpp> // ----------------------------------------------------------------------------- -#define OUSTR( str ) OUString( RTL_CONSTASCII_USTRINGPARAM( str ) ) +#define OUSTR( str ) rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( str ) ) // ----------------------------------------------------------------------------- namespace configmgr { @@ -56,14 +56,14 @@ namespace configmgr // ----------------------------------------------------------------------------- uno::Reference< uno::XInterface > SAL_CALL instantiateUpdateMerger -( CreationContext const& xContext ) +( uno::Reference< uno::XComponentContext > const& xContext ) { return * new LayerUpdateHandler( xContext ); } // ----------------------------------------------------------------------------- -LayerUpdateHandler::LayerUpdateHandler(CreationArg _xContext) +LayerUpdateHandler::LayerUpdateHandler(uno::Reference< uno::XComponentContext > const & _xContext) : UpdateService(_xContext) , m_aBuilder() { @@ -90,28 +90,28 @@ void LayerUpdateHandler::checkBuilder(bool _bForProperty) void LayerUpdateHandler::raiseMalformedDataException(sal_Char const * pMsg) { - OUString sMsg = OUString::createFromAscii(pMsg); + rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg); throw backenduno::MalformedDataException(sMsg,*this,uno::Any()); } // ----------------------------------------------------------------------------- void LayerUpdateHandler::raiseNodeChangedBeforeException(sal_Char const * pMsg) { - OUString sMsg = OUString::createFromAscii(pMsg); + rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg); throw backenduno::MalformedDataException(sMsg,*this,uno::Any()); } // ----------------------------------------------------------------------------- void LayerUpdateHandler::raisePropChangedBeforeException(sal_Char const * pMsg) { - OUString sMsg = OUString::createFromAscii(pMsg); + rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg); throw backenduno::MalformedDataException(sMsg,*this,uno::Any()); } // ----------------------------------------------------------------------------- void LayerUpdateHandler::raisePropExistsException(sal_Char const * pMsg) { - OUString sMsg = OUString::createFromAscii(pMsg); + rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg); com::sun::star::beans::PropertyExistException e(sMsg,*this); throw backenduno::MalformedDataException(sMsg,*this, uno::makeAny(e)); @@ -121,7 +121,7 @@ void LayerUpdateHandler::raisePropExistsException(sal_Char const * pMsg) // XUpdateHandler void SAL_CALL LayerUpdateHandler::startUpdate( ) - throw ( MalformedDataException, lang::IllegalAccessException, + throw ( backenduno::MalformedDataException, lang::IllegalAccessException, lang::WrappedTargetException, uno::RuntimeException) { this->checkSourceLayer(); @@ -132,7 +132,7 @@ void SAL_CALL void SAL_CALL LayerUpdateHandler::endUpdate( ) - throw ( MalformedDataException, lang::IllegalAccessException, + throw ( backenduno::MalformedDataException, lang::IllegalAccessException, lang::WrappedTargetException, uno::RuntimeException) { checkBuilder(); @@ -149,8 +149,8 @@ void SAL_CALL // ----------------------------------------------------------------------------- void SAL_CALL - LayerUpdateHandler::modifyNode( const OUString& aName, sal_Int16 aAttributes, sal_Int16 aAttributeMask, sal_Bool bReset ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + LayerUpdateHandler::modifyNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Int16 aAttributeMask, sal_Bool bReset ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { checkBuilder(); @@ -160,8 +160,8 @@ void SAL_CALL // ----------------------------------------------------------------------------- void SAL_CALL - LayerUpdateHandler::addOrReplaceNode( const OUString& aName, sal_Int16 aAttributes ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + LayerUpdateHandler::addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { checkBuilder(); @@ -171,8 +171,8 @@ void SAL_CALL // ----------------------------------------------------------------------------- void SAL_CALL - LayerUpdateHandler::addOrReplaceNodeFromTemplate( const OUString& aName, sal_Int16 aAttributes, const TemplateIdentifier& aTemplate ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + LayerUpdateHandler::addOrReplaceNodeFromTemplate( const rtl::OUString& aName, sal_Int16 aAttributes, const backenduno::TemplateIdentifier& aTemplate ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { checkBuilder(); @@ -183,7 +183,7 @@ void SAL_CALL void SAL_CALL LayerUpdateHandler::endNode( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { checkBuilder(); @@ -199,8 +199,8 @@ void SAL_CALL // ----------------------------------------------------------------------------- void SAL_CALL - LayerUpdateHandler::removeNode( const OUString& aName ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + LayerUpdateHandler::removeNode( const rtl::OUString& aName ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { checkBuilder(); @@ -210,8 +210,8 @@ void SAL_CALL // ----------------------------------------------------------------------------- void SAL_CALL - LayerUpdateHandler:: modifyProperty( const OUString& aName, sal_Int16 aAttributes, sal_Int16 aAttributeMask, const uno::Type & aType ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + LayerUpdateHandler:: modifyProperty( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Int16 aAttributeMask, const uno::Type & aType ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { checkBuilder(false); @@ -222,7 +222,7 @@ void SAL_CALL void SAL_CALL LayerUpdateHandler:: setPropertyValue( const uno::Any& aValue ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { checkBuilder(true); // already checks for open property @@ -231,8 +231,8 @@ void SAL_CALL // ----------------------------------------------------------------------------- void SAL_CALL - LayerUpdateHandler:: setPropertyValueForLocale( const uno::Any& aValue, const OUString& aLocale ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + LayerUpdateHandler:: setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString& aLocale ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { checkBuilder(true); // already checks for open property @@ -242,7 +242,7 @@ void SAL_CALL void SAL_CALL LayerUpdateHandler::resetPropertyValue( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { checkBuilder(true); // already checks for open property @@ -251,8 +251,8 @@ void SAL_CALL // ----------------------------------------------------------------------------- void SAL_CALL - LayerUpdateHandler::resetPropertyValueForLocale( const OUString& aLocale ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + LayerUpdateHandler::resetPropertyValueForLocale( const rtl::OUString& aLocale ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { checkBuilder(true); // already checks for open property @@ -262,7 +262,7 @@ void SAL_CALL void SAL_CALL LayerUpdateHandler::endProperty( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { checkBuilder(true); // already checks for open property @@ -271,8 +271,8 @@ void SAL_CALL // ----------------------------------------------------------------------------- void SAL_CALL - LayerUpdateHandler::resetProperty( const OUString& aName ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + LayerUpdateHandler::resetProperty( const rtl::OUString& aName ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (!m_aBuilder.resetProperty(aName)) raisePropChangedBeforeException("LayerUpdateHandler: Cannot reset property - property has already been changed."); @@ -280,8 +280,8 @@ void SAL_CALL // ----------------------------------------------------------------------------- void SAL_CALL - LayerUpdateHandler::addOrReplaceProperty( const OUString& aName, sal_Int16 aAttributes, const uno::Type& aType ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + LayerUpdateHandler::addOrReplaceProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (!m_aBuilder.addNullProperty(aName,aAttributes,aType)) raisePropExistsException("LayerUpdateHandler: Cannot add property - property exists (and has already been changed)."); @@ -289,8 +289,8 @@ void SAL_CALL // ----------------------------------------------------------------------------- void SAL_CALL - LayerUpdateHandler::addOrReplacePropertyWithValue( const OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + LayerUpdateHandler::addOrReplacePropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (!m_aBuilder.addProperty(aName,aAttributes,aValue)) raisePropExistsException("LayerUpdateHandler: Cannot add property - property exists (and has already been changed)."); @@ -298,8 +298,8 @@ void SAL_CALL // ----------------------------------------------------------------------------- void SAL_CALL - LayerUpdateHandler::removeProperty( const OUString& aName ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + LayerUpdateHandler::removeProperty( const rtl::OUString& aName ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { // treat 'remove' as 'reset'. (Note: does not verify that this actually amounts to dropping the property) if (!m_aBuilder.resetProperty(aName)) diff --git a/configmgr/source/backend/layerupdatehandler.hxx b/configmgr/source/backend/layerupdatehandler.hxx index 1baf037299..93bd4a30e5 100644 --- a/configmgr/source/backend/layerupdatehandler.hxx +++ b/configmgr/source/backend/layerupdatehandler.hxx @@ -31,6 +31,10 @@ #ifndef CONFIGMGR_BACKEND_LAYERUPDATEHANDLER_HXX #define CONFIGMGR_BACKEND_LAYERUPDATEHANDLER_HXX +#include "sal/config.h" + +#include "boost/utility.hpp" + #include "updatesvc.hxx" #include "layerupdatebuilder.hxx" #include "utility.hxx" @@ -43,94 +47,90 @@ namespace configmgr namespace backend { // ----------------------------------------------------------------------------- - using rtl::OUString; namespace uno = ::com::sun::star::uno; namespace lang = ::com::sun::star::lang; namespace backenduno = ::com::sun::star::configuration::backend; - - using backenduno::TemplateIdentifier; - using backenduno::MalformedDataException; // ----------------------------------------------------------------------------- class LayerUpdateBuilder; - class LayerUpdateHandler : public UpdateService , Noncopyable + class LayerUpdateHandler: private boost::noncopyable, public UpdateService { public: explicit - LayerUpdateHandler(CreationArg _xContext); + LayerUpdateHandler(uno::Reference< uno::XComponentContext > const & _xContext); ~LayerUpdateHandler(); // XUpdateHandler virtual void SAL_CALL startUpdate( ) - throw ( MalformedDataException, lang::IllegalAccessException, + throw ( backenduno::MalformedDataException, lang::IllegalAccessException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL endUpdate( ) - throw ( MalformedDataException, lang::IllegalAccessException, + throw ( backenduno::MalformedDataException, lang::IllegalAccessException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - modifyNode( const OUString& aName, sal_Int16 aAttributes, sal_Int16 aAttributeMask, sal_Bool bReset ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + modifyNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Int16 aAttributeMask, sal_Bool bReset ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - addOrReplaceNode( const OUString& aName, sal_Int16 aAttributes ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - addOrReplaceNodeFromTemplate( const OUString& aName, sal_Int16 aAttributes, const TemplateIdentifier& aTemplate ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + addOrReplaceNodeFromTemplate( const rtl::OUString& aName, sal_Int16 aAttributes, const backenduno::TemplateIdentifier& aTemplate ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL endNode( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - removeNode( const OUString& aName ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + removeNode( const rtl::OUString& aName ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - modifyProperty( const OUString& aName, sal_Int16 aAttributes, sal_Int16 aAttributeMask, const uno::Type& aType ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + modifyProperty( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Int16 aAttributeMask, const uno::Type& aType ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL setPropertyValue( const uno::Any& aValue ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - setPropertyValueForLocale( const uno::Any& aValue, const OUString& aLocale ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString& aLocale ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL resetPropertyValue( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - resetPropertyValueForLocale( const OUString& aLocale ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + resetPropertyValueForLocale( const rtl::OUString& aLocale ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL endProperty( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - resetProperty( const OUString& aName ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + resetProperty( const rtl::OUString& aName ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - addOrReplaceProperty( const OUString& aName, sal_Int16 aAttributes, const uno::Type& aType ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + addOrReplaceProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - addOrReplacePropertyWithValue( const OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + addOrReplacePropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - removeProperty( const OUString& aName ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + removeProperty( const rtl::OUString& aName ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); private: LayerUpdateBuilder & getUpdateBuilder(); diff --git a/configmgr/source/backend/layerupdatemerger.cxx b/configmgr/source/backend/layerupdatemerger.cxx index 4058f70164..c6bfcfc7f1 100644 --- a/configmgr/source/backend/layerupdatemerger.cxx +++ b/configmgr/source/backend/layerupdatemerger.cxx @@ -43,7 +43,7 @@ namespace configmgr { // ----------------------------------------------------------------------------- -LayerUpdateMerger::LayerUpdateMerger(LayerSource const & _xSourceLayer, LayerUpdate const & _aLayerUpdate) +LayerUpdateMerger::LayerUpdateMerger(uno::Reference< backenduno::XLayer > const & _xSourceLayer, LayerUpdate const & _aLayerUpdate) : BasicUpdateMerger(_xSourceLayer) , m_aLayerUpdate(_aLayerUpdate) , m_xCurrentNode() @@ -70,7 +70,7 @@ void LayerUpdateMerger::flushUpdate() // ----------------------------------------------------------------------------- void SAL_CALL LayerUpdateMerger::startLayer( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { BasicUpdateMerger::startLayer(); @@ -81,7 +81,7 @@ void SAL_CALL LayerUpdateMerger::startLayer( ) // ----------------------------------------------------------------------------- void SAL_CALL LayerUpdateMerger::endLayer( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { BasicUpdateMerger::endLayer(); @@ -89,8 +89,8 @@ void SAL_CALL LayerUpdateMerger::endLayer( ) } // ----------------------------------------------------------------------------- -void SAL_CALL LayerUpdateMerger::overrideNode( const OUString& aName, sal_Int16 aAttributes, sal_Bool bClear ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL LayerUpdateMerger::overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (BasicUpdateMerger::isHandling()) { @@ -100,7 +100,7 @@ void SAL_CALL LayerUpdateMerger::overrideNode( const OUString& aName, sal_Int16 OSL_ASSERT(m_xCurrentNode.is()); - ElementUpdateRef xUpdate = m_xCurrentNode->getNodeByName(aName); + rtl::Reference<ElementUpdate> xUpdate = m_xCurrentNode->getNodeByName(aName); if (!xUpdate.is()) { BasicUpdateMerger::overrideNode(aName, aAttributes, bClear); @@ -122,8 +122,8 @@ void SAL_CALL LayerUpdateMerger::overrideNode( const OUString& aName, sal_Int16 } // ----------------------------------------------------------------------------- -void SAL_CALL LayerUpdateMerger::addOrReplaceNode( const OUString& aName, sal_Int16 aAttributes ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL LayerUpdateMerger::addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (BasicUpdateMerger::isHandling()) { @@ -133,7 +133,7 @@ void SAL_CALL LayerUpdateMerger::addOrReplaceNode( const OUString& aName, sal_In OSL_ASSERT(m_xCurrentNode.is()); - ElementUpdateRef xUpdate = m_xCurrentNode->getNodeByName(aName); + rtl::Reference<ElementUpdate> xUpdate = m_xCurrentNode->getNodeByName(aName); if (!xUpdate.is()) { BasicUpdateMerger::addOrReplaceNode(aName, aAttributes); @@ -155,8 +155,8 @@ void SAL_CALL LayerUpdateMerger::addOrReplaceNode( const OUString& aName, sal_In } // ----------------------------------------------------------------------------- -void SAL_CALL LayerUpdateMerger::addOrReplaceNodeFromTemplate( const OUString& aName, const TemplateIdentifier& aTemplate, sal_Int16 aAttributes ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL LayerUpdateMerger::addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (BasicUpdateMerger::isHandling()) { @@ -166,7 +166,7 @@ void SAL_CALL LayerUpdateMerger::addOrReplaceNodeFromTemplate( const OUString& a OSL_ASSERT(m_xCurrentNode.is()); - ElementUpdateRef xUpdate = m_xCurrentNode->getNodeByName(aName); + rtl::Reference<ElementUpdate> xUpdate = m_xCurrentNode->getNodeByName(aName); if (!xUpdate.is()) { BasicUpdateMerger::addOrReplaceNodeFromTemplate(aName, aTemplate, aAttributes); @@ -189,7 +189,7 @@ void SAL_CALL LayerUpdateMerger::addOrReplaceNodeFromTemplate( const OUString& a // ----------------------------------------------------------------------------- void SAL_CALL LayerUpdateMerger::endNode( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (BasicUpdateMerger::isHandling()) { @@ -202,7 +202,7 @@ void SAL_CALL LayerUpdateMerger::endNode( ) // write unhandled so far changes m_xCurrentNode->writeChildrenToLayer( getResultWriter().get() ); - NodeUpdateRef xParent( m_xCurrentNode->getParent() ); + rtl::Reference<NodeUpdate> xParent( m_xCurrentNode->getParent() ); if (xParent.is()) getResultWriter()->endNode(); @@ -214,8 +214,8 @@ void SAL_CALL LayerUpdateMerger::endNode( ) } // ----------------------------------------------------------------------------- -void SAL_CALL LayerUpdateMerger::dropNode( const OUString& aName ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL LayerUpdateMerger::dropNode( const rtl::OUString& aName ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (BasicUpdateMerger::isHandling()) { @@ -225,7 +225,7 @@ void SAL_CALL LayerUpdateMerger::dropNode( const OUString& aName ) OSL_ASSERT(m_xCurrentNode.is()); - ElementUpdateRef xUpdate = m_xCurrentNode->getNodeByName(aName); + rtl::Reference<ElementUpdate> xUpdate = m_xCurrentNode->getNodeByName(aName); if (xUpdate.is()) { m_xCurrentNode->removeNodeByName(aName); @@ -248,8 +248,8 @@ void SAL_CALL LayerUpdateMerger::dropNode( const OUString& aName ) } // ----------------------------------------------------------------------------- -void SAL_CALL LayerUpdateMerger::overrideProperty( const OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL LayerUpdateMerger::overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (BasicUpdateMerger::isHandling()) { @@ -259,7 +259,7 @@ void SAL_CALL LayerUpdateMerger::overrideProperty( const OUString& aName, sal_In OSL_ASSERT( m_xCurrentNode.is()); - ElementUpdateRef xUpdate = m_xCurrentNode->getPropertyByName(aName); + rtl::Reference<ElementUpdate> xUpdate = m_xCurrentNode->getPropertyByName(aName); if (!xUpdate.is()) { BasicUpdateMerger::overrideProperty(aName, aAttributes, aType, bClear); @@ -288,7 +288,7 @@ void SAL_CALL LayerUpdateMerger::overrideProperty( const OUString& aName, sal_In // ----------------------------------------------------------------------------- void SAL_CALL LayerUpdateMerger::endProperty( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (BasicUpdateMerger::isHandling()) { @@ -300,8 +300,8 @@ void SAL_CALL LayerUpdateMerger::endProperty( ) if (!m_xCurrentProp.is()) { - OUString sMsg( RTL_CONSTASCII_USTRINGPARAM("LayerUpdateMerger: Invalid data: Ending property that wasn't started.") ); - throw MalformedDataException( sMsg, *this, uno::Any() ); + rtl::OUString sMsg( RTL_CONSTASCII_USTRINGPARAM("LayerUpdateMerger: Invalid data: Ending property that wasn't started.") ); + throw backenduno::MalformedDataException( sMsg, *this, uno::Any() ); } // write unhandled so far values @@ -314,7 +314,7 @@ void SAL_CALL LayerUpdateMerger::endProperty( ) // ----------------------------------------------------------------------------- void SAL_CALL LayerUpdateMerger::setPropertyValue( const uno::Any& aValue ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (BasicUpdateMerger::isHandling()) { @@ -326,8 +326,8 @@ void SAL_CALL LayerUpdateMerger::setPropertyValue( const uno::Any& aValue ) if (!m_xCurrentProp.is()) { - OUString sMsg( RTL_CONSTASCII_USTRINGPARAM("LayerUpdateMerger: Invalid data: setting value, but no property is started.") ); - throw MalformedDataException( sMsg, *this, uno::Any() ); + rtl::OUString sMsg( RTL_CONSTASCII_USTRINGPARAM("LayerUpdateMerger: Invalid data: setting value, but no property is started.") ); + throw backenduno::MalformedDataException( sMsg, *this, uno::Any() ); } if (!m_xCurrentProp->hasChange()) @@ -353,8 +353,8 @@ void SAL_CALL LayerUpdateMerger::setPropertyValue( const uno::Any& aValue ) } // ----------------------------------------------------------------------------- -void SAL_CALL LayerUpdateMerger::setPropertyValueForLocale( const uno::Any& aValue, const OUString & aLocale ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL LayerUpdateMerger::setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString & aLocale ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (BasicUpdateMerger::isHandling()) { @@ -366,8 +366,8 @@ void SAL_CALL LayerUpdateMerger::setPropertyValueForLocale( const uno::Any& aVal if (!m_xCurrentProp.is()) { - OUString sMsg( RTL_CONSTASCII_USTRINGPARAM("LayerUpdateMerger: Invalid data: setting value, but no property is started.") ); - throw MalformedDataException( sMsg, *this, uno::Any() ); + rtl::OUString sMsg( RTL_CONSTASCII_USTRINGPARAM("LayerUpdateMerger: Invalid data: setting value, but no property is started.") ); + throw backenduno::MalformedDataException( sMsg, *this, uno::Any() ); } if (!m_xCurrentProp->hasChangeFor(aLocale)) @@ -393,8 +393,8 @@ void SAL_CALL LayerUpdateMerger::setPropertyValueForLocale( const uno::Any& aVal } // ----------------------------------------------------------------------------- -void SAL_CALL LayerUpdateMerger::addProperty( const OUString& aName, sal_Int16 aAttributes, const uno::Type& aType ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL LayerUpdateMerger::addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (BasicUpdateMerger::isHandling()) { @@ -403,7 +403,7 @@ void SAL_CALL LayerUpdateMerger::addProperty( const OUString& aName, sal_Int16 a } OSL_ASSERT( m_xCurrentNode.is()); - ElementUpdateRef xUpdate = m_xCurrentNode->getPropertyByName(aName); + rtl::Reference<ElementUpdate> xUpdate = m_xCurrentNode->getPropertyByName(aName); if (!xUpdate.is()) { BasicUpdateMerger::addProperty(aName, aAttributes, aType); @@ -442,8 +442,8 @@ void SAL_CALL LayerUpdateMerger::addProperty( const OUString& aName, sal_Int16 a } // ----------------------------------------------------------------------------- -void SAL_CALL LayerUpdateMerger::addPropertyWithValue( const OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL LayerUpdateMerger::addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (BasicUpdateMerger::isHandling()) { @@ -452,7 +452,7 @@ void SAL_CALL LayerUpdateMerger::addPropertyWithValue( const OUString& aName, sa } OSL_ASSERT( m_xCurrentNode.is()); - ElementUpdateRef xUpdate = m_xCurrentNode->getPropertyByName(aName); + rtl::Reference<ElementUpdate> xUpdate = m_xCurrentNode->getPropertyByName(aName); if (!xUpdate.is()) { BasicUpdateMerger::addPropertyWithValue(aName, aAttributes, aValue); diff --git a/configmgr/source/backend/layerupdatemerger.hxx b/configmgr/source/backend/layerupdatemerger.hxx index 6097eb4e9c..751c5b7274 100644 --- a/configmgr/source/backend/layerupdatemerger.hxx +++ b/configmgr/source/backend/layerupdatemerger.hxx @@ -42,22 +42,18 @@ namespace configmgr namespace backend { // ----------------------------------------------------------------------------- - using rtl::OUString; -// ----------------------------------------------------------------------------- class NodeUpdate; class PropertyUpdate; - typedef rtl::Reference<NodeUpdate> NodeUpdateRef; - typedef rtl::Reference<PropertyUpdate> PropertyUpdateRef; class LayerUpdateMerger : protected BasicUpdateMerger { public: - static LayerSource getMergedLayer(LayerSource const & _xSourceLayer, LayerUpdate const & _aLayerUpdate) + static uno::Reference< backenduno::XLayer > getMergedLayer(uno::Reference< backenduno::XLayer > const & _xSourceLayer, LayerUpdate const & _aLayerUpdate) { return new LayerUpdateMerger(_xSourceLayer, _aLayerUpdate); } public: explicit - LayerUpdateMerger( LayerSource const & _xSourceLayer, LayerUpdate const & _aLayerUpdate); + LayerUpdateMerger( uno::Reference< backenduno::XLayer > const & _xSourceLayer, LayerUpdate const & _aLayerUpdate); ~LayerUpdateMerger(); @@ -66,55 +62,55 @@ namespace configmgr protected: virtual void SAL_CALL startLayer( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL endLayer( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - overrideNode( const OUString& aName, sal_Int16 aAttributes, sal_Bool bClear ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + overrideNode( const rtl::OUString& aName, sal_Int16 aAttributes, sal_Bool bClear ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - addOrReplaceNode( const OUString& aName, sal_Int16 aAttributes ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + addOrReplaceNode( const rtl::OUString& aName, sal_Int16 aAttributes ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - addOrReplaceNodeFromTemplate( const OUString& aName, const TemplateIdentifier& aTemplate, sal_Int16 aAttributes ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + addOrReplaceNodeFromTemplate( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL endNode( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - dropNode( const OUString& aName ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + dropNode( const rtl::OUString& aName ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - overrideProperty( const OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + overrideProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType, sal_Bool bClear ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL endProperty( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL setPropertyValue( const uno::Any& aValue ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - setPropertyValueForLocale( const uno::Any& aValue, const OUString & aLocale ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + setPropertyValueForLocale( const uno::Any& aValue, const rtl::OUString & aLocale ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - addProperty( const OUString& aName, sal_Int16 aAttributes, const uno::Type& aType ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - addPropertyWithValue( const OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + addPropertyWithValue( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aValue ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); // BasicUpdateMerger virtual void flushUpdate(); @@ -122,8 +118,8 @@ namespace configmgr void malformedUpdate(sal_Char const * pMsg); private: LayerUpdate m_aLayerUpdate; - NodeUpdateRef m_xCurrentNode; - PropertyUpdateRef m_xCurrentProp; + rtl::Reference<NodeUpdate> m_xCurrentNode; + rtl::Reference<PropertyUpdate> m_xCurrentProp; }; // ----------------------------------------------------------------------------- } // namespace xml diff --git a/configmgr/source/backend/mergedcomponentdata.cxx b/configmgr/source/backend/mergedcomponentdata.cxx index 9720d6aa6f..bc3604fd0f 100644 --- a/configmgr/source/backend/mergedcomponentdata.cxx +++ b/configmgr/source/backend/mergedcomponentdata.cxx @@ -75,13 +75,13 @@ bool MergedComponentData::hasTemplates() const } // ----------------------------------------------------------------------------- -OUString MergedComponentData::getTemplateAccessor (TemplateIdentifier const & _aTemplateName) const +rtl::OUString MergedComponentData::getTemplateAccessor (backenduno::TemplateIdentifier const & _aTemplateName) const { return _aTemplateName.Name; } // ----------------------------------------------------------------------------- -bool MergedComponentData::hasTemplate(OUString const & _aTemplateName) const +bool MergedComponentData::hasTemplate(rtl::OUString const & _aTemplateName) const { return m_pTemplatesTree.get() != NULL && m_pTemplatesTree->getChild( _aTemplateName ) != NULL; @@ -100,7 +100,7 @@ std::auto_ptr<ISubtree> MergedComponentData::extractTemplatesTree() } // ----------------------------------------------------------------------------- -std::auto_ptr<INode> MergedComponentData::extractTemplateNode(OUString const & _aTemplateName) +std::auto_ptr<INode> MergedComponentData::extractTemplateNode(rtl::OUString const & _aTemplateName) { if (m_pTemplatesTree.get() == NULL) return std::auto_ptr<INode>(); @@ -109,7 +109,7 @@ std::auto_ptr<INode> MergedComponentData::extractTemplateNode(OUString const & _ } // ----------------------------------------------------------------------------- -ISubtree const * MergedComponentData::findTemplate(OUString const & _aTemplateName) const +ISubtree const * MergedComponentData::findTemplate(rtl::OUString const & _aTemplateName) const { INode const * pTemplateNode = m_pTemplatesTree->getChild(_aTemplateName); @@ -121,7 +121,7 @@ ISubtree const * MergedComponentData::findTemplate(OUString const & _aTemplateNa } // ----------------------------------------------------------------------------- -std::auto_ptr<INode> MergedComponentData::instantiateTemplate(OUString const & _aName, OUString const & _aTemplateName) const +std::auto_ptr<INode> MergedComponentData::instantiateTemplate(rtl::OUString const & _aName, rtl::OUString const & _aTemplateName) const { if (INode const * pTemplateNode = m_pTemplatesTree->getChild(_aTemplateName)) { @@ -152,7 +152,7 @@ void MergedComponentData::setTemplatesTree(std::auto_ptr<ISubtree> _aTemplateT m_pTemplatesTree = _aTemplateTree; } // ----------------------------------------------------------------------------- -ISubtree * MergedComponentData::addTemplate(std::auto_ptr<ISubtree> _aNode, TemplateIdentifier const & aTemplate) +ISubtree * MergedComponentData::addTemplate(std::auto_ptr<ISubtree> _aNode, backenduno::TemplateIdentifier const & aTemplate) { OSL_PRECOND(_aNode.get(), "ERROR: Adding a NULL template"); diff --git a/configmgr/source/backend/mergedcomponentdata.hxx b/configmgr/source/backend/mergedcomponentdata.hxx index 8c8a11eef2..6cda735aea 100644 --- a/configmgr/source/backend/mergedcomponentdata.hxx +++ b/configmgr/source/backend/mergedcomponentdata.hxx @@ -52,10 +52,6 @@ namespace configmgr // ----------------------------------------------------------------------------- namespace backenduno = ::com::sun::star::configuration::backend; - using backenduno::TemplateIdentifier; - - using ::rtl::OUString; - // ----------------------------------------------------------------------------- class MergedComponentData @@ -66,28 +62,28 @@ namespace configmgr bool hasSchema() const; bool hasTemplates() const; - bool hasTemplate(OUString const & _aTemplateName) const; + bool hasTemplate(rtl::OUString const & _aTemplateName) const; - OUString getTemplateAccessor (TemplateIdentifier const & _aTemplateName) const; + rtl::OUString getTemplateAccessor (backenduno::TemplateIdentifier const & _aTemplateName) const; ISubtree const * getSchemaTree() const { return m_pSchemaTree.get(); } ISubtree const * getTemplatesTree() const { return m_pTemplatesTree.get(); } - ISubtree const * findTemplate(OUString const & _aTemplateName) const; + ISubtree const * findTemplate(rtl::OUString const & _aTemplateName) const; ISubtree * getSchemaTree() { return m_pSchemaTree.get(); } ISubtree * getTemplatesTree() { return m_pTemplatesTree.get(); } - std::auto_ptr<INode> instantiateTemplate(OUString const & _aName, OUString const & _aTemplateName) const; + std::auto_ptr<INode> instantiateTemplate(rtl::OUString const & _aName, rtl::OUString const & _aTemplateName) const; void clear(); ISubtree * setSchemaRoot(std::auto_ptr<ISubtree> _aSchemaRoot); - ISubtree * addTemplate(std::auto_ptr<ISubtree> _aNode, TemplateIdentifier const & aTemplate); + ISubtree * addTemplate(std::auto_ptr<ISubtree> _aNode, backenduno::TemplateIdentifier const & aTemplate); void setTemplatesTree(std::auto_ptr<ISubtree> _aTemplateTree); std::auto_ptr<ISubtree> extractSchemaTree(); std::auto_ptr<ISubtree> extractTemplatesTree(); - std::auto_ptr<INode> extractTemplateNode(OUString const & _aTemplateName); + std::auto_ptr<INode> extractTemplateNode(rtl::OUString const & _aTemplateName); private: std::auto_ptr<ISubtree> m_pSchemaTree; std::auto_ptr<ISubtree> m_pTemplatesTree; diff --git a/configmgr/source/backend/multistratumbackend.cxx b/configmgr/source/backend/multistratumbackend.cxx index 3b52c41059..3bc3169a32 100644 --- a/configmgr/source/backend/multistratumbackend.cxx +++ b/configmgr/source/backend/multistratumbackend.cxx @@ -98,10 +98,8 @@ bool checkOptionalArg(rtl::OUString& aArg) } } //------------------------------------------------------------------------------ -typedef std::pair<rtl::OUString, rtl::OUString> ServiceInfo; -typedef std::vector<ServiceInfo> ServiceInfoList; void parseStrataInfo(const rtl::OUString aServiceList, - ServiceInfoList& aServiceInfoList, + std::vector< std::pair<rtl::OUString, rtl::OUString> >& aServiceInfoList, const uno::Reference<uno::XInterface>& pContext) { sal_Int32 nNextToken =0; @@ -109,7 +107,7 @@ void parseStrataInfo(const rtl::OUString aServiceList, do { - OUString aServiceName =aServiceList.getToken(0, ':',nNextToken); + rtl::OUString aServiceName =aServiceList.getToken(0, ':',nNextToken); if((nNextToken ==-1)||(aServiceName.getLength()==0)) { throw backenduno::BackendSetupException( @@ -117,9 +115,9 @@ void parseStrataInfo(const rtl::OUString aServiceList, "Malformed Strata Service specified")), pContext, uno::Any()) ; } - OUString aServiceData = aServiceList.getToken(0, ';',nNextToken); + rtl::OUString aServiceData = aServiceList.getToken(0, ';',nNextToken); - ServiceInfo aServiceInfo(aServiceName,aServiceData); + std::pair<rtl::OUString, rtl::OUString> aServiceInfo(aServiceName,aServiceData); aServiceInfoList.push_back(aServiceInfo); } while (nNextToken >= 0 && nNextToken < nLength ) ; @@ -127,7 +125,7 @@ void parseStrataInfo(const rtl::OUString aServiceList, //------------------------------------------------------------------------------ MultiStratumBackend::MultiStratumBackend( const uno::Reference<uno::XComponentContext>& xContext) - : BackendBase(mMutex), mFactory(xContext->getServiceManager(),uno::UNO_QUERY_THROW) + : cppu::WeakComponentImplHelper7< backenduno::XBackend, backenduno::XBackendEntities, backenduno::XVersionedSchemaSupplier, backenduno::XBackendChangesNotifier, backenduno::XBackendChangesListener, lang::XInitialization, lang::XServiceInfo >(mMutex), mFactory(xContext->getServiceManager(),uno::UNO_QUERY_THROW) ,mListenerList() { @@ -189,7 +187,7 @@ void SAL_CALL MultiStratumBackend::initialize( if (bAdminMode) { // find given entity - OUString sDefaultEntity; + rtl::OUString sDefaultEntity; if ( (context->getValueByName(kEntity) >>= sDefaultEntity) && sDefaultEntity.getLength() ) { for (sal_uInt32 i = 0; i < mBackendStrata.size(); i++) @@ -235,16 +233,15 @@ void SAL_CALL MultiStratumBackend::initialize( } //------------------------------------------------------------------------------ -typedef uno::Reference<backenduno::XSchemaSupplier> SchemaSupplier; void MultiStratumBackend::initializeSchemaSupplier(const uno::Reference<uno::XComponentContext>& aContext) { - OUString aServiceName; + rtl::OUString aServiceName; aContext->getValueByName(kSchemaServiceParam) >>= aServiceName; uno::Sequence< uno::Any > aInitArgs( 1 ); aInitArgs[0] <<= aContext; - mSchemaSupplier = SchemaSupplier::query(mFactory->createInstanceWithArguments(aServiceName,aInitArgs)) ; + mSchemaSupplier = uno::Reference<backenduno::XSchemaSupplier>::query(mFactory->createInstanceWithArguments(aServiceName,aInitArgs)) ; if (!mSchemaSupplier.is()) { throw backenduno::BackendSetupException( @@ -258,18 +255,16 @@ void MultiStratumBackend::initializeSchemaSupplier(const uno::Reference<uno::XC static bool approveRecovery(const backenduno::StratumCreationException & aError) { - using namespace apihelper; - typedef SimpleInteractionRequest::Continuation Choice; - Choice const k_supported_choices = CONTINUATION_APPROVE ; //| CONTINUATION_DISAPPROVE; + sal_uInt32 const k_supported_choices = apihelper::CONTINUATION_APPROVE ; //| apihelper::CONTINUATION_DISAPPROVE; - Choice chosen = CONTINUATION_UNKNOWN; + sal_uInt32 chosen = apihelper::CONTINUATION_UNKNOWN; - ConfigurationInteractionHandler handler; + apihelper::ConfigurationInteractionHandler handler; try { uno::Reference< css::task::XInteractionHandler > h(handler.get()); if (h.is()) { - rtl::Reference< SimpleInteractionRequest > req( - new SimpleInteractionRequest( + rtl::Reference< apihelper::SimpleInteractionRequest > req( + new apihelper::SimpleInteractionRequest( uno::makeAny(aError), k_supported_choices)); h->handle(req.get()); chosen = req->getResponse(); @@ -280,9 +275,9 @@ bool approveRecovery(const backenduno::StratumCreationException & aError) switch (chosen) { - case CONTINUATION_APPROVE: return true; - case CONTINUATION_DISAPPROVE: return false; - case CONTINUATION_UNKNOWN: break; + case apihelper::CONTINUATION_APPROVE: return true; + case apihelper::CONTINUATION_DISAPPROVE: return false; + case apihelper::CONTINUATION_UNKNOWN: break; default: OSL_ENSURE(false,"Unsolicited continuation chosen"); break; } @@ -293,7 +288,7 @@ bool approveRecovery(const backenduno::StratumCreationException & aError) void MultiStratumBackend::initializeBackendStrata(const uno::Reference<uno::XComponentContext>& aContext) { - OUString sStrata; + rtl::OUString sStrata; //Get Strata aContext->getValueByName(kStrataServiceParam) >>= sStrata; if(sStrata.getLength()==0) @@ -306,14 +301,14 @@ void MultiStratumBackend::initializeBackendStrata(const uno::Reference<uno::XCom } //need to parse the Strata to extract service names and data location - ServiceInfoList aServiceInfoList; + std::vector< std::pair<rtl::OUString, rtl::OUString> > aServiceInfoList; parseStrataInfo(sStrata,aServiceInfoList,*this); - for (ServiceInfoList::const_iterator it = aServiceInfoList.begin(); it != aServiceInfoList.end(); ++it) + for (std::vector< std::pair<rtl::OUString, rtl::OUString> >::const_iterator it = aServiceInfoList.begin(); it != aServiceInfoList.end(); ++it) { uno::Sequence< uno::Any > aInitArgs( 1 ); - OUString sServiceName = it->first; - const OUString& sServiceData = it->second; + rtl::OUString sServiceName = it->first; + const rtl::OUString& sServiceData = it->second; aInitArgs[0] <<= sServiceData; uno::Reference <uno::XInterface> xBackend; bool bOptional = checkOptionalArg(sServiceName); @@ -327,8 +322,8 @@ void MultiStratumBackend::initializeBackendStrata(const uno::Reference<uno::XCom if(!bOptional) { static const sal_Char sErrContext[] = "MultiStratumBackend: Could not create Backend Stratum Service: "; - OUString const sContext(RTL_CONSTASCII_USTRINGPARAM(sErrContext)); - OUString const sMessage = sContext.concat(exception.Message); + rtl::OUString const sContext(RTL_CONSTASCII_USTRINGPARAM(sErrContext)); + rtl::OUString const sMessage = sContext.concat(exception.Message); backenduno::StratumCreationException error(sMessage,*this, ::cppu::getCaughtException(), @@ -355,7 +350,7 @@ rtl::OUString SAL_CALL { return mOwnerEntity; } - return OUString(); + return rtl::OUString(); } //------------------------------------------------------------------------------ @@ -373,10 +368,10 @@ rtl::OUString SAL_CALL } else { - return OUString(); + return rtl::OUString(); } } - return OUString(); + return rtl::OUString(); } //------------------------------------------------------------------------------ @@ -388,7 +383,7 @@ sal_Bool SAL_CALL osl::MutexGuard aGuard(mMutex); if (checkOkState()) { - for (BackendStrata::const_iterator it = mBackendStrata.begin(); it != mBackendStrata.end(); ++it) + for (std::vector< uno::Reference <uno::XInterface> >::const_iterator it = mBackendStrata.begin(); it != mBackendStrata.end(); ++it) { uno::Reference< backenduno::XBackendEntities > xEntities( *it, uno::UNO_QUERY ); if (xEntities.is()) @@ -433,7 +428,7 @@ sal_Bool SAL_CALL if (checkOkState()) { - for (BackendStrata::const_iterator it = mBackendStrata.begin(); it != mBackendStrata.end(); ++it) + for (std::vector< uno::Reference <uno::XInterface> >::const_iterator it = mBackendStrata.begin(); it != mBackendStrata.end(); ++it) { uno::Reference< backenduno::XBackendEntities > xEntities( *it, uno::UNO_QUERY ); if (xEntities.is()) @@ -535,7 +530,7 @@ uno::Sequence<uno::Reference<backenduno::XLayer> > SAL_CALL sal_Int32 MultiStratumBackend::findSupportingStratum(const rtl::OUString& aEntity) { sal_Int32 nNumLayers = mBackendStrata.size(); - for (BackendStrata::reverse_iterator it = mBackendStrata.rbegin(); it != mBackendStrata.rend(); ++it) + for (std::vector< uno::Reference <uno::XInterface> >::reverse_iterator it = mBackendStrata.rbegin(); it != mBackendStrata.rend(); ++it) { uno::Reference< backenduno::XBackendEntities > xEntities( *it, uno::UNO_QUERY ); if (xEntities.is()) @@ -554,14 +549,13 @@ sal_Int32 MultiStratumBackend::findSupportingStratum(const rtl::OUString& aEntit *this, 0) ; } //------------------------------------------------------------------------------ -typedef std::vector<uno::Reference<backenduno::XLayer> > BackendLayers; uno::Sequence<uno::Reference<backenduno::XLayer> > MultiStratumBackend::searchSupportingStrata(sal_Int32 nNumLayers, rtl::OUString aEntity, const rtl::OUString& aComponent) { uno::Sequence<uno::Reference<backenduno::XLayer> > aLayers; - BackendLayers aBackendLayers; + std::vector<uno::Reference<backenduno::XLayer> > aBackendLayers; for (sal_Int32 i = 0 ; i < nNumLayers ; ++ i) { uno::Sequence<uno::Reference<backenduno::XLayer> > aMultiLayers; @@ -616,7 +610,7 @@ uno::Sequence<uno::Reference<backenduno::XLayer> > mBackendStrata[i], uno::UNO_REF_QUERY_THROW) ; if (xSingleLayerStratum.is()) { - uno::Reference<backenduno::XLayer> xLayer = xSingleLayerStratum->getLayer( aComponent, OUString()); + uno::Reference<backenduno::XLayer> xLayer = xSingleLayerStratum->getLayer( aComponent, rtl::OUString()); //Could be an empty layer if (xLayer.is()) { @@ -658,7 +652,7 @@ uno::Reference<backenduno::XUpdateHandler> SAL_CALL { sal_Int32 nNumSupportedLayers = mBackendStrata.size(); - OUString aUsedEntity; + rtl::OUString aUsedEntity; if(aEntity != mOwnerEntity) { @@ -765,7 +759,7 @@ void SAL_CALL MultiStratumBackend::disposing() } if (!mBackendStrata.empty()) { - for (BackendStrata::const_iterator it = mBackendStrata.begin(); it != mBackendStrata.end(); ++it) + for (std::vector< uno::Reference <uno::XInterface> >::const_iterator it = mBackendStrata.begin(); it != mBackendStrata.end(); ++it) { uno::Reference< lang::XComponent> xComp( *it, uno::UNO_QUERY ); if (xComp.is()) @@ -789,7 +783,7 @@ static const sal_Char * const kBackendService = "com.sun.star.configuration.back static const sal_Char * const kImplementation = "com.sun.star.comp.configuration.backend.MultiStratumBackend" ; -static const AsciiServiceName kServiceNames [] = +static sal_Char const * const kServiceNames [] = { kBackendService, 0 @@ -807,7 +801,7 @@ const ServiceRegistrationInfo *getMultiStratumBackendServiceInfo() } uno::Reference<uno::XInterface> SAL_CALL - instantiateMultiStratumBackend(const CreationContext& xContext) + instantiateMultiStratumBackend(const uno::Reference< uno::XComponentContext >& xContext) { return *new MultiStratumBackend(xContext) ; } @@ -917,7 +911,7 @@ void MultiStratumBackend::notifyListeners(const backenduno::ComponentChangeEvent { //fire off notification to all registered listeners for specific Component ListenerList::const_iterator aIter; - OUString aComponentName = aEvent.Component; + rtl::OUString aComponentName = aEvent.Component; if (mListenerList.empty()) { OSL_TRACE("MultiStratumBackend: notifyListeners: no listeners registered for component %s", diff --git a/configmgr/source/backend/multistratumbackend.hxx b/configmgr/source/backend/multistratumbackend.hxx index 339d2f586d..00865ea664 100644 --- a/configmgr/source/backend/multistratumbackend.hxx +++ b/configmgr/source/backend/multistratumbackend.hxx @@ -56,20 +56,11 @@ namespace uno = css::uno ; namespace lang = css::lang ; namespace backenduno = css::configuration::backend ; -typedef cppu::WeakComponentImplHelper7< backenduno::XBackend, - backenduno::XBackendEntities, - backenduno::XVersionedSchemaSupplier, - backenduno::XBackendChangesNotifier, - backenduno::XBackendChangesListener, - lang::XInitialization, - lang::XServiceInfo> BackendBase ; - - /** Class implementing the Backend service for multibackend access. It creates the required backends and coordinates access to them. */ -class MultiStratumBackend : public BackendBase { +class MultiStratumBackend : public cppu::WeakComponentImplHelper7< backenduno::XBackend, backenduno::XBackendEntities, backenduno::XVersionedSchemaSupplier, backenduno::XBackendChangesNotifier, backenduno::XBackendChangesListener, lang::XInitialization, lang::XServiceInfo > { public : /** Service constructor from a service factory. @@ -212,19 +203,17 @@ class MultiStratumBackend : public BackendBase { uno::Reference<lang::XMultiServiceFactory> mFactory ; /** Mutex for resource protection */ osl::Mutex mMutex ; - typedef std::vector< uno::Reference <uno::XInterface> > BackendStrata; uno::Reference<backenduno::XSchemaSupplier> mSchemaSupplier ; /** list of all backends */ - BackendStrata mBackendStrata; + std::vector< uno::Reference <uno::XInterface> > mBackendStrata; rtl::OUString mOwnerEntity; /** Helper object that listens to the Strata Backends */ - typedef uno::Reference<backenduno::XBackendChangesListener> ListenerRef; - ListenerRef mStrataListener; + uno::Reference<backenduno::XBackendChangesListener> mStrataListener; /** List of higher level listeners */ - typedef std::multimap<rtl::OUString, ListenerRef> ListenerList; + typedef std::multimap< rtl::OUString, uno::Reference<backenduno::XBackendChangesListener> > ListenerList; ListenerList mListenerList; } ; diff --git a/configmgr/source/backend/schemabuilder.cxx b/configmgr/source/backend/schemabuilder.cxx index e73805978f..0956119e85 100644 --- a/configmgr/source/backend/schemabuilder.cxx +++ b/configmgr/source/backend/schemabuilder.cxx @@ -58,15 +58,15 @@ namespace configmgr //#if OSL_DEBUG_LEVEL > 0 // currently not used in debug builds #if 0 - static void check_if_complete(MergedComponentData & md, SchemaBuilder::Context const & xContext) + static void check_if_complete(MergedComponentData & md, uno::Reference< uno::XComponentContext > const & xContext) { uno::Reference< backenduno::XSchemaHandler > - test(new SchemaBuilder(xContext, OUString(),md,NULL)); + test(new SchemaBuilder(xContext, rtl::OUString(),md,NULL)); } #endif // ----------------------------------------------------------------------------- -SchemaBuilder::SchemaBuilder(Context const & xContext, const OUString& aExpectedComponentName, MergedComponentData & rData, ITemplateDataProvider* aTemplateProvider ) +SchemaBuilder::SchemaBuilder(uno::Reference< uno::XComponentContext > const & xContext, const rtl::OUString& aExpectedComponentName, MergedComponentData & rData, ITemplateDataProvider* aTemplateProvider ) : m_aData(rData) , m_aContext(xContext) //, m_aContext(xContext,static_cast<backenduno::XSchemaHandler*>(this), aExpectedComponentName, aTemplateProvider ) @@ -86,7 +86,7 @@ SchemaBuilder::~SchemaBuilder( ) // XSchemaHandler void SAL_CALL SchemaBuilder::startSchema( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (!this->isDone()) m_aContext.raiseMalformedDataException("Schema builder: Unexpected Restart of Schema"); @@ -99,7 +99,7 @@ void SAL_CALL SchemaBuilder::startSchema( ) // ----------------------------------------------------------------------------- void SAL_CALL SchemaBuilder::endSchema( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (!this->isDone()) m_aContext.raiseMalformedDataException("Schema builder: Unexpected End of Schema"); @@ -108,19 +108,19 @@ void SAL_CALL SchemaBuilder::endSchema( ) } // ----------------------------------------------------------------------------- -void SAL_CALL SchemaBuilder::importComponent( const OUString& /*aName*/ ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL SchemaBuilder::importComponent( const rtl::OUString& /*aName*/ ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { //OSL_TRACE("WARNING: Configuration schema parser: Cross-component references are not yet supported\n"); } // ----------------------------------------------------------------------------- -void SAL_CALL SchemaBuilder::startComponent( const OUString& aName ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL SchemaBuilder::startComponent( const rtl::OUString& aName ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (m_aData.hasSchema()) - m_aContext.raiseElementExistException("Schema builder: The component schema is already loaded", OUString()); + m_aContext.raiseElementExistException("Schema builder: The component schema is already loaded", rtl::OUString()); m_aContext.startActiveComponent(aName); @@ -134,7 +134,7 @@ void SAL_CALL SchemaBuilder::startComponent( const OUString& aName ) // ----------------------------------------------------------------------------- void SAL_CALL SchemaBuilder::endComponent( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { m_aContext.popNode(); @@ -153,8 +153,8 @@ bool SchemaBuilder::isExtensible(sal_Int16 aSchemaAttributes) } // ----------------------------------------------------------------------------- -void SAL_CALL SchemaBuilder::startGroupTemplate( const TemplateIdentifier& aTemplate, sal_Int16 aAttributes ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL SchemaBuilder::startGroupTemplate( const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (aTemplate.Component.getLength() == 0) m_aContext.raiseIllegalArgumentException("Schema builder: Starting template without owning component",1); @@ -164,7 +164,7 @@ void SAL_CALL SchemaBuilder::startGroupTemplate( const TemplateIdentifier& aTemp if (m_aData.hasTemplate(aTemplate.Name)) m_aContext.raiseElementExistException("Schema builder: Template already exists",aTemplate.Name); - OUString aName = m_aData.getTemplateAccessor(aTemplate); + rtl::OUString aName = m_aData.getTemplateAccessor(aTemplate); bool bExtensible = isExtensible(aAttributes); std::auto_ptr<ISubtree> aTemplateTree = @@ -176,8 +176,8 @@ void SAL_CALL SchemaBuilder::startGroupTemplate( const TemplateIdentifier& aTemp } // ----------------------------------------------------------------------------- -void SAL_CALL SchemaBuilder::startSetTemplate( const TemplateIdentifier& aTemplate, sal_Int16 aAttributes, const TemplateIdentifier& aItemType ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL SchemaBuilder::startSetTemplate( const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes, const backenduno::TemplateIdentifier& aItemType ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if (aTemplate.Component.getLength() == 0) m_aContext.raiseIllegalArgumentException("Schema builder: Starting template without owning component",1); @@ -187,8 +187,8 @@ void SAL_CALL SchemaBuilder::startSetTemplate( const TemplateIdentifier& aTempla if (m_aData.hasTemplate(aTemplate.Name)) m_aContext.raiseElementExistException("Schema builder: Template already exists",aTemplate.Name); - OUString aName = m_aData.getTemplateAccessor(aTemplate); - TemplateIdentifier aFullType = m_aContext.completeComponent(aItemType); + rtl::OUString aName = m_aData.getTemplateAccessor(aTemplate); + backenduno::TemplateIdentifier aFullType = m_aContext.completeComponent(aItemType); bool bExtensible = isExtensible(aAttributes); std::auto_ptr<ISubtree> aTemplateTree = @@ -201,7 +201,7 @@ void SAL_CALL SchemaBuilder::startSetTemplate( const TemplateIdentifier& aTempla // ----------------------------------------------------------------------------- void SAL_CALL SchemaBuilder::endTemplate( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { m_aContext.popNode(); @@ -209,8 +209,8 @@ void SAL_CALL SchemaBuilder::endTemplate( ) } // ----------------------------------------------------------------------------- -void SAL_CALL SchemaBuilder::startGroup( const OUString& aName, sal_Int16 aAttributes ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL SchemaBuilder::startGroup( const rtl::OUString& aName, sal_Int16 aAttributes ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { bool bExtensible = isExtensible(aAttributes); @@ -222,10 +222,10 @@ void SAL_CALL SchemaBuilder::startGroup( const OUString& aName, sal_Int16 aAttri } // ----------------------------------------------------------------------------- -void SAL_CALL SchemaBuilder::startSet( const OUString& aName, sal_Int16 aAttributes, const TemplateIdentifier& aItemType ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL SchemaBuilder::startSet( const rtl::OUString& aName, sal_Int16 aAttributes, const backenduno::TemplateIdentifier& aItemType ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { - TemplateIdentifier aFullType = m_aContext.completeComponent(aItemType); + backenduno::TemplateIdentifier aFullType = m_aContext.completeComponent(aItemType); bool bExtensible = isExtensible(aAttributes); std::auto_ptr<ISubtree> aTree = m_aFactory.createSet(aName,aFullType,bExtensible,getNodeAttributes()); @@ -237,7 +237,7 @@ void SAL_CALL SchemaBuilder::startSet( const OUString& aName, sal_Int16 aAttribu // ----------------------------------------------------------------------------- void SAL_CALL SchemaBuilder::endNode( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { m_aContext.popNode(); @@ -263,8 +263,8 @@ node::Attributes SchemaBuilder::makePropertyAttributes(sal_Int16 aSchemaAttribut } // ----------------------------------------------------------------------------- -void SAL_CALL SchemaBuilder::addProperty( const OUString& aName, sal_Int16 aAttributes, const uno::Type& aType ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL SchemaBuilder::addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { // TODO: add type validation node::Attributes aValueAttributes = makePropertyAttributes(aAttributes); @@ -286,8 +286,8 @@ void SAL_CALL SchemaBuilder::addProperty( const OUString& aName, sal_Int16 aAttr } // ----------------------------------------------------------------------------- -void SAL_CALL SchemaBuilder::addPropertyWithDefault( const OUString& aName, sal_Int16 aAttributes, const uno::Any& aDefaultValue ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL SchemaBuilder::addPropertyWithDefault( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aDefaultValue ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { // TODO: add parameter validation node::Attributes aValueAttributes = makePropertyAttributes(aAttributes); @@ -315,10 +315,10 @@ void SAL_CALL SchemaBuilder::addPropertyWithDefault( const OUString& aName, sal_ } // ----------------------------------------------------------------------------- -void SAL_CALL SchemaBuilder::addInstance( const OUString& aName, const TemplateIdentifier& aTemplate ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL SchemaBuilder::addInstance( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { - TemplateIdentifier aFullType = m_aContext.completeComponent(aTemplate); + backenduno::TemplateIdentifier aFullType = m_aContext.completeComponent(aTemplate); std::auto_ptr<ISubtree> aPlaceHolder = m_aFactory.createPlaceHolder(aName,aFullType); @@ -327,8 +327,8 @@ void SAL_CALL SchemaBuilder::addInstance( const OUString& aName, const TemplateI } // ----------------------------------------------------------------------------- -void SAL_CALL SchemaBuilder::addItemType( const TemplateIdentifier& aItemType ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL SchemaBuilder::addItemType( const backenduno::TemplateIdentifier& aItemType ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException) { if ( m_aContext.getCurrentParent().getElementTemplateName() != aItemType.Name || m_aContext.getCurrentParent().getElementTemplateModule() != m_aContext.getTemplateComponent(aItemType) ) @@ -369,15 +369,12 @@ namespace { class SubstitutionHelper : NodeModification { - typedef std::vector< ISubtree const * > TemplateStack; - typedef std::vector< OUString > InstanceList; - MergedComponentData & m_rData; DataBuilderContext m_aContext; ComponentDataFactory m_aFactory; - InstanceList m_aReplacementList; - TemplateStack m_aTemplateStack; + std::vector< rtl::OUString > m_aReplacementList; + std::vector< ISubtree const * > m_aTemplateStack; public: SubstitutionHelper(DataBuilderContext const & aBaseContext, MergedComponentData & _rData, uno::XInterface * _pContext) : m_rData(_rData) @@ -392,7 +389,7 @@ namespace void substituteInNode(ISubtree & _rNode); void substituteInList(); - void substitute(OUString const & _aName); + void substitute(rtl::OUString const & _aName); virtual void handle(ValueNode&); virtual void handle(ISubtree&); @@ -436,7 +433,7 @@ namespace void SubstitutionHelper::substituteInNode(ISubtree & _rNode) { - InstanceList aSaveInstances; + std::vector< rtl::OUString > aSaveInstances; aSaveInstances.swap(m_aReplacementList); // todo: own stack to check against infinite recursion @@ -454,7 +451,7 @@ namespace void SubstitutionHelper::substituteInList() { - for(InstanceList::iterator it = m_aReplacementList.begin(); + for(std::vector< rtl::OUString >::iterator it = m_aReplacementList.begin(); it != m_aReplacementList.end(); ++it) { this->substitute(*it); @@ -462,7 +459,7 @@ namespace } // ----------------------------------------------------------------------------- - void SubstitutionHelper::substitute(OUString const & _aName) + void SubstitutionHelper::substitute(rtl::OUString const & _aName) { ISubtree & rParent = m_aContext.getCurrentParent(); @@ -473,12 +470,12 @@ namespace ISubtree * pReplacedInstance = pReplacedNode->asISubtree(); OSL_ASSERT( pReplacedInstance != NULL ); - TemplateIdentifier aTemplateName = m_aFactory.getInstanceType(*pReplacedInstance); + backenduno::TemplateIdentifier aTemplateName = m_aFactory.getInstanceType(*pReplacedInstance); if (aTemplateName.Component == m_aContext.getActiveComponent()) { if (ISubtree const * pTemplate = m_rData.findTemplate(aTemplateName.Name)) { - TemplateStack::iterator beg = m_aTemplateStack.begin(), end = m_aTemplateStack.end(); + std::vector< ISubtree const * >::iterator beg = m_aTemplateStack.begin(), end = m_aTemplateStack.end(); if (std::find(beg,end,pTemplate) != end) m_aContext.raiseMalformedDataException("SchemaBuilder: Could not expand instances: Template is recursive"); @@ -505,9 +502,9 @@ namespace //Import Template from different component else { - TemplateRequest aTemplateRequest(configuration::makeName(aTemplateName.Name, configuration::Name::NoValidate()), - configuration::makeName(aTemplateName.Component, configuration::Name::NoValidate()) ); - TemplateResult aResult = m_aContext.getTemplateData( aTemplateRequest ); + TemplateRequest aTemplateRequest(aTemplateName.Name, + aTemplateName.Component ); + ResultHolder< TemplateInstance > aResult = m_aContext.getTemplateData( aTemplateRequest ); std::auto_ptr<INode> pTemplateInstance = aResult.extractDataAndClear(); pTemplateInstance->setName(_aName); diff --git a/configmgr/source/backend/schemabuilder.hxx b/configmgr/source/backend/schemabuilder.hxx index 1ccd2892e0..4fc42c377e 100644 --- a/configmgr/source/backend/schemabuilder.hxx +++ b/configmgr/source/backend/schemabuilder.hxx @@ -50,19 +50,13 @@ namespace configmgr namespace lang = ::com::sun::star::lang; namespace backenduno = ::com::sun::star::configuration::backend; - - using backenduno::MalformedDataException; // ----------------------------------------------------------------------------- - typedef ::cppu::WeakImplHelper1<backenduno::XSchemaHandler> SchemaBuilder_Base; - class SchemaBuilder - : public SchemaBuilder_Base + : public cppu::WeakImplHelper1<backenduno::XSchemaHandler> { public: - typedef uno::Reference< uno::XComponentContext > Context; - - SchemaBuilder(Context const & xContext, const OUString& aExpectedComponentName, MergedComponentData & rData, ITemplateDataProvider* aTemplateProvider = NULL ); + SchemaBuilder(uno::Reference< uno::XComponentContext > const & xContext, const rtl::OUString& aExpectedComponentName, MergedComponentData & rData, ITemplateDataProvider* aTemplateProvider = NULL ); virtual ~SchemaBuilder(); // checking the result @@ -75,63 +69,63 @@ namespace configmgr public: virtual void SAL_CALL startSchema( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL endSchema( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - importComponent( const OUString& aName ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + importComponent( const rtl::OUString& aName ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - startComponent( const OUString& aName ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + startComponent( const rtl::OUString& aName ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL endComponent( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - startGroupTemplate( const TemplateIdentifier& aTemplate, sal_Int16 aAttributes ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + startGroupTemplate( const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - startSetTemplate( const TemplateIdentifier& aTemplate, sal_Int16 aAttributes, const TemplateIdentifier& aItemType ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + startSetTemplate( const backenduno::TemplateIdentifier& aTemplate, sal_Int16 aAttributes, const backenduno::TemplateIdentifier& aItemType ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL endTemplate( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - startGroup( const OUString& aName, sal_Int16 aAttributes ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + startGroup( const rtl::OUString& aName, sal_Int16 aAttributes ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - startSet( const OUString& aName, sal_Int16 aAttributes, const TemplateIdentifier& aItemType ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + startSet( const rtl::OUString& aName, sal_Int16 aAttributes, const backenduno::TemplateIdentifier& aItemType ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL endNode( ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - addProperty( const OUString& aName, sal_Int16 aAttributes, const uno::Type& aType ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + addProperty( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Type& aType ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - addPropertyWithDefault( const OUString& aName, sal_Int16 aAttributes, const uno::Any& aDefaultValue ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + addPropertyWithDefault( const rtl::OUString& aName, sal_Int16 aAttributes, const uno::Any& aDefaultValue ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - addInstance( const OUString& aName, const TemplateIdentifier& aTemplate ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + addInstance( const rtl::OUString& aName, const backenduno::TemplateIdentifier& aTemplate ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); virtual void SAL_CALL - addItemType( const TemplateIdentifier& aItemType ) - throw (MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); + addItemType( const backenduno::TemplateIdentifier& aItemType ) + throw (backenduno::MalformedDataException, lang::WrappedTargetException, uno::RuntimeException); private: static node::Attributes getComponentRootAttributes(); diff --git a/configmgr/source/backend/singlebackendadapter.cxx b/configmgr/source/backend/singlebackendadapter.cxx index 5086aa8901..bcecbe7e5b 100644 --- a/configmgr/source/backend/singlebackendadapter.cxx +++ b/configmgr/source/backend/singlebackendadapter.cxx @@ -45,7 +45,7 @@ namespace configmgr { namespace backend { SingleBackendAdapter::SingleBackendAdapter( const uno::Reference<uno::XComponentContext>& xContext) - : BackendBase(mMutex), mFactory(xContext->getServiceManager(),uno::UNO_QUERY) { + : cppu::WeakComponentImplHelper5< backenduno::XBackend, backenduno::XBackendEntities, backenduno::XSchemaSupplier, lang::XInitialization, lang::XServiceInfo >(mMutex), mFactory(xContext->getServiceManager(),uno::UNO_QUERY) { } //------------------------------------------------------------------------------ @@ -67,13 +67,13 @@ void SAL_CALL SingleBackendAdapter::initialize( if (!mBackend.is()) { throw com::sun::star::configuration::CannotLoadConfigurationException( - OUString::createFromAscii("Online SingleBackend Adapter: Cannot operate without real (Single)Backend"), + rtl::OUString::createFromAscii("Online SingleBackend Adapter: Cannot operate without real (Single)Backend"), *this); } } //------------------------------------------------------------------------------ -static inline OUString getSingleLayerDummyEntity() -{ return OUString(RTL_CONSTASCII_USTRINGPARAM("*")); } +static inline rtl::OUString getSingleLayerDummyEntity() +{ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*")); } //------------------------------------------------------------------------------ bool SingleBackendAdapter::checkOkState() { @@ -284,7 +284,7 @@ static const sal_Char * const kOnlineService = "com.sun.star.configuration.back static const sal_Char * const kImplementation = "com.sun.star.comp.configuration.backend.SingleBackendAdapter" ; -static const AsciiServiceName kServiceNames [] = +static sal_Char const * const kServiceNames [] = { kOnlineService, kAdapterService, @@ -305,7 +305,7 @@ const ServiceRegistrationInfo *getSingleBackendAdapterServiceInfo() } uno::Reference<uno::XInterface> SAL_CALL - instantiateSingleBackendAdapter(const CreationContext& xContext) + instantiateSingleBackendAdapter(const uno::Reference< uno::XComponentContext >& xContext) { return *new SingleBackendAdapter(xContext) ; } diff --git a/configmgr/source/backend/singlebackendadapter.hxx b/configmgr/source/backend/singlebackendadapter.hxx index 1b5390828c..5790f27dd8 100644 --- a/configmgr/source/backend/singlebackendadapter.hxx +++ b/configmgr/source/backend/singlebackendadapter.hxx @@ -46,16 +46,11 @@ namespace uno = css::uno ; namespace lang = css::lang ; namespace backenduno = css::configuration::backend ; -typedef cppu::WeakComponentImplHelper5< backenduno::XBackend, - backenduno::XBackendEntities, - backenduno::XSchemaSupplier, - lang::XInitialization, - lang::XServiceInfo> BackendBase ; /** Class implementing the Backend service for remote access. It just transfers calls to a SingleBackend implementation. */ -class SingleBackendAdapter : public BackendBase { +class SingleBackendAdapter : public cppu::WeakComponentImplHelper5< backenduno::XBackend, backenduno::XBackendEntities, backenduno::XSchemaSupplier, lang::XInitialization, lang::XServiceInfo > { public : /** Service constructor from a service factory. diff --git a/configmgr/source/backend/updatedata.cxx b/configmgr/source/backend/updatedata.cxx index 4453971c6a..0f15d1a894 100644 --- a/configmgr/source/backend/updatedata.cxx +++ b/configmgr/source/backend/updatedata.cxx @@ -46,7 +46,7 @@ namespace configmgr { // ----------------------------------------------------------------------------- -ElementUpdate::ElementUpdate(NodeUpdate * _pParent, OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask) +ElementUpdate::ElementUpdate(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask) : NamedUpdate(_aName) , m_pParent(_pParent) , m_nFlags(_nFlags) @@ -74,7 +74,7 @@ PropertyUpdate * ElementUpdate::asPropertyUpdate() // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- -NodeUpdate::NodeUpdate(NodeUpdate * _pParent, OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, Op _op) +NodeUpdate::NodeUpdate(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, Op _op) : ElementUpdate(_pParent,_aName,_nFlags, _nFlagsMask) , m_aNodes() , m_aProperties() @@ -92,7 +92,7 @@ NodeUpdate * NodeUpdate::asNodeUpdate(bool _bMerged) } // ----------------------------------------------------------------------------- -bool NodeUpdate::addNodeUpdate(ElementUpdateRef const & _aNode) +bool NodeUpdate::addNodeUpdate(rtl::Reference<ElementUpdate> const & _aNode) { OSL_PRECOND( _aNode.is(), "ERROR: NodeUpdate: Trying to add NULL node."); OSL_PRECOND( _aNode->getParent() == this, "ERROR: NodeUpdate: Node being added has wrong parent."); @@ -103,7 +103,7 @@ bool NodeUpdate::addNodeUpdate(ElementUpdateRef const & _aNode) } // ----------------------------------------------------------------------------- -bool NodeUpdate::addPropertyUpdate(ElementUpdateRef const & _aProp) +bool NodeUpdate::addPropertyUpdate(rtl::Reference<ElementUpdate> const & _aProp) { OSL_PRECOND( _aProp.is(), "ERROR: NodeUpdate: Trying to add NULL property."); OSL_PRECOND( _aProp->getParent() == this, "ERROR: NodeUpdate: Property being added has wrong parent."); @@ -114,7 +114,7 @@ bool NodeUpdate::addPropertyUpdate(ElementUpdateRef const & _aProp) } // ----------------------------------------------------------------------------- -void NodeUpdate::removeNodeByName(OUString const & _aName) +void NodeUpdate::removeNodeByName(rtl::OUString const & _aName) { ElementList::iterator it = m_aNodes.find(_aName); OSL_ENSURE(it != m_aNodes.end(), @@ -128,7 +128,7 @@ void NodeUpdate::removeNodeByName(OUString const & _aName) } // ----------------------------------------------------------------------------- -void NodeUpdate::removePropertyByName (OUString const & _aName) +void NodeUpdate::removePropertyByName (rtl::OUString const & _aName) { ElementList::iterator it = m_aProperties.find(_aName); OSL_ENSURE(it != m_aProperties.end(), @@ -142,35 +142,35 @@ void NodeUpdate::removePropertyByName (OUString const & _aName) } // ----------------------------------------------------------------------------- -ElementUpdateRef NodeUpdate::getNodeByName(OUString const & _aName) const +rtl::Reference<ElementUpdate> NodeUpdate::getNodeByName(rtl::OUString const & _aName) const { - Iterator it = m_aNodes.find(_aName); + ElementList::const_iterator it = m_aNodes.find(_aName); - return it != m_aNodes.end() ? it->second : ElementUpdateRef(); + return it != m_aNodes.end() ? it->second : rtl::Reference<ElementUpdate>(); } // ----------------------------------------------------------------------------- -ElementUpdateRef NodeUpdate::getPropertyByName (OUString const & _aName) const +rtl::Reference<ElementUpdate> NodeUpdate::getPropertyByName (rtl::OUString const & _aName) const { - Iterator it = m_aProperties.find(_aName); + ElementList::const_iterator it = m_aProperties.find(_aName); - return it != m_aProperties.end() ? it->second : ElementUpdateRef(); + return it != m_aProperties.end() ? it->second : rtl::Reference<ElementUpdate>(); } // ----------------------------------------------------------------------------- void NodeUpdate::writeChildrenToLayer(backenduno::XLayerHandler * _pLayer) { OSL_ASSERT(_pLayer); - for (Iterator itP = beginProperties(); itP != endProperties(); ++itP) + for (ElementList::const_iterator itP = beginProperties(); itP != endProperties(); ++itP) itP->second->writeToLayer(_pLayer); - for (Iterator itN = beginNodes(); itN != endNodes(); ++itN) + for (ElementList::const_iterator itN = beginNodes(); itN != endNodes(); ++itN) itN->second->writeToLayer(_pLayer); } // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- -NodeModification::NodeModification(NodeUpdate * _pParent, OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, sal_Bool _bReset) +NodeModification::NodeModification(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, sal_Bool _bReset) : NodeUpdate(_pParent,_aName,_nFlags, _nFlagsMask, _bReset ? reset : modify) { } @@ -192,7 +192,7 @@ void NodeModification::writeToLayer(backenduno::XLayerHandler * _pLayer) // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- -NodeReplace::NodeReplace(NodeUpdate * _pParent, OUString const & _aName, sal_Int16 _nFlags) +NodeReplace::NodeReplace(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags) : NodeUpdate(_pParent,_aName,_nFlags, _nFlags, replace) , m_aTemplateName() , m_aTemplateComponent() @@ -200,7 +200,7 @@ NodeReplace::NodeReplace(NodeUpdate * _pParent, OUString const & _aName, sal_Int } // ----------------------------------------------------------------------------- -NodeReplace::NodeReplace(NodeUpdate * _pParent, OUString const & _aName, sal_Int16 _nFlags, OUString const & _aTemplateName, OUString const & _aTemplateComponent) +NodeReplace::NodeReplace(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, rtl::OUString const & _aTemplateName, rtl::OUString const & _aTemplateComponent) : NodeUpdate(_pParent,_aName,_nFlags, _nFlags, replace) , m_aTemplateName(_aTemplateName) , m_aTemplateComponent(_aTemplateComponent) @@ -232,7 +232,7 @@ void NodeReplace::writeToLayer(backenduno::XLayerHandler * _pLayer) // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- -NodeDrop::NodeDrop(NodeUpdate * _pParent, OUString const & _aName) +NodeDrop::NodeDrop(NodeUpdate * _pParent, rtl::OUString const & _aName) : ElementUpdate(_pParent,_aName,0,0) { } @@ -246,7 +246,7 @@ void NodeDrop::writeToLayer(backenduno::XLayerHandler * _pLayer) // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- -PropertyUpdate::PropertyUpdate(NodeUpdate * _pParent, OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, uno::Type const & _aType) +PropertyUpdate::PropertyUpdate(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, uno::Type const & _aType) : ElementUpdate(_pParent,_aName,_nFlags,_nFlagsMask) , m_aValues() , m_aType(_aType) @@ -286,7 +286,7 @@ uno::Any const & PropertyUpdate::getResetMarker() } // ----------------------------------------------------------------------------- -bool PropertyUpdate::setValueFor(OUString const & _aLocale, uno::Any const & _aValueUpdate) +bool PropertyUpdate::setValueFor(rtl::OUString const & _aLocale, uno::Any const & _aValueUpdate) { OSL_PRECOND( !isResetMarker(_aValueUpdate), "PropertyUpdate: ERROR: Trying to set a reset marker as regular value" ); @@ -307,7 +307,7 @@ bool PropertyUpdate::setValueFor(OUString const & _aLocale, uno::Any const & _aV } // ----------------------------------------------------------------------------- -bool PropertyUpdate::resetValueFor(OUString const & _aLocale) +bool PropertyUpdate::resetValueFor(rtl::OUString const & _aLocale) { OSL_ENSURE(m_aValues.find(_aLocale) == m_aValues.end(), "PropertyUpdate: Locale being reset already has a value in this property."); @@ -316,7 +316,7 @@ bool PropertyUpdate::resetValueFor(OUString const & _aLocale) } // ----------------------------------------------------------------------------- -void PropertyUpdate::removeValueFor(OUString const & _aLocale) +void PropertyUpdate::removeValueFor(rtl::OUString const & _aLocale) { OSL_ENSURE(m_aValues.find(_aLocale) != m_aValues.end(), "PropertyUpdate: Locale being removed is not in this node."); @@ -332,33 +332,33 @@ void PropertyUpdate::finishValue() } // ----------------------------------------------------------------------------- -bool PropertyUpdate::hasValueFor(OUString const & _aLocale) const +bool PropertyUpdate::hasValueFor(rtl::OUString const & _aLocale) const { - Iterator it = m_aValues.find(_aLocale); + ValueList::const_iterator it = m_aValues.find(_aLocale); return it != m_aValues.end() && ! isResetMarker(it->second); } // ----------------------------------------------------------------------------- -bool PropertyUpdate::hasResetFor(OUString const & _aLocale) const +bool PropertyUpdate::hasResetFor(rtl::OUString const & _aLocale) const { - Iterator it = m_aValues.find(_aLocale); + ValueList::const_iterator it = m_aValues.find(_aLocale); return it != m_aValues.end() && isResetMarker(it->second); } // ----------------------------------------------------------------------------- -bool PropertyUpdate::hasChangeFor(OUString const & _aLocale) const +bool PropertyUpdate::hasChangeFor(rtl::OUString const & _aLocale) const { - Iterator it = m_aValues.find(_aLocale); + ValueList::const_iterator it = m_aValues.find(_aLocale); return it != m_aValues.end(); } // ----------------------------------------------------------------------------- -uno::Any PropertyUpdate::getValueFor(OUString const & _aLocale) const +uno::Any PropertyUpdate::getValueFor(rtl::OUString const & _aLocale) const { - Iterator it = m_aValues.find(_aLocale); + ValueList::const_iterator it = m_aValues.find(_aLocale); OSL_ENSURE(it != m_aValues.end() && !isResetMarker(it->second), "PropertyUpdate: Should not call getValue() unless hasValue() returns true" ); @@ -377,7 +377,7 @@ void PropertyUpdate::writeValueToLayer(backenduno::XLayerHandler * _pLayer, uno: } // ----------------------------------------------------------------------------- -void PropertyUpdate::writeValueToLayerFor(backenduno::XLayerHandler * _pLayer, uno::Any const & _aValue, OUString const & _aLocale) +void PropertyUpdate::writeValueToLayerFor(backenduno::XLayerHandler * _pLayer, uno::Any const & _aValue, rtl::OUString const & _aLocale) { OSL_ASSERT(_pLayer); if (_aLocale == this->primarySlot()) @@ -393,7 +393,7 @@ void PropertyUpdate::writeValueToLayerFor(backenduno::XLayerHandler * _pLayer, u void PropertyUpdate::writeValuesToLayer(backenduno::XLayerHandler * _pLayer) { OSL_ASSERT(_pLayer); - for (Iterator itV = beginValues(); itV != endValues(); ++itV) + for (ValueList::const_iterator itV = beginValues(); itV != endValues(); ++itV) this->writeValueToLayerFor(_pLayer, itV->second, itV->first); } // ----------------------------------------------------------------------------- @@ -410,7 +410,7 @@ void PropertyUpdate::writeToLayer(backenduno::XLayerHandler * _pLayer) // ----------------------------------------------------------------------------- -PropertyAdd::PropertyAdd(NodeUpdate * _pParent, OUString const & _aName, sal_Int16 _nFlags, uno::Type const & _aType) +PropertyAdd::PropertyAdd(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, uno::Type const & _aType) : ElementUpdate(_pParent,_aName,_nFlags,_nFlags) , m_aValueType(_aType) , m_aValue() @@ -419,7 +419,7 @@ PropertyAdd::PropertyAdd(NodeUpdate * _pParent, OUString const & _aName, sal_Int } // ----------------------------------------------------------------------------- -PropertyAdd::PropertyAdd(NodeUpdate * _pParent, OUString const & _aName, sal_Int16 _nFlags, uno::Any const & _aValue) +PropertyAdd::PropertyAdd(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, uno::Any const & _aValue) : ElementUpdate(_pParent,_aName,_nFlags,_nFlags) , m_aValueType(_aValue.getValueType()) , m_aValue(_aValue) @@ -438,7 +438,7 @@ void PropertyAdd::writeToLayer(backenduno::XLayerHandler * _pLayer) // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- -PropertyReset::PropertyReset(NodeUpdate * _pParent, OUString const & _aName) +PropertyReset::PropertyReset(NodeUpdate * _pParent, rtl::OUString const & _aName) : ElementUpdate(_pParent,_aName,0,0) { } diff --git a/configmgr/source/backend/updatedata.hxx b/configmgr/source/backend/updatedata.hxx index d94c877c9d..e3785e3781 100644 --- a/configmgr/source/backend/updatedata.hxx +++ b/configmgr/source/backend/updatedata.hxx @@ -35,6 +35,7 @@ #include <com/sun/star/uno/Type.hxx> #include <rtl/ref.hxx> #include <rtl/ustring.hxx> +#include <salhelper/simplereferenceobject.hxx> #include "utility.hxx" #ifndef INCLUDED_SET @@ -57,7 +58,6 @@ namespace configmgr namespace backend { // ----------------------------------------------------------------------------- - using rtl::OUString; namespace uno = ::com::sun::star::uno; namespace backenduno = ::com::sun::star::configuration::backend; // ----------------------------------------------------------------------------- @@ -70,24 +70,22 @@ namespace configmgr class PropertyAdd; class PropertyReset; - typedef rtl::Reference<ElementUpdate> ElementUpdateRef; - // ----------------------------------------------------------------------------- - class NamedUpdate : public configmgr::SimpleReferenceObject + class NamedUpdate : public salhelper::SimpleReferenceObject { - OUString const m_aName; + rtl::OUString const m_aName; protected: explicit - NamedUpdate(OUString const & _aName) + NamedUpdate(rtl::OUString const & _aName) : m_aName(_aName) {} ~NamedUpdate() {}; public: - OUString const & getName() const { return m_aName; } + rtl::OUString const & getName() const { return m_aName; } }; // ----------------------------------------------------------------------------- class ElementUpdate : public NamedUpdate @@ -96,7 +94,7 @@ namespace configmgr sal_Int16 m_nFlags; sal_Int16 m_nFlagsMask; protected: - ElementUpdate(NodeUpdate * _pParent, OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask); + ElementUpdate(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask); public: virtual NodeUpdate * asNodeUpdate(bool _bMerged = false); @@ -115,31 +113,30 @@ namespace configmgr class NodeUpdate : public ElementUpdate { - typedef std::map< OUString, ElementUpdateRef > ElementList; + typedef std::map< rtl::OUString, rtl::Reference<ElementUpdate> > ElementList; public: enum Op { modify, reset, replace }; protected: - NodeUpdate(NodeUpdate * _pParent, OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, Op _op); + NodeUpdate(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, Op _op); virtual NodeUpdate * asNodeUpdate(bool _bMerged); public: - bool addNodeUpdate (ElementUpdateRef const & _aNode); - bool addPropertyUpdate (ElementUpdateRef const & _aProp); - void removeNodeByName (OUString const & _aName); - void removePropertyByName (OUString const & _aName); + bool addNodeUpdate (rtl::Reference<ElementUpdate> const & _aNode); + bool addPropertyUpdate (rtl::Reference<ElementUpdate> const & _aProp); + void removeNodeByName (rtl::OUString const & _aName); + void removePropertyByName (rtl::OUString const & _aName); Op getOperation() const { return m_op; } - ElementUpdateRef getNodeByName (OUString const & _aName) const; - ElementUpdateRef getPropertyByName (OUString const & _aName) const; + rtl::Reference<ElementUpdate> getNodeByName (rtl::OUString const & _aName) const; + rtl::Reference<ElementUpdate> getPropertyByName (rtl::OUString const & _aName) const; - typedef ElementList::const_iterator Iterator; - Iterator beginNodes() const { return m_aNodes.begin(); } - Iterator endNodes() const { return m_aNodes.end(); }; - Iterator beginProperties() const { return m_aProperties.begin(); }; - Iterator endProperties() const { return m_aProperties.end(); }; + ElementList::const_iterator beginNodes() const { return m_aNodes.begin(); } + ElementList::const_iterator endNodes() const { return m_aNodes.end(); }; + ElementList::const_iterator beginProperties() const { return m_aProperties.begin(); }; + ElementList::const_iterator endProperties() const { return m_aProperties.end(); }; bool hasChildren() const { return !m_aNodes.empty() || !m_aProperties.empty(); } @@ -155,7 +152,7 @@ namespace configmgr class NodeModification : public NodeUpdate { public: - NodeModification(NodeUpdate * _pParent, OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, sal_Bool _bReset); + NodeModification(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, sal_Bool _bReset); virtual void writeToLayer(backenduno::XLayerHandler * _pLayer); }; // ----------------------------------------------------------------------------- @@ -163,24 +160,24 @@ namespace configmgr class NodeReplace : public NodeUpdate { public: - NodeReplace(NodeUpdate * _pParent, OUString const & _aName, sal_Int16 _nFlags); - NodeReplace(NodeUpdate * _pParent, OUString const & _aName, sal_Int16 _nFlags, OUString const & _aTemplateName, OUString const & _aTemplateComponent); + NodeReplace(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags); + NodeReplace(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, rtl::OUString const & _aTemplateName, rtl::OUString const & _aTemplateComponent); bool hasTemplate() const; - OUString getTemplateName() const { return m_aTemplateName; } - OUString getTemplateComponent() const { return m_aTemplateComponent; } + rtl::OUString getTemplateName() const { return m_aTemplateName; } + rtl::OUString getTemplateComponent() const { return m_aTemplateComponent; } virtual void writeToLayer(backenduno::XLayerHandler * _pLayer); private: - OUString m_aTemplateName; - OUString m_aTemplateComponent; + rtl::OUString m_aTemplateName; + rtl::OUString m_aTemplateComponent; }; // ----------------------------------------------------------------------------- class NodeDrop : public ElementUpdate { public: - NodeDrop(NodeUpdate * _pParent, OUString const & _aName); + NodeDrop(NodeUpdate * _pParent, rtl::OUString const & _aName); virtual void writeToLayer(backenduno::XLayerHandler * _pLayer); }; @@ -188,19 +185,18 @@ namespace configmgr class PropertyUpdate : public ElementUpdate { - typedef uno::Any ValueUpdate; - typedef std::map< OUString, ValueUpdate > ValueList; + typedef std::map< rtl::OUString, uno::Any > ValueList; ValueList m_aValues; uno::Type m_aType; public: - PropertyUpdate(NodeUpdate * _pParent, OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, uno::Type const & _aType); + PropertyUpdate(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, sal_Int16 _nFlagsMask, uno::Type const & _aType); - bool setValueFor(OUString const & _aLocale, ValueUpdate const & _aValueUpdate); - bool resetValueFor(OUString const & _aLocale); - void removeValueFor(OUString const & _aLocale); + bool setValueFor(rtl::OUString const & _aLocale, uno::Any const & _aValueUpdate); + bool resetValueFor(rtl::OUString const & _aLocale); + void removeValueFor(rtl::OUString const & _aLocale); - bool setValue(ValueUpdate const & _aValueUpdate) { return setValueFor(primarySlot(), _aValueUpdate); } + bool setValue(uno::Any const & _aValueUpdate) { return setValueFor(primarySlot(), _aValueUpdate); } bool resetValue() { return resetValueFor(primarySlot()); } void removeValue() { removeValueFor(primarySlot()); } @@ -208,28 +204,27 @@ namespace configmgr uno::Type const & getValueType() const { return m_aType; } - bool hasValueFor(OUString const & _aLocale) const; + bool hasValueFor(rtl::OUString const & _aLocale) const; bool hasValue() const { return hasValueFor(primarySlot()); } - bool hasResetFor(OUString const & _aLocale) const; + bool hasResetFor(rtl::OUString const & _aLocale) const; bool hasReset() const { return hasResetFor(primarySlot()); } - bool hasChangeFor(OUString const & _aLocale) const; + bool hasChangeFor(rtl::OUString const & _aLocale) const; bool hasChange() const { return hasChangeFor(primarySlot()); } - ValueUpdate getValueFor(OUString const & _aLocale) const; - ValueUpdate getValue() const { return getValueFor(primarySlot()); } + uno::Any getValueFor(rtl::OUString const & _aLocale) const; + uno::Any getValue() const { return getValueFor(primarySlot()); } - typedef ValueList::const_iterator Iterator; - Iterator beginValues() const { return m_aValues.begin(); } - Iterator endValues() const { return m_aValues.end(); } + ValueList::const_iterator beginValues() const { return m_aValues.begin(); } + ValueList::const_iterator endValues() const { return m_aValues.end(); } - void writeValueToLayerFor(backenduno::XLayerHandler * _pLayer, ValueUpdate const & _aValue, OUString const & _aLocale); - void writeValueToLayer(backenduno::XLayerHandler * _pLayer, ValueUpdate const & _aValue); + void writeValueToLayerFor(backenduno::XLayerHandler * _pLayer, uno::Any const & _aValue, rtl::OUString const & _aLocale); + void writeValueToLayer(backenduno::XLayerHandler * _pLayer, uno::Any const & _aValue); void writeValuesToLayer(backenduno::XLayerHandler * _pLayer); virtual void writeToLayer(backenduno::XLayerHandler * _pLayer); private: - OUString primarySlot() const { return OUString(); } + rtl::OUString primarySlot() const { return rtl::OUString(); } static uno::Any const & getResetMarker(); static inline bool isResetMarker(uno::Any const & _aValue); @@ -243,8 +238,8 @@ namespace configmgr uno::Type m_aValueType; uno::Any m_aValue; public: - PropertyAdd(NodeUpdate * _pParent, OUString const & _aName, sal_Int16 _nFlags, uno::Type const & _aType); - PropertyAdd(NodeUpdate * _pParent, OUString const & _aName, sal_Int16 _nFlags, uno::Any const & _aValue); + PropertyAdd(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, uno::Type const & _aType); + PropertyAdd(NodeUpdate * _pParent, rtl::OUString const & _aName, sal_Int16 _nFlags, uno::Any const & _aValue); bool hasValue() const { return !! m_aValue.hasValue(); } uno::Any const & getValue() const { return m_aValue; } @@ -257,7 +252,7 @@ namespace configmgr class PropertyReset : public ElementUpdate { public: - PropertyReset(NodeUpdate * _pParent, OUString const & _aName); + PropertyReset(NodeUpdate * _pParent, rtl::OUString const & _aName); virtual void writeToLayer(backenduno::XLayerHandler * _pLayer); }; diff --git a/configmgr/source/backend/updatedispatch.cxx b/configmgr/source/backend/updatedispatch.cxx index bd456ae969..d4c44846cc 100644 --- a/configmgr/source/backend/updatedispatch.cxx +++ b/configmgr/source/backend/updatedispatch.cxx @@ -31,13 +31,10 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_configmgr.hxx" +#include "treefragment.hxx" #include "updatedispatch.hxx" #include "configpath.hxx" #include "node.hxx" -#include "treeaccessor.hxx" -#include "valuenodeaccess.hxx" -#include "groupnodeaccess.hxx" -#include "setnodeaccess.hxx" #include "matchlocale.hxx" #include <com/sun/star/configuration/backend/XUpdateHandler.hpp> @@ -50,7 +47,7 @@ namespace configmgr { // ----------------------------------------------------------------------------- -UpdateDispatcher::UpdateDispatcher(UpdateHandler const & _xUpdateHandler, OUString const & _aLocale) +UpdateDispatcher::UpdateDispatcher(uno::Reference< backenduno::XUpdateHandler > const & _xUpdateHandler, rtl::OUString const & _aLocale) : m_pContextPath(NULL) , m_xUpdateHandler(_xUpdateHandler) , m_aLocale(_aLocale) @@ -70,7 +67,7 @@ void UpdateDispatcher::dispatchUpdate(configuration::AbsolutePath const & _aRoot { if (!m_xUpdateHandler.is()) { - OUString sMsg( RTL_CONSTASCII_USTRINGPARAM("ERROR: Cannot dispatch update - no handler found") ); + rtl::OUString sMsg( RTL_CONSTASCII_USTRINGPARAM("ERROR: Cannot dispatch update - no handler found") ); throw uno::RuntimeException(sMsg,NULL); } @@ -96,19 +93,19 @@ void UpdateDispatcher::startUpdate() m_xUpdateHandler->startUpdate(); m_bInValueSet = false; m_bInLocalizedValues = false; - m_aElementName = OUString(); + m_aElementName = rtl::OUString(); if (m_pContextPath) { - configuration::AbsolutePath::Iterator it = m_pContextPath->begin(); - configuration::AbsolutePath::Iterator stop = m_pContextPath->end(); + std::vector<configuration::Path::Component>::const_reverse_iterator it = m_pContextPath->begin(); + std::vector<configuration::Path::Component>::const_reverse_iterator stop = m_pContextPath->end(); OSL_ASSERT(it != stop); --stop; for ( ; it != stop; ++it) { - m_xUpdateHandler->modifyNode(it->getName().toString(),0,0,false); + m_xUpdateHandler->modifyNode(it->getName(),0,0,false); } } } @@ -118,8 +115,8 @@ void UpdateDispatcher::endUpdate() { if (m_pContextPath) { - configuration::AbsolutePath::Iterator it = m_pContextPath->begin(); - configuration::AbsolutePath::Iterator stop = m_pContextPath->end(); + std::vector<configuration::Path::Component>::const_reverse_iterator it = m_pContextPath->begin(); + std::vector<configuration::Path::Component>::const_reverse_iterator stop = m_pContextPath->end(); OSL_ASSERT(it != stop); --stop; @@ -138,7 +135,7 @@ void UpdateDispatcher::handle(ValueChange const& aValueNode) // special case: doing members of a localized property (as set) if (m_bInLocalizedValues) { - OUString aLocale = aValueNode.getNodeName(); + rtl::OUString aLocale = aValueNode.getNodeName(); if (aLocale.getLength()) { @@ -225,15 +222,14 @@ void UpdateDispatcher::handle(ValueChange const& aValueNode) void UpdateDispatcher::handle(AddNode const& aAddNode) { - data::TreeSegment aAddedTree = aAddNode.getNewTree(); + rtl::Reference< data::TreeSegment > aAddedTree = aAddNode.getNewTree(); OSL_ENSURE(aAddedTree.is(), "AddNode has no new data -> cannot add anything"); - OSL_ENSURE( !aAddedTree.is() || - ((m_bInValueSet||m_bInLocalizedValues) == aAddedTree.getSegmentRootNode()->isValue()), + OSL_ENSURE( ((m_bInValueSet||m_bInLocalizedValues) == aAddedTree->fragment->nodes[0].isValue()), "Found added subtree in value set (extensible group)\n" ); - this->visitTree( aAddedTree.getTreeAccess() ); + this->visitTree(aAddedTree->fragment); } // ----------------------------------------------------------------------------- @@ -241,10 +237,10 @@ void UpdateDispatcher::handle(RemoveNode const& aRemoveNode) { OSL_ENSURE( !m_bInLocalizedValues, "UpdateDispatcher: Removing values for a specific locale is currently not supported"); - data::TreeSegment aRemovedTree = aRemoveNode.getRemovedTree(); + rtl::Reference< data::TreeSegment > aRemovedTree = aRemoveNode.getRemovedTree(); - OSL_ENSURE( !aRemovedTree.is() || - ((m_bInValueSet||m_bInLocalizedValues) == aRemovedTree.getSegmentRootNode()->isValue()), + OSL_ENSURE( !aRemovedTree.is() || + ((m_bInValueSet||m_bInLocalizedValues) == aRemovedTree->fragment->nodes[0].isValue()), "Found removed subtree in value set (extensible group)\n" ); if (m_bInLocalizedValues) @@ -294,128 +290,128 @@ void UpdateDispatcher::handle(SubtreeChange const& aSubtree) } // ----------------------------------------------------------------------------- -data::SetVisitor::Result UpdateDispatcher::handle(data::ValueNodeAccess const& _aNode) +bool UpdateDispatcher::handle(sharable::ValueNode * node) { - OUString aName; + rtl::OUString aName; // special case: doing members of a localized property (as set) if (m_bInLocalizedValues) { // the node name is the locale - OUString aLocale; - OSL_VERIFY(testReplacedAndGetName(_aNode,aLocale)); // "Adding a localized subvalue but not as root of element tree" + rtl::OUString aLocale; + OSL_VERIFY(testReplacedAndGetName(sharable::node(node), aLocale)); // "Adding a localized subvalue but not as root of element tree" if (aLocale.getLength() && ! localehelper::isDefaultLanguage(aLocale)) { - m_xUpdateHandler->setPropertyValueForLocale( _aNode.getValue(), aLocale ); + m_xUpdateHandler->setPropertyValueForLocale(node->getValue(), aLocale); } else { - m_xUpdateHandler->setPropertyValue( _aNode.getValue() ); + m_xUpdateHandler->setPropertyValue(node->getValue()); } } - else if (testReplacedAndGetName(_aNode,aName)&& (_aNode.getAttributes().isRemovable()) ) // we must be inside a set of values + else if (testReplacedAndGetName(sharable::node(node), aName) && sharable::node(node)->getAttributes().isRemovable()) // we must be inside a set of values { - OSL_ENSURE(!_aNode.isLocalized(), "UpdateDispatcher: Cannot add a localized value in a layer ."); + OSL_ENSURE(!node->info.isLocalized(), "UpdateDispatcher: Cannot add a localized value in a layer ."); - sal_Int16 nAttr = getUpdateAttributes(_aNode.getAttributes(),true); + sal_Int16 nAttr = getUpdateAttributes(sharable::node(node)->getAttributes(),true); - if (!_aNode.isNull()) + if (!node->isNull()) { m_xUpdateHandler->addOrReplacePropertyWithValue( aName, nAttr, - _aNode.getValue()); + node->getValue()); } else { m_xUpdateHandler->addOrReplaceProperty( aName, nAttr, - _aNode.getValueType()); + node->getValueType()); } } else // normal case: updating a single property //Inserting set { - sal_Int16 nAttr = getUpdateAttributes(_aNode.getAttributes(),false); - sal_Int16 nAttrMask = getUpdateAttributeMask(_aNode.getAttributes()); + sal_Int16 nAttr = getUpdateAttributes(sharable::node(node)->getAttributes(),false); + sal_Int16 nAttrMask = getUpdateAttributeMask(sharable::node(node)->getAttributes()); - m_xUpdateHandler->modifyProperty( aName, nAttr, nAttrMask, _aNode.getValueType() ); + m_xUpdateHandler->modifyProperty( aName, nAttr, nAttrMask, node->getValueType() ); - if (_aNode.isLocalized() && m_aLocale.getLength()) + if (node->info.isLocalized() && m_aLocale.getLength()) { - m_xUpdateHandler->setPropertyValueForLocale( _aNode.getValue(), m_aLocale ); + m_xUpdateHandler->setPropertyValueForLocale(node->getValue(), m_aLocale); } else { - m_xUpdateHandler->setPropertyValue( _aNode.getValue() ); + m_xUpdateHandler->setPropertyValue(node->getValue()); } m_xUpdateHandler->endProperty(); } - return CONTINUE; + return false; } // ----------------------------------------------------------------------------- -data::SetVisitor::Result UpdateDispatcher::handle(data::GroupNodeAccess const& _aNode) +bool UpdateDispatcher::handle(sharable::GroupNode * node) { OSL_ENSURE( !m_bInLocalizedValues, "UpdateDispatcher: A localized value cannot be a complete group"); - OUString aName; + rtl::OUString aName; - if ( testReplacedAndGetName(_aNode,aName) ) + if ( testReplacedAndGetName(sharable::node(node), aName) ) { - sal_Int16 nAttr = getUpdateAttributes(_aNode.getAttributes(),true); + sal_Int16 nAttr = getUpdateAttributes(sharable::node(node)->getAttributes(),true); m_xUpdateHandler->addOrReplaceNode( aName, nAttr ); - this->visitChildren(_aNode); + this->visitChildren(node); m_xUpdateHandler->endNode(); } else { - sal_Int16 nAttr = getUpdateAttributes(_aNode.getAttributes(),false); - sal_Int16 nAttrMask = getUpdateAttributeMask(_aNode.getAttributes()); + sal_Int16 nAttr = getUpdateAttributes(sharable::node(node)->getAttributes(),false); + sal_Int16 nAttrMask = getUpdateAttributeMask(sharable::node(node)->getAttributes()); m_xUpdateHandler->modifyNode( aName, nAttr, nAttrMask, false ); - this->visitChildren(_aNode); + this->visitChildren(node); m_xUpdateHandler->endNode(); } - return CONTINUE; + return false; } // ----------------------------------------------------------------------------- -data::SetVisitor::Result UpdateDispatcher::handle(data::SetNodeAccess const& _aNode) +bool UpdateDispatcher::handle(sharable::SetNode * node) { OSL_ENSURE( !m_bInLocalizedValues, "UpdateDispatcher: A localized value cannot be a complete set"); - OUString aName; + rtl::OUString aName; - if ( testReplacedAndGetName(_aNode,aName) ) + if ( testReplacedAndGetName(sharable::node(node), aName) ) { - OSL_ENSURE( !_aNode.isLocalizedValueSetNode(), "UpdateDispatcher: Cannot add a localized value in a layer." ); + OSL_ENSURE( !node->info.isLocalized(), "UpdateDispatcher: Cannot add a localized value in a layer." ); - sal_Int16 nAttr = getUpdateAttributes(_aNode.getAttributes(),true); + sal_Int16 nAttr = getUpdateAttributes(sharable::node(node)->getAttributes(),true); m_xUpdateHandler->addOrReplaceNode( aName, nAttr ); - this->visitElements(_aNode); + this->visitElements(node); m_xUpdateHandler->endNode(); } else { - sal_Int16 nAttr = getUpdateAttributes(_aNode.getAttributes(),false); - sal_Int16 nAttrMask = getUpdateAttributeMask(_aNode.getAttributes()); + sal_Int16 nAttr = getUpdateAttributes(sharable::node(node)->getAttributes(),false); + sal_Int16 nAttrMask = getUpdateAttributeMask(sharable::node(node)->getAttributes()); - if (_aNode.isLocalizedValueSetNode()) + if (node->info.isLocalized()) { m_xUpdateHandler->modifyProperty( aName, nAttr, nAttrMask, uno::Type() ); m_bInLocalizedValues = true; - this->visitElements(_aNode); + this->visitElements(node); m_bInLocalizedValues = false; m_xUpdateHandler->endProperty(); @@ -425,39 +421,39 @@ data::SetVisitor::Result UpdateDispatcher::handle(data::SetNodeAccess const& _aN { m_xUpdateHandler->modifyNode( aName, nAttr, nAttrMask, false ); - this->visitElements(_aNode); + this->visitElements(node); m_xUpdateHandler->endNode(); } } - return CONTINUE; + return false; } // ----------------------------------------------------------------------------- -bool UpdateDispatcher::testReplacedAndGetName(data::NodeAccess const & _aNode, OUString & _aName) +bool UpdateDispatcher::testReplacedAndGetName(sharable::Node * node, rtl::OUString & _aName) { if (m_aElementName.getLength()) { - OSL_ENSURE( _aNode->isFragmentRoot(), "ERROR - UpdateDispatcher: Found orphaned 'element' name for inner node"); + OSL_ENSURE( node->isFragmentRoot(), "ERROR - UpdateDispatcher: Found orphaned 'element' name for inner node"); _aName = m_aElementName; - m_aElementName = OUString(); + m_aElementName = rtl::OUString(); return true; } else { - OSL_ENSURE(!_aNode->isFragmentRoot(), "ERROR - UpdateDispatcher: Found no 'element' name for fragment root node"); - _aName = _aNode.getName().toString(); + OSL_ENSURE(!node->isFragmentRoot(), "ERROR - UpdateDispatcher: Found no 'element' name for fragment root node"); + _aName = node->getName(); return false; } } // ----------------------------------------------------------------------------- -data::SetVisitor::Result UpdateDispatcher::handle(data::TreeAccessor const& _aElement) +bool UpdateDispatcher::handle(sharable::TreeFragment * tree) { - m_aElementName = _aElement.getName().toString(); - Result aRes = SetVisitor::handle(_aElement); // dispatch to root node - m_aElementName = OUString(); // clear - just to be safe - return aRes; + m_aElementName = tree->getName(); + bool done = SetVisitor::handle(tree); // dispatch to root node + m_aElementName = rtl::OUString(); // clear - just to be safe + return done; } // ----------------------------------------------------------------------------- diff --git a/configmgr/source/backend/updatedispatch.hxx b/configmgr/source/backend/updatedispatch.hxx index c5c4bd1cb7..642f8e1a9c 100644 --- a/configmgr/source/backend/updatedispatch.hxx +++ b/configmgr/source/backend/updatedispatch.hxx @@ -34,6 +34,7 @@ #include "change.hxx" #include "nodevisitor.hxx" #include "utility.hxx" +#include <boost/utility.hpp> #include <com/sun/star/uno/Reference.hxx> namespace com { namespace sun { namespace star { namespace configuration { namespace backend { @@ -56,11 +57,10 @@ namespace configmgr // ----------------------------------------------------------------------------- - class UpdateDispatcher : ChangeTreeAction, data::SetVisitor, Noncopyable + class UpdateDispatcher: private boost::noncopyable, private ChangeTreeAction, private data::SetVisitor { public: - typedef uno::Reference< backenduno::XUpdateHandler > UpdateHandler; - UpdateDispatcher(UpdateHandler const & _xUpdateHandler, OUString const & _aLocale); + UpdateDispatcher(uno::Reference< backenduno::XUpdateHandler > const & _xUpdateHandler, rtl::OUString const & _aLocale); ~UpdateDispatcher(); void dispatchUpdate(configuration::AbsolutePath const & _aRootPath, SubtreeChange const& _anUpdate); @@ -77,20 +77,20 @@ namespace configmgr virtual void handle(RemoveNode const& aRemoveNode); virtual void handle(SubtreeChange const& aSubtree) ; - virtual Result handle(data::ValueNodeAccess const& _aNode); - virtual Result handle(data::GroupNodeAccess const& _aNode); - virtual Result handle(data::SetNodeAccess const& _aNode); - virtual Result handle(data::TreeAccessor const& _aElement); + virtual bool handle(sharable::ValueNode * node); + virtual bool handle(sharable::GroupNode * node); + virtual bool handle(sharable::SetNode * node); + virtual bool handle(sharable::TreeFragment * tree); private: sal_Int16 getUpdateAttributes(node::Attributes const & _aAttributes, bool bAdded); sal_Int16 getUpdateAttributeMask(node::Attributes const & _aAttributes); - bool testReplacedAndGetName(data::NodeAccess const & _aNode, OUString & _aName); + bool testReplacedAndGetName(sharable::Node * node, rtl::OUString & _aName); private: configuration::AbsolutePath const * m_pContextPath; - UpdateHandler m_xUpdateHandler; - OUString m_aLocale; - OUString m_aElementName; + uno::Reference< backenduno::XUpdateHandler > m_xUpdateHandler; + rtl::OUString m_aLocale; + rtl::OUString m_aElementName; bool m_bInValueSet; bool m_bInLocalizedValues; }; diff --git a/configmgr/source/backend/updatesvc.cxx b/configmgr/source/backend/updatesvc.cxx index 44194079d2..ed042dc37d 100644 --- a/configmgr/source/backend/updatesvc.cxx +++ b/configmgr/source/backend/updatesvc.cxx @@ -56,7 +56,7 @@ namespace configmgr namespace backenduno = ::com::sun::star::configuration::backend; // ----------------------------------------------------------------------------- -AsciiServiceName const aUpdateMergerServices[] = +sal_Char const * const aUpdateMergerServices[] = { "com.sun.star.configuration.backend.LayerUpdateMerger", 0 @@ -81,13 +81,13 @@ ServiceInfoHelper UpdateService::getServiceInfo() // ----------------------------------------------------------------------------- -UpdateService::UpdateService(CreationArg _xContext) +UpdateService::UpdateService(uno::Reference< uno::XComponentContext > const & _xContext) : m_xServiceFactory(_xContext->getServiceManager(),uno::UNO_QUERY) , m_aSourceMode(merge) { if (!m_xServiceFactory.is()) { - OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration Update Merger: Context has no service manager (or missing interface)")); + rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration Update Merger: Context has no service manager (or missing interface)")); throw uno::RuntimeException(sMessage,NULL); } } @@ -103,7 +103,7 @@ void SAL_CALL if (sal_Int32(nCount) != aArguments.getLength()) { - OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Too many arguments to initialize a Configuration Update Merger")); + rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Too many arguments to initialize a Configuration Update Merger")); throw lang::IllegalArgumentException(sMessage,*this,0); } @@ -134,7 +134,7 @@ void SAL_CALL continue; } - OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Cannot use argument to initialize a Configuration Update Merger" + rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Cannot use argument to initialize a Configuration Update Merger" "- XLayer, XLayerHandler or XUpdatableLayer expected")); throw lang::IllegalArgumentException(sMessage,*this,i); } @@ -142,7 +142,7 @@ void SAL_CALL // ----------------------------------------------------------------------------- -sal_Bool UpdateService::setImplementationProperty(OUString const & aName, uno::Any const & aValue) +sal_Bool UpdateService::setImplementationProperty(rtl::OUString const & aName, uno::Any const & aValue) { if (aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Overwrite"))) { @@ -197,7 +197,7 @@ bool UpdateService::validateSourceLayerAndCheckNotEmpty() SAL_THROW( (lang::Ille } // ----------------------------------------------------------------------------- -UpdateService::Layer UpdateService::getSourceLayer() SAL_THROW( (lang::IllegalAccessException) ) +uno::Reference< backenduno::XLayer > UpdateService::getSourceLayer() SAL_THROW( (lang::IllegalAccessException) ) { if ( validateSourceLayerAndCheckNotEmpty() ) return m_xSourceLayer; @@ -209,18 +209,18 @@ UpdateService::Layer UpdateService::getSourceLayer() SAL_THROW( (lang::IllegalAc void UpdateService::raiseIllegalAccessException(sal_Char const * pMsg) SAL_THROW( (lang::IllegalAccessException) ) { - OUString sMsg = OUString::createFromAscii(pMsg); + rtl::OUString sMsg = rtl::OUString::createFromAscii(pMsg); throw lang::IllegalAccessException(sMsg,*this); } // ----------------------------------------------------------------------------- -void UpdateService::writeUpdatedLayer(Layer const & _xLayer) +void UpdateService::writeUpdatedLayer(uno::Reference< backenduno::XLayer > const & _xLayer) { OSL_ENSURE( _xLayer.is(), "UpdateService: Trying to write NULL XLayer"); if (!_xLayer.is()) { - OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Update Merger - Internal error: trying to write a NULL Layer")); + rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Update Merger - Internal error: trying to write a NULL Layer")); throw uno::RuntimeException(sMessage,*this); } @@ -239,7 +239,7 @@ void UpdateService::writeUpdatedLayer(Layer const & _xLayer) return; } - OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Update Merger: Cannot write merge results - no recipient available.")); + rtl::OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Update Merger: Cannot write merge results - no recipient available.")); throw uno::RuntimeException(sMessage,*this); } // ----------------------------------------------------------------------------- diff --git a/configmgr/source/backend/updatesvc.hxx b/configmgr/source/backend/updatesvc.hxx index e0d0c619e7..cf40e25e5f 100644 --- a/configmgr/source/backend/updatesvc.hxx +++ b/configmgr/source/backend/updatesvc.hxx @@ -53,7 +53,6 @@ namespace configmgr namespace backend { // ----------------------------------------------------------------------------- - using rtl::OUString; namespace uno = ::com::sun::star::uno; namespace lang = ::com::sun::star::lang; namespace backenduno = ::com::sun::star::configuration::backend; @@ -66,10 +65,8 @@ namespace configmgr > { public: - typedef uno::Reference< uno::XComponentContext > const & CreationArg; - explicit - UpdateService(CreationArg _xContext); + UpdateService(uno::Reference< uno::XComponentContext > const & _xContext); // XInitialization virtual void SAL_CALL @@ -90,20 +87,17 @@ namespace configmgr throw (uno::RuntimeException); protected: - typedef uno::Reference< lang::XMultiServiceFactory > ServiceFactory; - typedef uno::Reference< backenduno::XLayer > Layer; - - ServiceFactory getServiceFactory() const + uno::Reference< lang::XMultiServiceFactory > getServiceFactory() const { return m_xServiceFactory; } void checkSourceLayer() SAL_THROW( (lang::IllegalAccessException) ) { validateSourceLayerAndCheckNotEmpty(); } - Layer getSourceLayer() SAL_THROW( (lang::IllegalAccessException) ); + uno::Reference< backenduno::XLayer > getSourceLayer() SAL_THROW( (lang::IllegalAccessException) ); - void writeUpdatedLayer(Layer const & _xLayer); + void writeUpdatedLayer(uno::Reference< backenduno::XLayer > const & _xLayer); - virtual sal_Bool setImplementationProperty(OUString const & aName, uno::Any const & aValue); + virtual sal_Bool setImplementationProperty(rtl::OUString const & aName, uno::Any const & aValue); void raiseIllegalAccessException(sal_Char const * pMsg) SAL_THROW( (lang::IllegalAccessException) ); @@ -112,11 +106,9 @@ namespace configmgr bool validateSourceLayerAndCheckNotEmpty() SAL_THROW( (lang::IllegalAccessException) ); private: - typedef uno::Reference< backenduno::XLayerHandler > LayerWriter; - - ServiceFactory m_xServiceFactory; - Layer m_xSourceLayer; - LayerWriter m_xLayerWriter; + uno::Reference< lang::XMultiServiceFactory > m_xServiceFactory; + uno::Reference< backenduno::XLayer > m_xSourceLayer; + uno::Reference< backenduno::XLayerHandler > m_xLayerWriter; enum { merge, truncate, protect } m_aSourceMode; static ServiceInfoHelper getServiceInfo(); |