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

Some oslCondition -> osl::Condition

Change-Id: I57c10b14cd8a5ab821516575768891b66f834ca6
üst 2861d5be
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include <sax/tools/documenthandleradapter.hxx> #include <sax/tools/documenthandleradapter.hxx>
#include <osl/time.h> #include <osl/time.h>
#include <osl/conditn.h> #include <osl/conditn.hxx>
#include <rtl/strbuf.hxx> #include <rtl/strbuf.hxx>
#include <tools/urlobj.hxx> #include <tools/urlobj.hxx>
...@@ -110,7 +110,7 @@ namespace XSLT ...@@ -110,7 +110,7 @@ namespace XSLT
css::uno::Reference<xslt::XXSLTTransformer> m_tcontrol; css::uno::Reference<xslt::XXSLTTransformer> m_tcontrol;
oslCondition m_cTransformed; osl::Condition m_cTransformed;
bool m_bTerminated; bool m_bTerminated;
bool m_bError; bool m_bError;
...@@ -128,8 +128,6 @@ namespace XSLT ...@@ -128,8 +128,6 @@ namespace XSLT
// ctor... // ctor...
XSLTFilter(const css::uno::Reference<XComponentContext> &r); XSLTFilter(const css::uno::Reference<XComponentContext> &r);
virtual ~XSLTFilter();
// XStreamListener // XStreamListener
virtual void SAL_CALL virtual void SAL_CALL
error(const Any& a) throw (RuntimeException, std::exception) SAL_OVERRIDE; error(const Any& a) throw (RuntimeException, std::exception) SAL_OVERRIDE;
...@@ -162,14 +160,7 @@ namespace XSLT ...@@ -162,14 +160,7 @@ namespace XSLT
XSLTFilter::XSLTFilter(const css::uno::Reference<XComponentContext> &r): XSLTFilter::XSLTFilter(const css::uno::Reference<XComponentContext> &r):
m_xContext(r), m_bTerminated(false), m_bError(false) m_xContext(r), m_bTerminated(false), m_bError(false)
{ {}
m_cTransformed = osl_createCondition();
}
XSLTFilter::~XSLTFilter()
{
osl_destroyCondition(m_cTransformed);
}
void void
XSLTFilter::disposing(const EventObject&) throw (RuntimeException, std::exception) XSLTFilter::disposing(const EventObject&) throw (RuntimeException, std::exception)
...@@ -233,7 +224,7 @@ namespace XSLT ...@@ -233,7 +224,7 @@ namespace XSLT
void void
XSLTFilter::started() throw (RuntimeException, std::exception) XSLTFilter::started() throw (RuntimeException, std::exception)
{ {
osl_resetCondition(m_cTransformed); m_cTransformed.reset();
} }
void void
XSLTFilter::error(const Any& a) throw (RuntimeException, std::exception) XSLTFilter::error(const Any& a) throw (RuntimeException, std::exception)
...@@ -244,18 +235,18 @@ namespace XSLT ...@@ -244,18 +235,18 @@ namespace XSLT
SAL_WARN("filter.xslt", "XSLTFilter::error was called: " << e.Message); SAL_WARN("filter.xslt", "XSLTFilter::error was called: " << e.Message);
} }
m_bError = true; m_bError = true;
osl_setCondition(m_cTransformed); m_cTransformed.set();
} }
void void
XSLTFilter::closed() throw (RuntimeException, std::exception) XSLTFilter::closed() throw (RuntimeException, std::exception)
{ {
osl_setCondition(m_cTransformed); m_cTransformed.set();
} }
void void
XSLTFilter::terminated() throw (RuntimeException, std::exception) XSLTFilter::terminated() throw (RuntimeException, std::exception)
{ {
m_bTerminated = true; m_bTerminated = true;
osl_setCondition(m_cTransformed); m_cTransformed.set();
} }
OUString OUString
...@@ -370,8 +361,8 @@ namespace XSLT ...@@ -370,8 +361,8 @@ namespace XSLT
// transform // transform
m_tcontrol->start(); m_tcontrol->start();
TimeValue timeout = { TRANSFORMATION_TIMEOUT_SEC, 0}; TimeValue timeout = { TRANSFORMATION_TIMEOUT_SEC, 0};
oslConditionResult result(osl_waitCondition(m_cTransformed, &timeout)); osl::Condition::Result result(m_cTransformed.wait(&timeout));
while (osl_cond_result_timeout == result) { while (osl::Condition::result_timeout == result) {
if (xInterActionHandler.is()) { if (xInterActionHandler.is()) {
Sequence<Any> excArgs(0); Sequence<Any> excArgs(0);
::com::sun::star::ucb::InteractiveAugmentedIOException exc( ::com::sun::star::ucb::InteractiveAugmentedIOException exc(
...@@ -391,10 +382,10 @@ namespace XSLT ...@@ -391,10 +382,10 @@ namespace XSLT
xInterActionHandler->handle(xRequest); xInterActionHandler->handle(xRequest);
if (pAbort->wasSelected()) { if (pAbort->wasSelected()) {
m_bError = true; m_bError = true;
osl_setCondition(m_cTransformed); m_cTransformed.set();
} }
} }
result = osl_waitCondition(m_cTransformed, &timeout); result = m_cTransformed.wait(&timeout);
}; };
if (!m_bError) { if (!m_bError) {
xSaxParser->parseStream(aInput); xSaxParser->parseStream(aInput);
...@@ -528,7 +519,7 @@ namespace XSLT ...@@ -528,7 +519,7 @@ namespace XSLT
{ {
ExtendedDocumentHandlerAdapter::endDocument(); ExtendedDocumentHandlerAdapter::endDocument();
// wait for the transformer to finish // wait for the transformer to finish
osl_waitCondition(m_cTransformed, 0); m_cTransformed.wait();
m_tcontrol->terminate(); m_tcontrol->terminate();
if (!m_bError && !m_bTerminated) if (!m_bError && !m_bTerminated)
{ {
......
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