From fab2a35de66230b799194b8dbbdc314b0cff296d Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 19 Mar 2014 17:26:52 +0100 Subject: Access safe members directly Change-Id: I048bc4ba4e1fc3c7b0dab55cc8e5818086cb70c7 --- .../source/xml/acceleratorconfigurationwriter.cxx | 29 ++++++++-------------- 1 file changed, 10 insertions(+), 19 deletions(-) (limited to 'framework/source') diff --git a/framework/source/xml/acceleratorconfigurationwriter.cxx b/framework/source/xml/acceleratorconfigurationwriter.cxx index 82f98c1a5bb6..c495c29053a9 100644 --- a/framework/source/xml/acceleratorconfigurationwriter.cxx +++ b/framework/source/xml/acceleratorconfigurationwriter.cxx @@ -20,7 +20,6 @@ #include #include -#include #include #include @@ -38,8 +37,7 @@ namespace framework{ AcceleratorConfigurationWriter::AcceleratorConfigurationWriter(const AcceleratorCache& rContainer, const css::uno::Reference< css::xml::sax::XDocumentHandler >& xConfig ) - : ThreadHelpBase(&Application::GetSolarMutex()) - , m_xConfig (xConfig ) + : m_xConfig (xConfig ) , m_rContainer (rContainer ) { } @@ -52,15 +50,8 @@ AcceleratorConfigurationWriter::~AcceleratorConfigurationWriter() void AcceleratorConfigurationWriter::flush() { - // SAFE -> ---------------------------------- - Guard aReadLock(m_aLock); - - css::uno::Reference< css::xml::sax::XDocumentHandler > xCFG = m_xConfig; css::uno::Reference< css::xml::sax::XExtendedDocumentHandler > xExtendedCFG(m_xConfig, css::uno::UNO_QUERY_THROW); - aReadLock.unlock(); - // <- SAFE ---------------------------------- - // prepare attribute list ::comphelper::AttributeList* pAttribs = new ::comphelper::AttributeList; css::uno::Reference< css::xml::sax::XAttributeList > xAttribs(static_cast< css::xml::sax::XAttributeList* >(pAttribs), css::uno::UNO_QUERY); @@ -69,13 +60,13 @@ void AcceleratorConfigurationWriter::flush() pAttribs->AddAttribute(AL_XMLNS_XLINK, ATTRIBUTE_TYPE_CDATA, NS_XMLNS_XLINK); // generate xml - xCFG->startDocument(); + xExtendedCFG->startDocument(); xExtendedCFG->unknown(DOCTYPE_ACCELERATORS); - xCFG->ignorableWhitespace(OUString()); + xExtendedCFG->ignorableWhitespace(OUString()); - xCFG->startElement(AL_ELEMENT_ACCELERATORLIST, xAttribs); - xCFG->ignorableWhitespace(OUString()); + xExtendedCFG->startElement(AL_ELEMENT_ACCELERATORLIST, xAttribs); + xExtendedCFG->ignorableWhitespace(OUString()); // TODO think about threadsafe using of cache AcceleratorCache::TKeyList lKeys = m_rContainer.getAllKeys(); @@ -86,7 +77,7 @@ void AcceleratorConfigurationWriter::flush() { const css::awt::KeyEvent& rKey = *pKey; const OUString& rCommand = m_rContainer.getCommandByKey(rKey); - impl_ts_writeKeyCommandPair(rKey, rCommand, xCFG); + impl_ts_writeKeyCommandPair(rKey, rCommand, xExtendedCFG); } /* TODO write key-command list @@ -95,10 +86,10 @@ void AcceleratorConfigurationWriter::flush() WriteAcceleratorItem( *p ); */ - xCFG->ignorableWhitespace(OUString()); - xCFG->endElement(AL_ELEMENT_ACCELERATORLIST); - xCFG->ignorableWhitespace(OUString()); - xCFG->endDocument(); + xExtendedCFG->ignorableWhitespace(OUString()); + xExtendedCFG->endElement(AL_ELEMENT_ACCELERATORLIST); + xExtendedCFG->ignorableWhitespace(OUString()); + xExtendedCFG->endDocument(); } -- cgit