Kaydet (Commit) fab2a35d authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Access safe members directly

Change-Id: I048bc4ba4e1fc3c7b0dab55cc8e5818086cb70c7
üst f02e6d3d
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include <accelerators/acceleratorcache.hxx> #include <accelerators/acceleratorcache.hxx>
#include <accelerators/keymapping.hxx> #include <accelerators/keymapping.hxx>
#include <threadhelp/threadhelpbase.hxx>
#include <general.h> #include <general.h>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
...@@ -32,7 +31,7 @@ ...@@ -32,7 +31,7 @@
namespace framework{ namespace framework{
class AcceleratorConfigurationWriter : private ThreadHelpBase class AcceleratorConfigurationWriter
{ {
// member // member
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include <xml/acceleratorconfigurationwriter.hxx> #include <xml/acceleratorconfigurationwriter.hxx>
#include <acceleratorconst.h> #include <acceleratorconst.h>
#include <threadhelp/guard.hxx>
#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp> #include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
#include <com/sun/star/xml/sax/XAttributeList.hpp> #include <com/sun/star/xml/sax/XAttributeList.hpp>
...@@ -38,8 +37,7 @@ namespace framework{ ...@@ -38,8 +37,7 @@ namespace framework{
AcceleratorConfigurationWriter::AcceleratorConfigurationWriter(const AcceleratorCache& rContainer, AcceleratorConfigurationWriter::AcceleratorConfigurationWriter(const AcceleratorCache& rContainer,
const css::uno::Reference< css::xml::sax::XDocumentHandler >& xConfig ) const css::uno::Reference< css::xml::sax::XDocumentHandler >& xConfig )
: ThreadHelpBase(&Application::GetSolarMutex()) : m_xConfig (xConfig )
, m_xConfig (xConfig )
, m_rContainer (rContainer ) , m_rContainer (rContainer )
{ {
} }
...@@ -52,15 +50,8 @@ AcceleratorConfigurationWriter::~AcceleratorConfigurationWriter() ...@@ -52,15 +50,8 @@ AcceleratorConfigurationWriter::~AcceleratorConfigurationWriter()
void AcceleratorConfigurationWriter::flush() 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); css::uno::Reference< css::xml::sax::XExtendedDocumentHandler > xExtendedCFG(m_xConfig, css::uno::UNO_QUERY_THROW);
aReadLock.unlock();
// <- SAFE ----------------------------------
// prepare attribute list // prepare attribute list
::comphelper::AttributeList* pAttribs = new ::comphelper::AttributeList; ::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); 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() ...@@ -69,13 +60,13 @@ void AcceleratorConfigurationWriter::flush()
pAttribs->AddAttribute(AL_XMLNS_XLINK, ATTRIBUTE_TYPE_CDATA, NS_XMLNS_XLINK); pAttribs->AddAttribute(AL_XMLNS_XLINK, ATTRIBUTE_TYPE_CDATA, NS_XMLNS_XLINK);
// generate xml // generate xml
xCFG->startDocument(); xExtendedCFG->startDocument();
xExtendedCFG->unknown(DOCTYPE_ACCELERATORS); xExtendedCFG->unknown(DOCTYPE_ACCELERATORS);
xCFG->ignorableWhitespace(OUString()); xExtendedCFG->ignorableWhitespace(OUString());
xCFG->startElement(AL_ELEMENT_ACCELERATORLIST, xAttribs); xExtendedCFG->startElement(AL_ELEMENT_ACCELERATORLIST, xAttribs);
xCFG->ignorableWhitespace(OUString()); xExtendedCFG->ignorableWhitespace(OUString());
// TODO think about threadsafe using of cache // TODO think about threadsafe using of cache
AcceleratorCache::TKeyList lKeys = m_rContainer.getAllKeys(); AcceleratorCache::TKeyList lKeys = m_rContainer.getAllKeys();
...@@ -86,7 +77,7 @@ void AcceleratorConfigurationWriter::flush() ...@@ -86,7 +77,7 @@ void AcceleratorConfigurationWriter::flush()
{ {
const css::awt::KeyEvent& rKey = *pKey; const css::awt::KeyEvent& rKey = *pKey;
const OUString& rCommand = m_rContainer.getCommandByKey(rKey); const OUString& rCommand = m_rContainer.getCommandByKey(rKey);
impl_ts_writeKeyCommandPair(rKey, rCommand, xCFG); impl_ts_writeKeyCommandPair(rKey, rCommand, xExtendedCFG);
} }
/* TODO write key-command list /* TODO write key-command list
...@@ -95,10 +86,10 @@ void AcceleratorConfigurationWriter::flush() ...@@ -95,10 +86,10 @@ void AcceleratorConfigurationWriter::flush()
WriteAcceleratorItem( *p ); WriteAcceleratorItem( *p );
*/ */
xCFG->ignorableWhitespace(OUString()); xExtendedCFG->ignorableWhitespace(OUString());
xCFG->endElement(AL_ELEMENT_ACCELERATORLIST); xExtendedCFG->endElement(AL_ELEMENT_ACCELERATORLIST);
xCFG->ignorableWhitespace(OUString()); xExtendedCFG->ignorableWhitespace(OUString());
xCFG->endDocument(); xExtendedCFG->endDocument();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment