20#include <com/sun/star/beans/XPropertySet.hpp>
21#include <com/sun/star/beans/XPropertySetInfo.hpp>
22#include <com/sun/star/form/FormButtonType.hpp>
28#include <osl/diagnose.h>
36#include <drawview.hxx>
49 const uno::Reference<awt::XControlModel>& xControlModel = pUnoCtrl->
GetUnoControlModel();
50 OSL_ENSURE( xControlModel.is(),
"uno control without model" );
51 if ( xControlModel.is() )
53 uno::Reference< beans::XPropertySet > xPropSet( xControlModel, uno::UNO_QUERY );
54 uno::Reference< beans::XPropertySetInfo > xInfo = xPropSet->getPropertySetInfo();
56 OUString sPropButtonType(
"ButtonType" );
57 if(xInfo->hasPropertyByName( sPropButtonType ))
59 uno::Any aAny = xPropSet->getPropertyValue( sPropButtonType );
60 form::FormButtonType eTmp;
61 if ( (aAny >>= eTmp) && eTmp == form::FormButtonType_URL )
88 if ( nMarkCount == 1 )
93 if ( nSdrObjKind == SdrObjKind::Graphic )
95 if (
static_cast<SdrGrafObj*
>(pObj)->GetGraphic().GetType() == GraphicType::Bitmap )
100 else if ( nSdrObjKind == SdrObjKind::OLE2 )
162 OSL_ENSURE( !
pView,
"ScSelectionTransferObj dtor: ForgetView not called" );
184 AddFormat( SotClipboardFormatId::EMBED_SOURCE );
185 AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR );
186 AddFormat( SotClipboardFormatId::GDIMETAFILE );
188 AddFormat( SotClipboardFormatId::BITMAP );
193 AddFormat( SotClipboardFormatId::STRING );
194 AddFormat( SotClipboardFormatId::STRING_TSVC );
196 AddFormat( SotClipboardFormatId::RICHTEXT );
199 AddFormat( SotClipboardFormatId::EDITENGINE_ODF_TEXT_FLAT );
206 AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR );
209 AddFormat( SotClipboardFormatId::BITMAP );
210 AddFormat( SotClipboardFormatId::GDIMETAFILE );
214 AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR );
216 AddFormat( SotClipboardFormatId::GDIMETAFILE );
218 AddFormat( SotClipboardFormatId::BITMAP );
222 AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR );
224 AddFormat( SotClipboardFormatId::STRING );
225 AddFormat( SotClipboardFormatId::UNIFORMRESOURCELOCATOR );
226 AddFormat( SotClipboardFormatId::NETSCAPE_BOOKMARK );
227 AddFormat( SotClipboardFormatId::DRAWING );
231 AddFormat( SotClipboardFormatId::EMBED_SOURCE );
232 AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR );
233 AddFormat( SotClipboardFormatId::GDIMETAFILE );
238 AddFormat( SotClipboardFormatId::EMBED_SOURCE );
239 AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR );
240 AddFormat( SotClipboardFormatId::DRAWING );
242 AddFormat( SotClipboardFormatId::BITMAP );
243 AddFormat( SotClipboardFormatId::GDIMETAFILE );
255 OSL_ENSURE( !
mxCellData.is(),
"CreateCellData twice" );
272 aDragShellRef->DoInitNew();
280 bool bCopied = rViewData.
GetView()->
CopyToClip( pClipDoc.get(),
false,
true,
true,
false );
297 pTransferObj->SetDrawPersist( aPersistRef );
299 pTransferObj->SetDragSource( pDocSh, aNewMark );
305 OSL_ENSURE(
mxCellData.is(),
"can't create CellData" );
310 OSL_ENSURE( !
mxDrawData.is(),
"CreateDrawData twice" );
318 bool bAnyOle, bOneOle;
326 aDragShellRef->DoInitNew();
344 pTransferObj->SetDrawPersist( aPersistRef );
345 pTransferObj->SetDragSource( pDrawView );
350 OSL_ENSURE(
mxDrawData.is(),
"can't create DrawData" );
370 const css::datatransfer::DataFlavor& rFlavor,
const OUString& rDestDoc )
374 uno::Reference<datatransfer::XTransferable> xSource;
virtual std::unique_ptr< SdrModel > CreateMarkedObjModel() const override
OUString GetURLNoPass(DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
const ScDocument & GetDocument() const
bool HasOLEObjectsInArea(const ScRange &rRange, const ScMarkData *pTabMark=nullptr)
static void SetGlobalDrawPersist(SfxObjectShell *pPersist)
static void CheckOle(const SdrMarkList &rMarkList, bool &rAnyOle, bool &rOneOle)
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
const ScRange & GetMarkArea() const
bool IsMultiMarked() const
void SetSelectionTransfer(ScSelectionTransferObj *pNew)
ScSelectionTransferObj * GetSelectionTransfer() const
virtual void AddSupportedFormats() override
ScDrawTransferObj * GetDrawData()
ScSelectionTransferObj(ScTabView *pSource, ScSelectionTransferMode eNewMode)
ScTransferObj * GetCellData()
virtual bool GetData(const css::datatransfer::DataFlavor &rFlavor, const OUString &rDestDoc) override
ScSelectionTransferMode eMode
rtl::Reference< ScDrawTransferObj > mxDrawData
virtual ~ScSelectionTransferObj() override
virtual sal_Bool SAL_CALL isComplex() override
rtl::Reference< ScTransferObj > mxCellData
virtual void ObjectReleased() override
static rtl::Reference< ScSelectionTransferObj > CreateFromView(ScTabView *pSource)
ScViewData & GetViewData()
ScDrawView * GetScDrawView()
ScMarkData & GetMarkData()
ScDocShell * GetDocShell() const
ScMarkType GetSimpleArea(SCCOL &rStartCol, SCROW &rStartRow, SCTAB &rStartTab, SCCOL &rEndCol, SCROW &rEndRow, SCTAB &rEndTab) const
ScDBFunc * GetView() const
SC_DLLPUBLIC bool CopyToClip(ScDocument *pClipDoc, bool bCut, bool bApi=false, bool bIncludeObjects=false, bool bStopEdit=true)
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
const SdrMarkList & GetMarkedObjectList() const
SdrObject * GetMarkedSdrObj() const
virtual SdrInventor GetObjInventor() const
virtual SdrObjKind GetObjIdentifier() const
const css::uno::Reference< css::awt::XControlModel > & GetUnoControlModel() const
const INetURLObject & GetURLObject() const
void FillTransferableObjectDescriptor(TransferableObjectDescriptor &rDesc) const
SfxMedium * GetMedium() const
bool SetAny(const css::uno::Any &rAny)
void AddFormat(SotClipboardFormatId nFormat)
virtual void ObjectReleased()
std::unique_ptr< ScDocument, o3tl::default_delete< ScDocument > > ScDocumentUniquePtr
EmbeddedObjectRef * pObject
static bool lcl_IsURLButton(SdrObject *pObject)
@ SC_SELTRANS_DRAW_BOOKMARK
@ SC_SELTRANS_DRAW_BITMAP
@ SC_SELTRANS_DRAW_GRAPHIC
ScMarkType
States GetSimpleArea() returns for the underlying selection marks, so the caller can react if the res...
@ SC_MARK_SIMPLE_FILTERED