summaryrefslogtreecommitdiff
path: root/io
diff options
context:
space:
mode:
Diffstat (limited to 'io')
-rw-r--r--io/source/stm/odata.cxx75
-rw-r--r--io/source/stm/opump.cxx22
-rw-r--r--io/source/stm/streamhelper.cxx29
3 files changed, 63 insertions, 63 deletions
diff --git a/io/source/stm/odata.cxx b/io/source/stm/odata.cxx
index 6ffd12c89387..3e802b2d37a5 100644
--- a/io/source/stm/odata.cxx
+++ b/io/source/stm/odata.cxx
@@ -907,30 +907,29 @@ void OObjectOutputStream::writeObject( const Reference< XPersistObject > & xPObj
void OObjectOutputStream::connectToMarkable()
{
- if( ! m_bValidMarkable ) {
- if( ! m_bValidStream )
+ if( m_bValidMarkable )
+ return;
+
+ if( ! m_bValidStream )
+ throw NotConnectedException();
+
+ // find the markable stream !
+ Reference< XInterface > rTry(m_output);
+ while( true ) {
+ if( ! rTry.is() )
{
throw NotConnectedException();
}
-
- // find the markable stream !
- Reference< XInterface > rTry(m_output);
- while( true ) {
- if( ! rTry.is() )
- {
- throw NotConnectedException();
- }
- Reference < XMarkableStream > markable( rTry , UNO_QUERY );
- if( markable.is() )
- {
- m_rMarkable = markable;
- break;
- }
- Reference < XActiveDataSource > source( rTry , UNO_QUERY );
- rTry = source;
+ Reference < XMarkableStream > markable( rTry , UNO_QUERY );
+ if( markable.is() )
+ {
+ m_rMarkable = markable;
+ break;
}
- m_bValidMarkable = true;
+ Reference < XActiveDataSource > source( rTry , UNO_QUERY );
+ rTry = source;
}
+ m_bValidMarkable = true;
}
@@ -1180,30 +1179,30 @@ Reference< XPersistObject > OObjectInputStream::readObject()
void OObjectInputStream::connectToMarkable()
{
- if( ! m_bValidMarkable ) {
- if( ! m_bValidStream )
+ if( m_bValidMarkable ) return;
+
+ if( ! m_bValidStream )
+ {
+ throw NotConnectedException( );
+ }
+
+ // find the markable stream !
+ Reference< XInterface > rTry(m_input);
+ while( true ) {
+ if( ! rTry.is() )
{
throw NotConnectedException( );
}
-
- // find the markable stream !
- Reference< XInterface > rTry(m_input);
- while( true ) {
- if( ! rTry.is() )
- {
- throw NotConnectedException( );
- }
- Reference< XMarkableStream > markable( rTry , UNO_QUERY );
- if( markable.is() )
- {
- m_rMarkable = markable;
- break;
- }
- Reference < XActiveDataSink > sink( rTry , UNO_QUERY );
- rTry = sink;
+ Reference< XMarkableStream > markable( rTry , UNO_QUERY );
+ if( markable.is() )
+ {
+ m_rMarkable = markable;
+ break;
}
- m_bValidMarkable = true;
+ Reference < XActiveDataSink > sink( rTry , UNO_QUERY );
+ rTry = sink;
}
+ m_bValidMarkable = true;
}
sal_Int32 OObjectInputStream::createMark()
diff --git a/io/source/stm/opump.cxx b/io/source/stm/opump.cxx
index 29f09bdd3e81..cba66d3c50fc 100644
--- a/io/source/stm/opump.cxx
+++ b/io/source/stm/opump.cxx
@@ -146,19 +146,19 @@ void Pump::fireClose()
}
}
- if( bFire )
+ if( !bFire )
+ return;
+
+ OInterfaceIteratorHelper iter( m_cnt );
+ while( iter.hasMoreElements() )
{
- OInterfaceIteratorHelper iter( m_cnt );
- while( iter.hasMoreElements() )
+ try
{
- try
- {
- static_cast< XStreamListener * > ( iter.next() )->closed( );
- }
- catch ( const RuntimeException & )
- {
- TOOLS_WARN_EXCEPTION("io.streams","com.sun.star.comp.stoc.Pump: unexpected exception during calling listeners");
- }
+ static_cast< XStreamListener * > ( iter.next() )->closed( );
+ }
+ catch ( const RuntimeException & )
+ {
+ TOOLS_WARN_EXCEPTION("io.streams","com.sun.star.comp.stoc.Pump: unexpected exception during calling listeners");
}
}
}
diff --git a/io/source/stm/streamhelper.cxx b/io/source/stm/streamhelper.cxx
index 2eace1e70d4c..4a2df5891be1 100644
--- a/io/source/stm/streamhelper.cxx
+++ b/io/source/stm/streamhelper.cxx
@@ -68,21 +68,22 @@ void MemRingBuffer::resizeBuffer( sal_Int32 nMinSize )
nNewLen = m_nBufferLen;
}
- if( nNewLen != m_nBufferLen ) {
- if (auto p = static_cast<sal_Int8*>(std::realloc(m_p, nNewLen)))
- m_p = p;
- else
- {
- throw css::io::BufferSizeExceededException(
- "MemRingBuffer::resizeBuffer BufferSizeExceededException");
- }
-
- if( m_nStart + m_nOccupiedBuffer > m_nBufferLen ) {
- memmove( &( m_p[m_nStart+(nNewLen-m_nBufferLen)]) , &(m_p[m_nStart]) , m_nBufferLen - m_nStart );
- m_nStart += nNewLen - m_nBufferLen;
- }
- m_nBufferLen = nNewLen;
+ if( nNewLen == m_nBufferLen )
+ return;
+
+ auto p = static_cast<sal_Int8*>(std::realloc(m_p, nNewLen));
+ if (!p)
+ throw css::io::BufferSizeExceededException(
+ "MemRingBuffer::resizeBuffer BufferSizeExceededException");
+
+ m_p = p;
+
+
+ if( m_nStart + m_nOccupiedBuffer > m_nBufferLen ) {
+ memmove( &( m_p[m_nStart+(nNewLen-m_nBufferLen)]) , &(m_p[m_nStart]) , m_nBufferLen - m_nStart );
+ m_nStart += nNewLen - m_nBufferLen;
}
+ m_nBufferLen = nNewLen;
}