diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-27 10:34:56 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-27 10:16:08 +0000 |
commit | c19d2b276b7a28c07315cf60cb0965098a935e5f (patch) | |
tree | cf3d2548bf3ed784b709bd74ec96eb071b167417 /svl/source/misc | |
parent | e641c1740f36ce11c9f178193f74a53ac7af8465 (diff) |
loplugin:expandablemethods in stoc..svl
Change-Id: I7dd701ef07a14f70589b87154bfeeda7530b628f
Reviewed-on: https://gerrit.libreoffice.org/30316
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl/source/misc')
-rw-r--r-- | svl/source/misc/sharecontrolfile.cxx | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/svl/source/misc/sharecontrolfile.cxx b/svl/source/misc/sharecontrolfile.cxx index ca95115e3ca6..205c4e2b2b26 100644 --- a/svl/source/misc/sharecontrolfile.cxx +++ b/svl/source/misc/sharecontrolfile.cxx @@ -54,28 +54,6 @@ namespace svt { ShareControlFile::ShareControlFile( const OUString& aOrigURL ) : LockFileCommon( aOrigURL, OUString( ".~sharing." ) ) { - OpenStream(); - - if ( !IsValid() ) - throw io::NotConnectedException(); -} - - -ShareControlFile::~ShareControlFile() -{ - try - { - Close(); - } - catch( uno::Exception& ) - {} -} - - -void ShareControlFile::OpenStream() -{ - // if it is called outside of constructor the mutex must be locked already - if ( !m_xStream.is() && !m_aURL.isEmpty() ) { uno::Reference< ucb::XCommandEnvironment > xDummyEnv; @@ -125,8 +103,20 @@ void ShareControlFile::OpenStream() m_xTruncate.set( m_xOutputStream, uno::UNO_QUERY_THROW ); m_xStream = xStream; } + + if ( !IsValid() ) + throw io::NotConnectedException(); } +ShareControlFile::~ShareControlFile() +{ + try + { + Close(); + } + catch( uno::Exception& ) + {} +} void ShareControlFile::Close() { |