Kaydet (Commit) c11ee0f7 authored tarafından Jan-Marek Glogowski's avatar Jan-Marek Glogowski

tdf#120387 get lock to use ImpEditView::CutCopy

ImpEditView::CutCopy releases the SolarMutex to handle clipboard
access. So lock the SolarMutex when accessing this function
through OutlinerView::Copy().

Now all paths effectively need the SolarMutex, so remove all the
intermediate locking. I guess the explicit release for the
xTransferable.is() test isn't needed.

Change-Id: Ib2a69a520bbf0ef7ba4ccb893c6489b292207f2a
Reviewed-on: https://gerrit.libreoffice.org/61580
Tested-by: Jenkins
Reviewed-by: 's avatarJan-Marek Glogowski <glogow@fbihome.de>
üst 3c3bc96a
......@@ -496,47 +496,32 @@ void ChartController::impl_PasteStringAsTextShape( const OUString& rString, cons
void ChartController::executeDispatch_Copy()
{
if ( m_pDrawViewWrapper )
SolarMutexGuard aSolarGuard;
if (!m_pDrawViewWrapper)
return;
OutlinerView* pOutlinerView = m_pDrawViewWrapper->GetTextEditOutlinerView();
if (pOutlinerView)
pOutlinerView->Copy();
else
{
OutlinerView* pOutlinerView = m_pDrawViewWrapper->GetTextEditOutlinerView();
if ( pOutlinerView )
{
pOutlinerView->Copy();
}
else
SdrObject* pSelectedObj = nullptr;
ObjectIdentifier aSelOID(m_aSelection.getSelectedOID());
if (aSelOID.isAutoGeneratedObject())
pSelectedObj = m_pDrawModelWrapper->getNamedSdrObject( aSelOID.getObjectCID() );
else if (aSelOID.isAdditionalShape())
pSelectedObj = DrawViewWrapper::getSdrObject( aSelOID.getAdditionalShape() );
if (pSelectedObj)
{
Reference< datatransfer::XTransferable > xTransferable;
Reference<datatransfer::clipboard::XClipboard> xClipboard(GetChartWindow()->GetClipboard());
if (xClipboard.is())
{
SolarMutexGuard aSolarGuard;
if ( m_pDrawModelWrapper )
{
SdrObject* pSelectedObj = nullptr;
ObjectIdentifier aSelOID( m_aSelection.getSelectedOID() );
if ( aSelOID.isAutoGeneratedObject() )
{
pSelectedObj = m_pDrawModelWrapper->getNamedSdrObject( aSelOID.getObjectCID() );
}
else if ( aSelOID.isAdditionalShape() )
{
pSelectedObj = DrawViewWrapper::getSdrObject( aSelOID.getAdditionalShape() );
}
if ( pSelectedObj )
{
xTransferable.set( new ChartTransferable(
m_pDrawModelWrapper->getSdrModel(),
pSelectedObj,
aSelOID.isAdditionalShape() ) );
}
}
}
if ( xTransferable.is() )
{
SolarMutexGuard aSolarGuard;
Reference<datatransfer::clipboard::XClipboard> xClipboard(GetChartWindow()->GetClipboard());
if ( xClipboard.is() )
{
xClipboard->setContents( xTransferable, Reference< datatransfer::clipboard::XClipboardOwner >() );
}
Reference< datatransfer::XTransferable > xTransferable(
new ChartTransferable(m_pDrawModelWrapper->getSdrModel(),
pSelectedObj, aSelOID.isAdditionalShape()));
xClipboard->setContents(xTransferable, Reference< datatransfer::clipboard::XClipboardOwner >());
}
}
}
......
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