Kaydet (Commit) 48524222 authored tarafından Caolán McNamara's avatar Caolán McNamara

split closeOutput up

Change-Id: Id6408fa804e1049ceab012ec0220d8e6f8d8e555
üst 65753b97
......@@ -199,12 +199,9 @@ void SAL_CALL OSequenceOutputStream::flush( )
m_rSequence.realloc(m_nSize);
}
void SAL_CALL OSequenceOutputStream::closeOutput( )
void OSequenceOutputStream::finalizeOutput()
{
MutexGuard aGuard(m_aMutex);
if (!m_bConnected)
throw NotConnectedException();
// cut the sequence to the real size
m_rSequence.realloc(m_nSize);
......@@ -212,6 +209,15 @@ void SAL_CALL OSequenceOutputStream::closeOutput( )
m_bConnected = false;
}
void SAL_CALL OSequenceOutputStream::closeOutput()
{
MutexGuard aGuard(m_aMutex);
if (!m_bConnected)
throw NotConnectedException();
finalizeOutput();
}
} // namespace comphelper
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -71,6 +71,8 @@ class SAL_DLLPUBLIC_TEMPLATE OSequenceOutputStream_Base
class COMPHELPER_DLLPUBLIC OSequenceOutputStream : public OSequenceOutputStream_Base
{
private:
void finalizeOutput();
protected:
css::uno::Sequence< sal_Int8 >& m_rSequence;
double m_nResizeFactor;
......@@ -85,7 +87,7 @@ protected:
::osl::Mutex m_aMutex;
protected:
virtual ~OSequenceOutputStream() override { if (m_bConnected) closeOutput(); }
virtual ~OSequenceOutputStream() override { if (m_bConnected) finalizeOutput(); }
public:
/** constructs the object. Everything written into the stream through the XOutputStream methods will be forwarded
......
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