/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
ScDocShellRef aDragShellRef; if (bAnyOle)
{
aDragShellRef = new ScDocShell; // DocShell needs a Ref immediately
aDragShellRef->DoInitNew();
}
ScDrawLayer::SetGlobalDrawPersist( aDragShellRef.get() );
std::unique_ptr<SdrModel> pModel(CreateMarkedObjModel());
ScDrawLayer::SetGlobalDrawPersist(nullptr);
// Charts now always copy their data in addition to the source reference, so // there's no need to call SchDLL::Update for the charts in the clipboard doc. // Update with the data (including NumberFormatter) from the live document would // also store the NumberFormatter in the clipboard chart (#88749#)
ScDocShell& rDocSh = rViewData.GetDocShell();
TransferableObjectDescriptor aObjDesc;
rDocSh.FillTransferableObjectDescriptor( aObjDesc );
aObjDesc.maDisplayName = rDocSh.GetMedium()->GetURLObject().GetURLNoPass(); // maSize is set in ScDrawTransferObj ctor
rtl::Reference<ScDrawTransferObj> pTransferObj = new ScDrawTransferObj( std::move(pModel), rDocSh, std::move(aObjDesc) );
pTransferObj->SetDrawPersist(aDragShellRef); // keep persist for ole objects alive
pTransferObj->SetDragSource( this ); // copies selection
// update ScGlobal::xDrawClipDocShellRef
ScDrawLayer::SetGlobalDrawPersist( ScTransferObj::SetDrawClipDoc( bAnyOle ) ); if (ScGlobal::xDrawClipDocShellRef.is() && !aRanges.empty())
{ // Copy data referenced by the chart objects to the draw clip // document. We need to do this before CreateMarkedObjModel() below.
ScDocShellRef xDocSh = ScGlobal::xDrawClipDocShellRef;
ScDocument& rClipDoc = xDocSh->GetDocument();
copyChartRefDataToClipDoc(rDoc, rClipDoc, aRanges);
}
std::unique_ptr<SdrModel> pModel(CreateMarkedObjModel());
ScDrawLayer::SetGlobalDrawPersist(nullptr);
// Charts now always copy their data in addition to the source reference, so // there's no need to call SchDLL::Update for the charts in the clipboard doc. // Update with the data (including NumberFormatter) from the live document would // also store the NumberFormatter in the clipboard chart (#88749#)
ScDocShell& rDocSh = rViewData.GetDocShell();
TransferableObjectDescriptor aObjDesc;
rDocSh.FillTransferableObjectDescriptor( aObjDesc );
aObjDesc.maDisplayName = rDocSh.GetMedium()->GetURLObject().GetURLNoPass(); // maSize is set in ScDrawTransferObj ctor
// Charts now always copy their data in addition to the source reference, so // there's no need to call SchDLL::Update for the charts in the clipboard doc. // Update with the data (including NumberFormatter) from the live document would // also store the NumberFormatter in the clipboard chart (#88749#) // lcl_RefreshChartData( pModel, rViewData.GetDocument() );
ScDocShell& rDocSh = rViewData.GetDocShell();
TransferableObjectDescriptor aObjDesc;
rDocSh.FillTransferableObjectDescriptor( aObjDesc );
aObjDesc.maDisplayName = rDocSh.GetMedium()->GetURLObject().GetURLNoPass(); // maSize is set in ScDrawTransferObj ctor
rtl::Reference<ScDrawTransferObj> pTransferObj = new ScDrawTransferObj( std::move(pModel), rDocSh, std::move(aObjDesc) );
if ( ScGlobal::xDrawClipDocShellRef.is() )
{
pTransferObj->SetDrawPersist( ScGlobal::xDrawClipDocShellRef ); // keep persist for ole objects alive
}
return pTransferObj;
}
// Calculate correction for 100%, regardless of current settings
ScAnchorType aAnchorType = ScDrawLayer::GetAnchorType(*pObj); if (aAnchorType != SCA_CELL && aAnchorType != SCA_CELL_RESIZE)
{
SAL_WARN("sc.ui", "Fit to cell only works with cell anchored graphics!"); return;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.