diff options
author | Pranav Kant <pranav913@gmail.com> | 2015-03-17 12:56:54 +0530 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-03-20 12:18:02 +0000 |
commit | 33de587e95dddfc8e3c89b84f90b3d1bca823dae (patch) | |
tree | c65ada218c27ae4f2e80b4e3476b67c8e4554ef8 /basctl | |
parent | 9e2e9453cbca9399e1c670b354cfc3c23d70307f (diff) |
tdf#88230: cleanup solar mutex yielding
Use SolarMutexReleaser, instead.
Change-Id: I276459c42b688813ea168d6fc80466a07a5ecba4
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/basicide/baside2.cxx | 11 | ||||
-rw-r--r-- | basctl/source/dlged/dlged.cxx | 18 |
2 files changed, 17 insertions, 12 deletions
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx index eb9ef96c4326..81d0f34efe81 100644 --- a/basctl/source/basicide/baside2.cxx +++ b/basctl/source/basicide/baside2.cxx @@ -1405,10 +1405,13 @@ bool ModulWindow::IsPasteAllowed() Reference< datatransfer::clipboard::XClipboard > xClipboard = GetClipboard(); if ( xClipboard.is() ) { - // get clipboard content - const sal_uInt32 nRef = Application::ReleaseSolarMutex(); - Reference< datatransfer::XTransferable > xTransf = xClipboard->getContents(); - Application::AcquireSolarMutex( nRef ); + + Reference< datatransfer::XTransferable > xTransf; + { + SolarMutexReleaser aReleaser; + // get clipboard content + xTransf = xClipboard->getContents(); + } if ( xTransf.is() ) { datatransfer::DataFlavor aFlavor; diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx index 2847f58cdc5d..62109c3cc310 100644 --- a/basctl/source/dlged/dlged.cxx +++ b/basctl/source/dlged/dlged.cxx @@ -811,9 +811,8 @@ void DlgEditor::Copy() aSeqData[0] = aDialogModelBytesAny; pTrans = new DlgEdTransferableImpl( m_ClipboardDataFlavors , aSeqData ); } - const sal_uInt32 nRef = Application::ReleaseSolarMutex(); + SolarMutexReleaser aReleaser; xClipboard->setContents( pTrans , pTrans ); - Application::AcquireSolarMutex( nRef ); } } @@ -830,10 +829,13 @@ void DlgEditor::Paste() Reference< datatransfer::clipboard::XClipboard > xClipboard = GetWindow().GetClipboard(); if ( xClipboard.is() ) { - // get clipboard content - const sal_uInt32 nRef = Application::ReleaseSolarMutex(); - Reference< datatransfer::XTransferable > xTransf = xClipboard->getContents(); - Application::AcquireSolarMutex( nRef ); + Reference< datatransfer::XTransferable > xTransf; + + { + SolarMutexReleaser aReleaser; + // get clipboard content + xTransf = xClipboard->getContents(); + } if ( xTransf.is() ) { // Is target dialog (library) localized? @@ -1061,9 +1063,9 @@ bool DlgEditor::IsPasteAllowed() if ( xClipboard.is() ) { // get clipboard content - const sal_uInt32 nRef = Application::ReleaseSolarMutex(); + SolarMutexReleaser aReleaser; Reference< datatransfer::XTransferable > xTransf = xClipboard->getContents(); - Application::AcquireSolarMutex( nRef ); + return xTransf.is() && xTransf->isDataFlavorSupported( m_ClipboardDataFlavors[0] ); } return false; |