20#include <config_features.h>
22#include <com/sun/star/embed/XTransactedObject.hpp>
23#include <com/sun/star/embed/Aspects.hpp>
24#include <com/sun/star/embed/XEmbedObjectClipboardCreator.hpp>
25#include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
26#include <com/sun/star/embed/MSOLEObjectSystemCreator.hpp>
27#include <com/sun/star/text/XPasteListener.hpp>
43#include <osl/endian.h>
73#include <osl/file.hxx>
105#include <viewopt.hxx>
108#include <strings.hrc>
135#include <osl/diagnose.h>
157using namespace ::
svx;
163void collectUIInformation(
const OUString& rAction,
const OUString& aParameters)
166 aDescription.
aAction = rAction;
167 aDescription.
aParameters = {{
"parameters", aParameters}};
168 aDescription.
aID =
"writer_edit";
169 aDescription.
aKeyWord =
"SwEditWinUIObject";
170 aDescription.
aParent =
"MainWindow";
185 bool m_bDelBookmark : 1;
186 bool m_bInDisconnect : 1;
193 virtual ~SwTransferDdeLink()
override;
198 virtual ::sfx2::SvBaseLink::UpdateResult
DataChanged(
199 const OUString& rMimeType,
const css::uno::Any & rValue )
override;
200 virtual void Closed()
override;
228class SwTrnsfrActionAndUndo
242 pContext->remember();
246 ~SwTrnsfrActionAndUndo() COVERITY_NOEXCEPT_FALSE
256 : m_pWrtShell( &rSh ),
257 m_pCreatorView( nullptr ),
258 m_pOrigGraphic( nullptr ),
360 uno::Reference < embed::XEmbeddedObject > xObj;
367 xObj =
static_cast<SwOLENode*
>(pNd)->GetOLEObj().GetOleRef();
368 nAspect =
static_cast<SwOLENode*
>(pNd)->GetAspect();
383 return static_cast<SwOLENode*
>(pNd)->GetGraphic();
414 rSrcWrtShell.
Copy(rDest);
419 void lclCheckAndPerformRotation(
Graphic& aGraphic)
422 if ( !aMetadata.
read(aGraphic) )
429 aTransform.rotate( aRotation );
436 sal_Int32 nTextLength = 0;
460 nTextLength += pTextNode->
GetText().getLength();
461 if (nTextLength >= 1024 * 512)
539 aContentAtPos.
sStr );
552 else if( !rURL.
GetURL().isEmpty() )
563 sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT;
564 uno::Reference < embed::XEmbeddedObject > xObj =
FindOLEObj( nAspect );
577 if ( nFormat == SotClipboardFormatId::GDIMETAFILE )
588 case SotClipboardFormatId::LINK:
593 case SotClipboardFormatId::OBJECTDESCRIPTOR:
594 case SotClipboardFormatId::LINKSRCDESCRIPTOR:
598 case SotClipboardFormatId::DRAWING:
606 case SotClipboardFormatId::STRING:
612 case SotClipboardFormatId::RTF:
618 case SotClipboardFormatId::RICHTEXT:
625 case SotClipboardFormatId::HTML:
632 case SotClipboardFormatId::SVXB:
637 case SotClipboardFormatId::GDIMETAFILE:
641 case SotClipboardFormatId::BITMAP:
642 case SotClipboardFormatId::PNG:
648 case SotClipboardFormatId::SVIM:
653 case SotClipboardFormatId::INET_IMAGE:
658 case SotClipboardFormatId::SOLK:
659 case SotClipboardFormatId::NETSCAPE_BOOKMARK:
660 case SotClipboardFormatId::FILEGRPDESCRIPTOR:
661 case SotClipboardFormatId::FILECONTENT:
662 case SotClipboardFormatId::UNIFORMRESOURCELOCATOR:
663 case SotClipboardFormatId::SIMPLE_FILE:
668 case SotClipboardFormatId::EMBED_SOURCE:
673 SfxObjectCreateMode::EMBEDDED );
688 void* pObject, sal_uInt32 nObjectType,
694 switch( nObjectType )
700 xStream->SetBufferSize( 16348 );
743 uno::Reference< embed::XStorage > xWorkStore =
749 SfxMedium aMedium( xWorkStore, OUString() );
753 uno::Reference< embed::XTransactedObject > xTransact( xWorkStore, uno::UNO_QUERY );
754 if ( xTransact.is() )
757 xStream->SetBufferSize( 0xff00 );
758 xStream->WriteStream( *pTempStream );
760 xWorkStore->dispose();
763 catch (
const uno::Exception&)
773 xStream->SetBufferSize( 1024 );
774 SwTransferDdeLink* pDdeLnk =
static_cast<SwTransferDdeLink*
>(
pObject);
775 if( pDdeLnk->WriteData( *
xStream ) )
800 xWrt->SetAsciiOptions( aAOpt );
803 xWrt->m_bUCS2_WithStartChar =
false;
812 xWrt->m_bWriteClipboardDoc =
true;
814 xWrt->SetShowProgress(
false);
816#if defined(DEBUGPASTE)
818 "PASTEBUFFER.debug"), StreamMode::WRITE|StreamMode::TRUNC);
819 SwWriter aDbgWrt( aPasteDebug, *pDoc );
820 aDbgWrt.
Write( xWrt );
836 int nRet =
Copy(
true );
839 collectUIInformation(
"CUT",
"parameter");
876 std::vector< ::sw::mark::IMark* > vDdeMarks;
884 vDdeMarks.push_back(*ppMark);
888 for (
const auto& rpMark : vDdeMarks)
896 std::optional<SwWait> oWait;
908 assert(&rSrc == &rPaM.
GetDoc());
923 SwPosition aPos(aIdx, pContentNode, pContentNode ? pContentNode->
Len() : 0);
941 AddFormat( SotClipboardFormatId::EMBED_SOURCE );
943#if HAVE_FEATURE_DESKTOP
944 AddFormat( SotClipboardFormatId::RICHTEXT );
947 AddFormat( SotClipboardFormatId::STRING );
977#if HAVE_FEATURE_DESKTOP
983 AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR );
989#if HAVE_FEATURE_DESKTOP
990 AddFormat( SotClipboardFormatId::GDIMETAFILE );
991 AddFormat( SotClipboardFormatId::BITMAP );
1005 AddFormat( SotClipboardFormatId::EMBED_SOURCE );
1014#if HAVE_FEATURE_DESKTOP
1015 AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR );
1016 AddFormat( SotClipboardFormatId::GDIMETAFILE );
1019 sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT;
1020 uno::Reference < embed::XEmbeddedObject > xObj =
FindOLEObj( nAspect );
1029 for(
const auto& rItem : aVector )
1040 std::optional<SwWait> oWait;
1087#if HAVE_FEATURE_DESKTOP
1089 AddFormat( SotClipboardFormatId::EMBED_SOURCE );
1096#if HAVE_FEATURE_DESKTOP
1097 AddFormat( SotClipboardFormatId::RICHTEXT );
1098 AddFormat( SotClipboardFormatId::HTML );
1102 AddFormat( SotClipboardFormatId::STRING );
1106 AddFormat( SotClipboardFormatId::DRAWING );
1109#if HAVE_FEATURE_DESKTOP
1110 AddFormat( SotClipboardFormatId::GDIMETAFILE );
1111 AddFormat( SotClipboardFormatId::BITMAP );
1129 AddFormat( SotClipboardFormatId::STRING );
1130#if HAVE_FEATURE_DESKTOP
1131 AddFormat( SotClipboardFormatId::SOLK );
1132 AddFormat( SotClipboardFormatId::NETSCAPE_BOOKMARK );
1133 AddFormat( SotClipboardFormatId::FILECONTENT );
1134 AddFormat( SotClipboardFormatId::FILEGRPDESCRIPTOR );
1136 AddFormat( SotClipboardFormatId::UNIFORMRESOURCELOCATOR );
1144 if( !bIsCut && bDDELink &&
1148#if HAVE_FEATURE_DESKTOP
1149 AddFormat( SotClipboardFormatId::LINK );
1160#if HAVE_FEATURE_DESKTOP
1161 AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR );
1175 AddFormat( SotClipboardFormatId::SVIM );
1177 else if( !rURL.
GetURL().isEmpty() )
1181 AddFormat( SotClipboardFormatId::INET_IMAGE );
1200 collectUIInformation(
"COPY",
"parameter");
1218 AddFormat( SotClipboardFormatId::STRING );
1235 SwPaM aPam( *pCNd );
1250 AddFormat( SotClipboardFormatId::EMBED_SOURCE );
1252 AddFormat( SotClipboardFormatId::RICHTEXT );
1253 AddFormat( SotClipboardFormatId::HTML );
1254 AddFormat( SotClipboardFormatId::STRING );
1262 AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR );
1275 : m_rWrtShell(rWrtShell)
1304 beans::PropertyValue aPropertyValue;
1314 aPropertyValue.Name =
"TextGraphicObject";
1315 aPropertyValue.Value
1345 aPropertyValue.Name =
"TextRange";
1348 aPropertyValue.Value <<= uno::Reference<text::XTextRange>(xTextRange);
1353 if (aPropertyValue.Name.isEmpty())
1357 uno::Sequence<beans::PropertyValue>
aEvent{ aPropertyValue };
1360 catch (
const uno::Exception& rException)
1363 "SwPasteContext::~SwPasteContext: uncaught exception: " << rException.Message);
1383 sal_uInt16 nSourceOptions =
1384 (( SotExchangeDest::DOC_TEXTFRAME == nDestination ||
1385 SotExchangeDest::SWDOC_FREE_AREA == nDestination ||
1386 SotExchangeDest::DOC_TEXTFRAME_WEB == nDestination ||
1387 SotExchangeDest::SWDOC_FREE_AREA_WEB == nDestination )
1398 nFormat, nEventAction, SotClipboardFormatId::NONE,
1411 if (nFormat != SotClipboardFormatId::RICHTEXT)
1416 if (!rData.
HasFormat(SotClipboardFormatId::EMBED_SOURCE))
1421 if (!rData.
HasFormat(SotClipboardFormatId::OBJECTDESCRIPTOR))
1440 nFormat = SotClipboardFormatId::EMBED_SOURCE;
1448 while ( nIdx-- > 0 && sText[nIdx] ==
'\t' )
1463 bool bSingleCellTable =
false;
1471 sal_uInt16 nSourceOptions =
1472 (( SotExchangeDest::DOC_TEXTFRAME == nDestination ||
1473 SotExchangeDest::SWDOC_FREE_AREA == nDestination ||
1474 SotExchangeDest::DOC_TEXTFRAME_WEB == nDestination ||
1475 SotExchangeDest::SWDOC_FREE_AREA_WEB == nDestination )
1485 nFormat, nEventAction, SotClipboardFormatId::NONE,
1491 if (rData.
HasFormat(SotClipboardFormatId::HTML_SIMPLE) && rData.
HasFormat(SotClipboardFormatId::HTML_NO_COMMENT)
1492 && rData.
HasFormat(SotClipboardFormatId::BITMAP) && nFormat == SotClipboardFormatId::FILE_LIST)
1493 nFormat = SotClipboardFormatId::BITMAP;
1500 rData.
HasFormat( SotClipboardFormatId::SYLK_BIGCAPS ) ) )
1504 if( rData.
GetString( SotClipboardFormatId::STRING, aExpand ))
1507 const sal_Int32 nRows = nNewlines ? nNewlines-1 : 0;
1512 bSingleCellTable =
true;
1517 if (!bSingleCellTable && rData.
HasFormat( SotClipboardFormatId::HTML ) &&
1521 sal_uInt32 nLevel = 0;
1532 OUString sPreviousTableName;
1538 if ( sTableName == sPreviousTableName )
1540 sPreviousTableName = sTableName;
1542 pDispatch->
Execute(FN_INSERT_NNBSP, SfxCallMode::SYNCHRON);
1552 nDestination,
false,
false,
nullptr, 0,
false, nAnchorType, bIgnoreComments, &aPasteContext, ePasteTable) )
1554 bool bFoundTemporaryTable =
false;
1558 bFoundTemporaryTable =
true;
1560 pDispatch->
Execute(SID_COPY, SfxCallMode::SYNCHRON);
1562 for(sal_uInt32
a = 0;
a < 1 + (nLevel * 2);
a++)
1563 pDispatch->
Execute(SID_UNDO, SfxCallMode::SYNCHRON);
1566 if (!bFoundTemporaryTable)
1575 pDispatch->
Execute(SID_PASTE, SfxCallMode::SYNCHRON);
1578 for(sal_uInt32
a = 0;
a < (nLevel * 2);
a++)
1579 pDispatch->
Execute(SID_UNDO, SfxCallMode::SYNCHRON);
1585 rData.
HasFormat( SotClipboardFormatId::HTML ) &&
1591 if( rData.
GetString( SotClipboardFormatId::HTML, aExpand ) && (nIdx = aExpand.indexOf(
"<table")) > -1 )
1601 bool bShifted =
lcl_getLevel(aExpand, aExpand.indexOf(
"<thead")) == nTableLevel + 1;
1603 sal_Int32 nSelectedRowsOrCols = 0;
1604 const OUString sSearchRowOrCol = bRowMode ? OUString(
"</tr>") : OUString(
"<col ");
1605 while((nIdx = aExpand.indexOf(sSearchRowOrCol, nIdx)) > -1)
1608 if (
lcl_getLevel(aExpand, nIdx) == nTableLevel + (bShifted ? 2 : 1) &&
1610 !aExpand.match(
"<tr></tr>", nIdx - 4) )
1612 ++nSelectedRowsOrCols;
1617 bool bStartTableBoxNode =
1625 if (!bStartTableBoxNode)
1642 pDispatch->
Execute(nDispatchSlot, SfxCallMode::SYNCHRON);
1646 if ( nSelectedRowsOrCols > 1 )
1648 SfxInt16Item aCountItem( nDispatchSlot, nSelectedRowsOrCols-1 );
1651 SfxCallMode::SYNCHRON|SfxCallMode::RECORD,
1652 { &aCountItem, &aAfter });
1660 nDestination,
false,
false,
nullptr, 0,
false, nAnchorType, bIgnoreComments, &aPasteContext );
1670 if (pMark !=
nullptr)
1683 if( rData.
HasFormat( SotClipboardFormatId::RTF ) )
1686 nFormat = SotClipboardFormatId::RTF;
1688 else if( rData.
HasFormat( SotClipboardFormatId::RICHTEXT ) )
1691 nFormat = SotClipboardFormatId::RICHTEXT;
1699 collectUIInformation(
"PASTE",
"parameter");
1703 nDestination,
false,
false,
nullptr, 0,
false, nAnchorType, bIgnoreComments, &aPasteContext, ePasteTable);
1712 bool bPasteSelection,
RndStdIds nAnchorType,
1713 bool bIgnoreComments,
1718 std::unique_ptr<SwTrnsfrActionAndUndo, o3tl::default_delete<SwTrnsfrActionAndUndo>> pAction;
1722 bool bCallAutoCaption =
false;
1731 nDestination == SotExchangeDest::SWDOC_FREE_AREA &&
1732 nFormat == SotClipboardFormatId::SONLK))
1734 switch( nDestination )
1736 case SotExchangeDest::DOC_LNKD_GRAPH_W_IMAP:
1737 case SotExchangeDest::DOC_LNKD_GRAPHOBJ:
1738 case SotExchangeDest::DOC_GRAPH_W_IMAP:
1739 case SotExchangeDest::DOC_GRAPHOBJ:
1740 case SotExchangeDest::DOC_OLEOBJ:
1741 case SotExchangeDest::DOC_DRAWOBJ:
1742 case SotExchangeDest::DOC_URLBUTTON:
1743 case SotExchangeDest::DOC_GROUPOBJ:
1764 bool bDelSel =
false;
1765 switch( nDestination )
1767 case SotExchangeDest::DOC_TEXTFRAME:
1768 case SotExchangeDest::SWDOC_FREE_AREA:
1769 case SotExchangeDest::DOC_TEXTFRAME_WEB:
1770 case SotExchangeDest::SWDOC_FREE_AREA_WEB:
1779 pAction.reset(
new SwTrnsfrActionAndUndo(&rSh,
true, pContext));
1785 bool bPrivateDrop(pPt);
1788 if (bPasteSelection)
1792 bPrivateDrop =
nullptr != pTrans;
1794 bool bNeedToSelectBeforePaste(
false);
1799 bPrivateDrop =
false;
1800 bNeedToSelectBeforePaste =
true;
1811 bPrivateDrop =
false;
1812 bNeedToSelectBeforePaste =
true;
1822 else if( !pPt && pTunneledTrans &&
1826 bRet = pTunneledTrans->PrivatePaste(rSh, pContext, ePasteTable);
1832 pAction.reset(
new SwTrnsfrActionAndUndo( &rSh ));
1836 bool bMsg =
nullptr == pPt;
1843 OSL_ENSURE( pPt,
"EXCHG_OUT_ACTION_INSERT_PRIVATE: what should happen here?" );
1847 OSL_ENSURE( pPt,
"EXCHG_OUT_ACTION_MOVE_PRIVATE: what should happen here?" );
1861 case SotClipboardFormatId::DRAWING:
1864 nActionFlags, bNeedToSelectBeforePaste);
1867 case SotClipboardFormatId::HTML:
1868 case SotClipboardFormatId::HTML_SIMPLE:
1869 case SotClipboardFormatId::HTML_NO_COMMENT:
1870 case SotClipboardFormatId::RTF:
1871 case SotClipboardFormatId::RICHTEXT:
1872 case SotClipboardFormatId::STRING:
1874 nFormat, bMsg, bIgnoreComments );
1877 case SotClipboardFormatId::NETSCAPE_BOOKMARK:
1889 case SotClipboardFormatId::SD_OLE:
1891 nActionFlags, bMsg );
1894 case SotClipboardFormatId::SVIM:
1898 case SotClipboardFormatId::SVXB:
1899 case SotClipboardFormatId::BITMAP:
1900 case SotClipboardFormatId::PNG:
1901 case SotClipboardFormatId::GDIMETAFILE:
1904 nActionFlags, nDropAction, bNeedToSelectBeforePaste);
1907 case SotClipboardFormatId::XFORMS:
1908 case SotClipboardFormatId::SBA_FIELDDATAEXCHANGE:
1909 case SotClipboardFormatId::SBA_DATAEXCHANGE:
1910 case SotClipboardFormatId::SBA_CTRLDATAEXCHANGE:
1916 case SotClipboardFormatId::SIMPLE_FILE:
1923 pPt, nActionFlags,
nullptr );
1926 case SotClipboardFormatId::FILE_LIST:
1933 case SotClipboardFormatId::SONLK:
1954 case SotClipboardFormatId::INET_IMAGE:
1955 case SotClipboardFormatId::NETSCAPE_IMAGE:
1962 OSL_ENSURE( pPt,
"unknown format" );
1968 bool graphicInserted;
1973 if( graphicInserted )
1974 bCallAutoCaption =
true;
1980 nActionFlags,bMsg );
1992 OUString sURL, sDesc;
1993 if( SotClipboardFormatId::SIMPLE_FILE == nFormat )
1995 if( rData.
GetString( nFormat, sURL ) && !sURL.isEmpty() )
1998 if( sDesc.isEmpty() )
2025 case SotClipboardFormatId::DRAWING:
2028 nActionFlags, bNeedToSelectBeforePaste);
2030 case SotClipboardFormatId::SVXB:
2031 case SotClipboardFormatId::GDIMETAFILE:
2032 case SotClipboardFormatId::BITMAP:
2033 case SotClipboardFormatId::PNG:
2034 case SotClipboardFormatId::NETSCAPE_BOOKMARK:
2035 case SotClipboardFormatId::SIMPLE_FILE:
2036 case SotClipboardFormatId::FILEGRPDESCRIPTOR:
2037 case SotClipboardFormatId::UNIFORMRESOURCELOCATOR:
2040 nActionFlags, nDropAction, bNeedToSelectBeforePaste);
2043 OSL_FAIL(
"unknown format" );
2051 nActionFlags, bNeedToSelectBeforePaste);
2059 nActionFlags, nDropAction, bNeedToSelectBeforePaste, nAnchorType );
2065 nActionFlags, bNeedToSelectBeforePaste);
2074 nActionFlags, nDropAction, bNeedToSelectBeforePaste);
2082 OSL_FAIL(
"unknown action" );
2094 if( bCallAutoCaption )
2114 bLink = !aDummy.isEmpty();
2116 if( bLink && bIMap )
2117 nRet = SotExchangeDest::DOC_LNKD_GRAPH_W_IMAP;
2119 nRet = SotExchangeDest::DOC_LNKD_GRAPHOBJ;
2121 nRet = SotExchangeDest::DOC_GRAPH_W_IMAP;
2123 nRet = SotExchangeDest::DOC_GRAPHOBJ;
2129 nRet = SotExchangeDest::DOC_TEXTFRAME_WEB;
2131 nRet = SotExchangeDest::DOC_TEXTFRAME;
2133 case OBJCNT_OLE: nRet = SotExchangeDest::DOC_OLEOBJ;
break;
2136 case OBJCNT_SIMPLE: nRet = SotExchangeDest::DOC_DRAWOBJ;
break;
2144 nRet = SotExchangeDest::SWDOC_FREE_AREA_WEB;
2146 nRet = SotExchangeDest::SWDOC_FREE_AREA;
2167 case SotClipboardFormatId::STRING:
2176 pStream->
SetEndian( SvStreamEndian::BIG );
2178 pStream->
SetEndian( SvStreamEndian::LITTLE );
2192 if( ( SotClipboardFormatId::HTML_SIMPLE == nFormat ) ||
2193 ( SotClipboardFormatId::HTML_NO_COMMENT == nFormat ) )
2195 pStream = aMSE40ClpObj.
IsValid( *xStrm );
2200 ( nFormat == SotClipboardFormatId::HTML_NO_COMMENT );
2205 pStream = xStrm.
get();
2206 if( SotClipboardFormatId::RTF == nFormat || SotClipboardFormatId::RICHTEXT == nFormat)
2218 if( pStream && pRead )
2227 if (bIgnoreComments)
2231 pResId = STR_ERROR_CLPBRD_READ;
2243 pResId = STR_CLPBRD_FORMAT_ERROR;
2246 if( pStream && !xStrm.
is() )
2252 VclMessageType::Info, VclButtonsType::Ok,
2264 uno::Reference < io::XInputStream > xStrm;
2265 uno::Reference < embed::XStorage > xStore;
2270 if( rData.
HasFormat( SotClipboardFormatId::EMBEDDED_OBJ ) )
2271 nId = SotClipboardFormatId::EMBEDDED_OBJ;
2272 else if( rData.
HasFormat( SotClipboardFormatId::EMBED_SOURCE ) &&
2273 rData.
HasFormat( SotClipboardFormatId::OBJECTDESCRIPTOR ))
2274 nId = SotClipboardFormatId::EMBED_SOURCE;
2276 nId = SotClipboardFormatId::NONE;
2278 if (
nId != SotClipboardFormatId::NONE)
2293 case SotClipboardFormatId::STARWRITER_60:
2294 case SotClipboardFormatId::STARWRITERWEB_60:
2295 case SotClipboardFormatId::STARWRITERGLOB_60:
2296 case SotClipboardFormatId::STARWRITER_8:
2297 case SotClipboardFormatId::STARWRITERWEB_8:
2298 case SotClipboardFormatId::STARWRITERGLOB_8:
2307 catch (
const uno::Exception&)
2314 catch (
const uno::Exception&)
2323 SwReader aReader(xStore, OUString(), rPAM);
2329 VclMessageType::Info, VclButtonsType::Ok,
2330 SwResId(STR_ERROR_CLPBRD_READ)));
2337 uno::Reference< embed::XStorage > xTmpStor;
2338 uno::Reference < embed::XEmbeddedObject > xObj;
2346 OSL_ENSURE( !xStrm.is(),
"An object without descriptor in clipboard!");
2353 xStrm = rData.
GetInputStream(SotClipboardFormatId::EMBED_SOURCE_OLE, OUString());
2355 xStrm = rData.
GetInputStream(SotClipboardFormatId::EMBEDDED_OBJ_OLE, OUString());
2363 uno::Reference < embed::XEmbedObjectClipboardCreator > xClipboardCreator =
2364 embed::MSOLEObjectSystemCreator::create( ::comphelper::getProcessComponentContext() );
2366 embed::InsertedObjectInfo aInfo = xClipboardCreator->createInstanceInitFromClipboard(
2369 uno::Sequence< beans::PropertyValue >() );
2373 xObj = aInfo.Object;
2375 catch (
const uno::Exception&)
2380 else if (rData.
HasFormat(SotClipboardFormatId::SIMPLE_FILE))
2383 if (rData.
GetString(nFormat, sFile) && !sFile.isEmpty())
2394 if ( xStrm.is() && !xObj.is() )
2407 if (rData.
GetGDIMetaFile(SotClipboardFormatId::GDIMETAFILE, aMetafile, 100000))
2409 nGrFormat = SotClipboardFormatId::GDIMETAFILE;
2410 aGraphic = aMetafile;
2414 if ( nGrFormat != SotClipboardFormatId::NONE )
2416 DataFlavor aDataFlavor;
2418 xObjRef.
SetGraphic( aGraphic, aDataFlavor.MimeType );
2420 else if ( aObjDesc.
mnViewAspect == embed::Aspects::MSOLE_ICON )
2425 MapMode aMapMode( MapUnit::Map100thMM );
2434 if ( aObjDesc.
mnViewAspect == embed::Aspects::MSOLE_ICON )
2440 MapMode aMapMode( MapUnit::Map100thMM );
2441 aSize = xObjRef.
GetSize( &aMapMode );
2452 aSz = xObj->getVisualAreaSize( aObjDesc.
mnViewAspect );
2454 catch (
const embed::NoVisualAreaSizeException&)
2459 if ( aSz.Width != aSize.
Width() || aSz.Height != aSize.
Height() )
2461 aSz.Width = aSize.
Width();
2462 aSz.Height = aSize.
Height();
2475 catch (
const uno::Exception&)
2484 if( bRet && ( nActionFlags & SotExchangeActionFlags::InsertTargetUrl) )
2496 const Point* pPt,
bool bInsertGRF )
2500 if( ( rData.
HasFormat( SotClipboardFormatId::INET_IMAGE ) &&
2501 rData.
GetINetImage( SotClipboardFormatId::INET_IMAGE, aINetImg )) ||
2502 ( rData.
HasFormat( SotClipboardFormatId::NETSCAPE_IMAGE ) &&
2503 rData.
GetINetImage( SotClipboardFormatId::NETSCAPE_IMAGE, aINetImg )) )
2505 if( !aINetImg.
GetImageURL().isEmpty() && bInsertGRF )
2518 lclCheckAndPerformRotation(aGraphic);
2535 rSh.
ReRead(sURL, OUString(), &aGraphic);
2540 rSh.
Paste( aGraphic, OUString() );
2542 rSh.
ReRead(sURL, OUString(), &aGraphic);
2607 rSh.SwCursorShell::SetCursor( *pPt,
true );
2616 OUString aApp, aTopic, aItem;
2622 OSL_ENSURE(
false,
"DDE Data not found." );
2626 rtl_TextEncoding eEncoding = osl_getThreadTextEncoding();
2637 if( !rData.
HasFormat( SotClipboardFormatId::RTF ) &&
2638 !rData.
HasFormat( SotClipboardFormatId::RICHTEXT ) &&
2639 !rData.
HasFormat( SotClipboardFormatId::HTML ) &&
2640 !rData.
HasFormat( SotClipboardFormatId::STRING ) &&
2641 (rData.
HasFormat( nFormat = SotClipboardFormatId::GDIMETAFILE ) ||
2642 rData.
HasFormat( nFormat = SotClipboardFormatId::BITMAP )) )
2645 bool bRet = rData.
GetGraphic( nFormat, aGrf );
2648 OUString sLnkTyp(
"DDE");
2650 rWrtShell.
ReRead( aCmd, sLnkTyp, &aGrf );
2661 bool bDoublePaste =
false;
2666 aName = aApp + OUString::number(
i );
2676 bDoublePaste =
true;
2687 while( !bDoublePaste );
2698 if( rData.
GetString( SotClipboardFormatId::STRING, aExpand ))
2704 if( !aExpand.isEmpty() &&
2705 ( rData.
HasFormat( SotClipboardFormatId::SYLK ) ||
2706 rData.
HasFormat( SotClipboardFormatId::SYLK_BIGCAPS ) ) )
2708 sal_Int32 nRows = nNewlines ? nNewlines-1 : 0;
2709 if (!aExpand.endsWith(
"\n"))
2719 VclMessageType::Info, VclButtonsType::Ok,
2720 SwResId(STR_TABLE_TOO_LARGE)));
2728 if( !nRows || !nCols )
2733 VclMessageType::Info, VclButtonsType::Ok,
2743 pDDETyp, nRows, nCols );
2745 else if( nNewlines > 1 )
2770 if( !pDDETyp && !bDoublePaste )
2794 if(bNeedToSelectBeforePaste && pPt)
2801 rSh.
Paste( *xStrm, nAction, pPt );
2804 if( bRet && ( nActionFlags & SotExchangeActionFlags::InsertTargetUrl ))
2818 bool bCheckForGrf =
false, bCheckForImageMap =
false;
2822 case SotClipboardFormatId::BITMAP:
2823 case SotClipboardFormatId::PNG:
2824 case SotClipboardFormatId::GDIMETAFILE:
2825 bRet = rData.
GetGraphic( nFormat, aGraphic );
2828 case SotClipboardFormatId::SVXB:
2836 bRet = (GraphicType::NONE != aGraphic.
GetType() && GraphicType::Default != aGraphic.
GetType());
2842 case SotClipboardFormatId::NETSCAPE_BOOKMARK:
2843 case SotClipboardFormatId::FILEGRPDESCRIPTOR:
2844 case SotClipboardFormatId::UNIFORMRESOURCELOCATOR:
2849 nFormat = SotClipboardFormatId::NETSCAPE_BOOKMARK;
2851 bCheckForGrf =
true;
2855 case SotClipboardFormatId::SIMPLE_FILE:
2858 bRet = rData.
GetString( nFormat, sText );
2876 if (sText.startsWithIgnoreAsciiCase(
"file:"))
2880 osl::FileBase::getSystemPathFromFileURL(sText, sSysPath);
2882 DWORD nCopied = GetLongPathNameW(o3tl::toW(sSysPath.getStr()),
2883 o3tl::toW(
aBuf.get()), 32767);
2884 if (nCopied && nCopied < 32767)
2891 bCheckForGrf =
true;
2898 bRet = rData.
GetGraphic( nFormat, aGraphic );
2910 SotClipboardFormatId::SIMPLE_FILE == nFormat &&
2915 nFormat = SotClipboardFormatId::NETSCAPE_BOOKMARK;
2920 if(pPt && bNeedToSelectBeforePaste)
2932 lclCheckAndPerformRotation(aGraphic);
2947 rSh.
InsertGraphic(sURL, OUString(), aGraphic,
nullptr, nAnchorType);
2959 rSh.
Paste( aGraphic, sURL );
2968 rSh.
ReRead(sURL, OUString(), &aGraphic);
2976 if( SotClipboardFormatId::NETSCAPE_BOOKMARK == nFormat )
2991 rSh.
Paste( aGraphic, sURL );
2996 rSh.
ReRead(sURL, OUString(), &aGraphic);
3017 ( SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::ReplaceImageMap ) )
3020 if( nActionFlags & SotExchangeActionFlags::InsertTargetUrl )
3023 else if( bCheckForImageMap )
3028 StreamMode::STD_READ );
3030 if( pStream !=
nullptr &&
3034 aMap.GetIMapObjectCount() )
3053 if( rData.
HasFormat( SotClipboardFormatId::SVIM ))
3062 if( rData.
GetImageMap( SotClipboardFormatId::SVIM, aImageMap ) &&
3063 ( !pOld || aImageMap != *pOld ))
3065 aURL.SetMap( &aImageMap );
3079 if( rData.
GetString( nFormat, sFile ) && !sFile.isEmpty() )
3086 aURL.SetSmartProtocol( INetProtocol::File );
3087 aURL.SetSmartURL( sFile );
3099 aURL2.
SetURL( sFile,
false );
3100 if( aURL2.
GetName().isEmpty() )
3110 sDesc.isEmpty() ? sFile : sDesc);
3122 bool * graphicInserted)
3125 pPt, nActionFlags, 0,
false);
3126 if (graphicInserted !=
nullptr) {
3127 *graphicInserted = bRet;
3131 OUString sFile, sDesc;
3132 if( rData.
GetString( nFormat, sFile ) && !sFile.isEmpty() )
3134#if HAVE_FEATURE_AVMEDIA
3142 const SfxStringItem aMediaURLItem( SID_INSERT_AVMEDIA, aMediaURLStr );
3144 SID_INSERT_AVMEDIA, SfxCallMode::SYNCHRON,
3145 { &aMediaURLItem });
3175 PasteOLE(rData, rSh, nFormat, nActionFlags,
nullptr == pPt);
3184 aURL.SetSmartProtocol( INetProtocol::File );
3185 aURL.SetSmartURL( sFile );
3197 aURL2.
SetURL( sFile,
false );
3198 if( aURL2.
GetName().isEmpty() )
3208 sDesc.isEmpty() ? sFile : sDesc );
3221 const Point* pDragPt,
bool bMsg )
3225 if( rData.
GetString( nFormat, sText ) && !sText.isEmpty() )
3227 sal_uInt16 nWh = SotClipboardFormatId::SBA_CTRLDATAEXCHANGE == nFormat
3229 : SotClipboardFormatId::SBA_DATAEXCHANGE == nFormat
3237 bool bHaveColumnDescriptor = OColumnTransferable::canExtractColumnDescriptor(rVector, ColumnTransferFormatFlags::COLUMN_DESCRIPTOR | ColumnTransferFormatFlags::CONTROL_EXCHANGE);
3238 if ( SotClipboardFormatId::XFORMS == nFormat )
3242 if (pFmView && pDragPt)
3244 OXFormsDescriptor aDesc = OXFormsTransferable::extractDescriptor(rData);
3248 rSh.SwFEShell::InsertDrawObj( *pObj, *pDragPt );
3254 std::unique_ptr<SfxUnoAnyItem> pConnectionItem;
3255 std::unique_ptr<SfxUnoAnyItem> pCursorItem;
3256 std::unique_ptr<SfxUnoAnyItem> pColumnItem;
3257 std::unique_ptr<SfxUnoAnyItem> pSourceItem;
3258 std::unique_ptr<SfxUnoAnyItem> pCommandItem;
3259 std::unique_ptr<SfxUnoAnyItem> pCommandTypeItem;
3260 std::unique_ptr<SfxUnoAnyItem> pColumnNameItem;
3261 std::unique_ptr<SfxUnoAnyItem> pSelectionItem;
3263 bool bDataAvailable =
true;
3264 ODataAccessDescriptor aDesc;
3265 if(bHaveColumnDescriptor)
3266 aDesc = OColumnTransferable::extractColumnDescriptor(rData);
3267 else if(ODataAccessObjectTransferable::canExtractObjectDescriptor(rVector) )
3268 aDesc = ODataAccessObjectTransferable::extractObjectDescriptor(rData);
3270 bDataAvailable =
false;
3272 if ( bDataAvailable )
3290 nWh, SfxCallMode::ASYNCHRON,
3291 { &aDataDesc, pConnectionItem.get(), pColumnItem.get(),
3292 pSourceItem.get(), pCommandItem.get(), pCommandTypeItem.get(),
3293 pColumnNameItem.get(), pSelectionItem.get(),
3294 pCursorItem.get() });
3300 if (pFmView && bHaveColumnDescriptor && pDragPt)
3304 rSh.SwFEShell::InsertDrawObj( *pObj, *pDragPt );
3312 VclMessageType::Info, VclButtonsType::Ok,
3313 SwResId(STR_CLPBRD_FORMAT_ERROR)));
3321 const Point* pPt,
bool bMsg )
3325 if( rData.
GetFileList( SotClipboardFormatId::FILE_LIST, aFileList ) &&
3334 pHlp->CopyString( SotClipboardFormatId::SIMPLE_FILE, aFileList.
GetFile(
n ));
3338 pPt, SotExchangeActionFlags::NONE,
nullptr ))
3348 if( !sFlyNm.isEmpty() )
3354 VclMessageType::Info, VclButtonsType::Ok,
3355 SwResId(STR_CLPBRD_FORMAT_ERROR)));
3362 OUString& rFileName, OUString* pTitle )
3364 bool bIsURLFile =
false;
3368 rFileName = aBkmk.
GetURL();
3375 if( rFileName.getLength()>4 && rFileName.endsWithIgnoreAsciiCase(
".url") )
3377 OSL_ENSURE(
false,
"how do we read today .URL - Files?" );
3389 return aClipboardFormatItem.
Count() > 0;
3408 nPrivateFormat = SotClipboardFormatId::EMBED_SOURCE;
3410 if( pClipboard && nPrivateFormat == nFormat )
3417 sal_uInt16 nSourceOptions =
3418 (( SotExchangeDest::DOC_TEXTFRAME == nDestination ||
3419 SotExchangeDest::SWDOC_FREE_AREA == nDestination ||
3420 SotExchangeDest::DOC_TEXTFRAME_WEB == nDestination ||
3421 SotExchangeDest::SWDOC_FREE_AREA_WEB == nDestination )
3430 nFormat, nEventAction, nFormat,
3436 nDestination,
true,
false );
3452 nEventAction, nFormat,
3464 SotClipboardFormatId::HTML,
3465 SotClipboardFormatId::HTML_SIMPLE,
3466 SotClipboardFormatId::HTML_NO_COMMENT,
3467 SotClipboardFormatId::RTF,
3468 SotClipboardFormatId::RICHTEXT,
3469 SotClipboardFormatId::STRING,
3470 SotClipboardFormatId::SONLK,
3471 SotClipboardFormatId::NETSCAPE_BOOKMARK,
3472 SotClipboardFormatId::DRAWING,
3473 SotClipboardFormatId::SVXB,
3474 SotClipboardFormatId::GDIMETAFILE,
3475 SotClipboardFormatId::BITMAP,
3476 SotClipboardFormatId::SVIM,
3477 SotClipboardFormatId::FILEGRPDESCRIPTOR,
3478 SotClipboardFormatId::NONE
3500 pResId = STR_PRIVATETEXT;
3502 pResId = STR_PRIVATEGRAPHIC;
3504 pResId = STR_PRIVATEOLE;
3508 if (STR_PRIVATEOLE == pResId || STR_PRIVATEGRAPHIC == pResId)
3513 aFlavorEx.
mnSotId = SotClipboardFormatId::EMBED_SOURCE;
3514 aFormats.insert( aFormats.begin(), aFlavorEx );
3518 pDlg->Insert( SotClipboardFormatId::EMBED_SOURCE, OUString() );
3523 if( rData.
HasFormat( SotClipboardFormatId::OBJECTDESCRIPTOR ) )
3526 SotClipboardFormatId::OBJECTDESCRIPTOR, aDesc );
3530 pDlg->Insert( SotClipboardFormatId::EMBED_SOURCE, OUString() );
3532 pDlg->Insert( SotClipboardFormatId::LINK_SOURCE, OUString() );
3536 pDlg->Insert( SotClipboardFormatId::LINK,
SwResId(STR_DDEFORMAT) );
3540 pDlg->Insert( *pIds, OUString() );
3554 pResId = STR_PRIVATETEXT;
3556 pResId = STR_PRIVATEGRAPHIC;
3558 pResId = STR_PRIVATEOLE;
3567 if (rData.
HasFormat(SotClipboardFormatId::OBJECTDESCRIPTOR))
3570 SotClipboardFormatId::OBJECTDESCRIPTOR, aDesc);
3580 if ( rData.
HasFormat(nFormat = SotClipboardFormatId::EMBED_SOURCE_OLE) || rData.
HasFormat(nFormat = SotClipboardFormatId::EMBEDDED_OBJ_OLE) )
3582 OUString
sName,sSource;
3604 AddFormat( SotClipboardFormatId::SVXB );
3608 AddFormat( SotClipboardFormatId::GDIMETAFILE );
3610 AddFormat( SotClipboardFormatId::BITMAP );
3617 AddFormat( SotClipboardFormatId::EMBED_SOURCE );
3619 AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR );
3620 AddFormat( SotClipboardFormatId::GDIMETAFILE );
3640 AddFormat( SotClipboardFormatId::EMBED_SOURCE );
3646 AddFormat( SotClipboardFormatId::RICHTEXT );
3647 AddFormat( SotClipboardFormatId::HTML );
3650 AddFormat( SotClipboardFormatId::STRING );
3654 AddFormat( SotClipboardFormatId::DRAWING );
3657 AddFormat( SotClipboardFormatId::GDIMETAFILE );
3659 AddFormat( SotClipboardFormatId::BITMAP );
3668 AddFormat( SotClipboardFormatId::STRING );
3669 AddFormat( SotClipboardFormatId::SOLK );
3670 AddFormat( SotClipboardFormatId::NETSCAPE_BOOKMARK );
3671 AddFormat( SotClipboardFormatId::FILECONTENT );
3672 AddFormat( SotClipboardFormatId::FILEGRPDESCRIPTOR );
3673 AddFormat( SotClipboardFormatId::UNIFORMRESOURCELOCATOR );
3685 AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR );
3695 AddFormat( SotClipboardFormatId::STRING );
3696 AddFormat( SotClipboardFormatId::SOLK );
3697 AddFormat( SotClipboardFormatId::NETSCAPE_BOOKMARK );
3698 AddFormat( SotClipboardFormatId::FILECONTENT );
3699 AddFormat( SotClipboardFormatId::FILEGRPDESCRIPTOR );
3700 AddFormat( SotClipboardFormatId::UNIFORMRESOURCELOCATOR );
3714 AddFormat( SotClipboardFormatId::SVIM );
3716 else if( !rURL.
GetURL().isEmpty() )
3720 AddFormat( SotClipboardFormatId::INET_IMAGE );
3736 SW_MOD()->m_pDragDrop =
this;
3743 nDragOptions &= ~DND_ACTION_MOVE;
3795bool lcl_checkClassification(
SwDoc* pSourceDoc,
SwDoc* pDestinationDoc)
3797 if (!pSourceDoc || !pDestinationDoc)
3802 if (!pSourceShell || !pDestinationShell)
3815 OSL_ENSURE( !rShell.
ActionPend(),
"Paste must never have an ActionPend" );
3821 SwTrnsfrActionAndUndo aAction( &rShell );
3823 bool bKillPaMs =
false;
3846 rShell.SwCursorShell::SetCursor( aPt,
true );
3858 bool bInWrd =
false, bEndWrd =
false, bSttWrd =
false,
3867 bSmart = bInWrd || bEndWrd;
3871 if (!bSttWrd && (bInWrd || bEndWrd))
3872 rShell.SwEditShell::Insert(
' ');
3885 if( bRet && bSmart && ((bInWrd && !bEndWrd )|| bSttWrd) )
3886 rShell.SwEditShell::Insert(
' ');
3892 bool bMove,
bool bIsXSelection )
3895 bool bInWrd =
false;
3896 bool bEndWrd =
false;
3897 bool bSttWrd =
false;
3898 bool bSttPara =
false;
3899 bool bTableSel =
false;
3900 bool bTableMove =
false;
3901 bool bFrameSel =
false;
3988 SAL_WARN(
"sw",
"presumably this case can't arise in practice");
3993 ? *rBoxes.
front()->GetSttNd()
3997 sal_Int32 nSelRowOrCols = 0;
3998 if ( rBoxes.
back() )
4004 auto nLine = rLines.
GetPos( rBoxes.
front()->GetUpper() );
4005 for (
auto pBox : rBoxes)
4008 if ( nLine != rLines.
GetPos( pBox->GetUpper() ) )
4017 nSelRowOrCols = rLines.
GetPos( rBoxes.
back()->GetUpper() ) -
4022 bool bSelUpToDown = rBoxes.
back() && rBoxes.
back()->GetUpper() ==
4032 rSrcSh.
StartUndo( eUndoId, &aRewriter );
4039 pDispatch->
Execute(SID_COPY, SfxCallMode::SYNCHRON);
4043 rSh.SwCursorShell::SetCursor(rDragPt,
false);
4060 if (bNeedTrack && pMark !=
nullptr)
4063 if ( !bNeedTrack && !bPasteIntoTable )
4078 for (sal_Int32 nDeleted = 0; bNeedTrack && nDeleted < nSelRowOrCols;)
4081 if ( !rSh.
Up(
false) )
4106 if (pMarkMoveFrom !=
nullptr)
4115 if ( !bTableCol && bNeedTrack )
4119 for (sal_Int32 nDeleted = 0; nDeleted < nSelRowOrCols;)
4133 bool bMoved =
false;
4135 bMoved = rSh.
Up(
false);
4137 bMoved = rSh.
Down(
false);
4148 for (sal_Int32 nDeleted = 0; nDeleted < nSelRowOrCols; ++nDeleted)
4159 if (pMark !=
nullptr)
4193 rSrcSh.
StartUndo( eUndoId, &aRewriter );
4199 if( &rSrcSh != &rSh )
4202 rSh.SwCursorShell::SetCursor( rDragPt,
true );
4205 else if( !bTableSel && !bFrameSel )
4216 rSh.SwCursorShell::CreateCursor();
4218 rSh.SwCursorShell::SetCursor( rDragPt,
true,
false );
4234 if( &rSrcSh == &rSh )
4237 rSh.SwCursorShell::SetCursor( aSttPt,
true );
4252 rSrcSh.SwCursorShell::SetCursor( aSttPt,
true );
4268 bool bRet = rSrcSh.SwFEShell::Copy(rSh, aSttPt, rDragPt, bMove,
4271 if( !bIsXSelection )
4274 if ( bRet && bMove && !bFrameSel )
4284 rSh.SwCursorShell::DestroyCursor();
4297 if( &rSh == &rSrcSh && ( bTableSel || rSh.
IsBlockMode() ) )
4300 rSrcSh.SwCursorShell::SetCursor(rDragPt);
4305 if( bRet && !bTableSel && !bFrameSel )
4307 if( (bInWrd || bEndWrd) &&
4311 if ( bSttWrd || (bInWrd && !bEndWrd))
4312 rSh.SwEditShell::Insert(
' ', bIsXSelection);
4313 if ( !bSttWrd || (bInWrd && !bSttPara) )
4317 rSh.SwEditShell::Insert(
' ', bIsXSelection);
4324 if( &rSrcSh == &rSh && !rSh.
IsAddMode() )
4326 rSh.SwCursorShell::DestroyCursor();
4332 rSh.SwCursorShell::ClearMark();
4338 rSh.SwCursorShell::CreateCursor();
4347 else if ( bRet && bTableMove )
4353 if( bRet && bMove && bFrameSel )
4376 pNew->m_pCreatorView = _pCreatorView;
4379 pNew->CopyToPrimarySelection();
4400 : m_rTransfer(rTrans)
4401 , m_pDocShell(nullptr)
4403 , m_bDelBookmark(false)
4404 , m_bInDisconnect(false)
4427 m_bDelBookmark =
true;
4441 m_xRefObj = m_pDocShell->DdeCreateLinkSource( m_sName );
4442 if( m_xRefObj.is() )
4444 m_xRefObj->AddConnectAdvise(
this );
4445 m_xRefObj->AddDataAdvise(
this,
4447 ADVISEMODE_NODATA | ADVISEMODE_ONLYONCE );
4448 m_nOldTimeOut = m_xRefObj->GetUpdateTimeout();
4449 m_xRefObj->SetUpdateTimeout( 0 );
4453SwTransferDdeLink::~SwTransferDdeLink()
4455 if( m_xRefObj.is() )
4463 if( !m_bInDisconnect )
4465 if( FindDocShell() && m_pDocShell->GetView() )
4466 m_rTransfer.RemoveDDELinkFormat( m_pDocShell->GetView()->GetEditWin() );
4472bool SwTransferDdeLink::WriteData(
SvStream& rStrm )
4474 if( !m_xRefObj.is() || !FindDocShell() )
4477 rtl_TextEncoding eEncoding = osl_getThreadTextEncoding();
4481 m_pDocShell->GetTitle(SFX_TITLE_FULLNAME), eEncoding));
4484 std::unique_ptr<char[]> pMem(
new char[ aAppNm.getLength() + aTopic.getLength() +
aName.getLength() + 4 ]);
4486 sal_Int32 nLen = aAppNm.getLength();
4487 memcpy( pMem.get(), aAppNm.getStr(), nLen );
4489 memcpy( pMem.get() + nLen, aTopic.getStr(), aTopic.getLength() );
4490 nLen = nLen + aTopic.getLength();
4492 memcpy( pMem.get() + nLen,
aName.getStr(),
aName.getLength() );
4493 nLen = nLen +
aName.getLength();
4519 OUString sMarkName = pMark->
GetName();
4531 ::sw::mark::InsertMode::New);
4535 m_bDelBookmark =
false;
4539void SwTransferDdeLink::Disconnect(
bool bRemoveDataAdvise )
4543 bool bOldDisconnect = m_bInDisconnect;
4544 m_bInDisconnect =
true;
4547 if( m_bDelBookmark && m_xRefObj.is() && FindDocShell() )
4549 SwDoc* pDoc = m_pDocShell->GetDoc();
4566 m_bDelBookmark =
false;
4569 if( m_xRefObj.is() )
4571 m_xRefObj->SetUpdateTimeout( m_nOldTimeOut );
4572 m_xRefObj->RemoveConnectAdvise(
this );
4573 if( bRemoveDataAdvise )
4578 m_xRefObj->RemoveAllDataAdvise(
this );
4581 m_bInDisconnect = bOldDisconnect;
4584bool SwTransferDdeLink::FindDocShell()
4589 if( pTmpSh == m_pDocShell )
4591 if( m_pDocShell->GetDoc() )
4598 m_pDocShell =
nullptr;
4602void SwTransferDdeLink::Closed()
4604 if( !m_bInDisconnect && m_xRefObj.is() )
4606 m_xRefObj->RemoveAllDataAdvise(
this );
4607 m_xRefObj->RemoveConnectAdvise(
this );
@ CheckPosInFly
check if target position is in fly anchored at source range
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
static OUString GetAppName()
OUString GetFile(size_t nIndex) const
static GraphicFilter & GetGraphicFilter()
static ErrCode LoadGraphic(const OUString &rPath, const OUString &rFilter, Graphic &rGraphic, GraphicFilter *pFilter=nullptr, sal_uInt16 *pDeterminedFormat=nullptr)
void SetPrefMapMode(const MapMode &rPrefMapMode)
bool IsSupportedGraphic() const
const GDIMetaFile & GetGDIMetaFile() const
GraphicType GetType() const
BitmapEx GetBitmapEx(const GraphicConversionParameters &rParameters=GraphicConversionParameters()) const
void SetPrefSize(const Size &rPrefSize)
virtual bool CopyRange(SwPaM &rPam, SwPosition &rPos, SwCopyFlags flags) const =0
Copy a selected content range to a position.
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
virtual void LockExpFields()=0
wrapper iterator: wraps iterator of implementation while hiding MarkBase class; only IMark instances ...
Provides access to the marks of a document.
virtual const_iterator_t getAllMarksEnd() const =0
returns a STL-like random access iterator to the end of the sequence of marks.
virtual const_iterator_t findMark(const OUString &rMark) const =0
Finds a mark by name.
virtual ::sw::mark::IMark * makeMark(const SwPaM &rPaM, const OUString &rProposedName, MarkType eMark, ::sw::mark::InsertMode eMode, SwPosition const *pSepPos=nullptr)=0
Generates a new mark in the document for a certain selection.
virtual std::unique_ptr< ILazyDeleter > deleteMark(const IDocumentMarkAccess::const_iterator_t &ppMark, bool isMoveNodes)=0
Deletes a mark.
virtual const_iterator_t getAllMarksBegin() const =0
returns a STL-like random access iterator to the begin of the sequence of marks.
static SW_DLLPUBLIC MarkType GetType(const ::sw::mark::IMark &rMark)
Returns the MarkType used to create the mark.
static bool IsRedlineOn(const RedlineFlags eM)
virtual void SetRedlineFlags_intern(RedlineFlags eMode)=0
Set a new redline mode.
virtual void SetRedlineFlags(RedlineFlags eMode)=0
Set a new redline mode.
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
virtual void ResetModified()=0
virtual bool IsModified() const =0
Changes of document?
const OUString & GetDescription() const
const OUString & GetURL() const
const OUString & GetImageURL() const
const OUString & GetTargetFrame() const
const OUString & GetTargetURL() const
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
bool SetSmartURL(std::u16string_view rTheAbsURIRef, EncodeMechanism eMechanism=EncodeMechanism::WasEncoded, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)
bool Paste(const TransferableDataHelper &rData, const OUString &rsDesc)
RegionMode GetDefaultDragType() const
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
void SetReadUTF8(bool bSet)
void SetIgnoreHTMLComments(bool bSet)
SwgReaderOption & GetReaderOpt()
sal_uInt16 GetMasterPageCount() const
const SfxItemPool & GetItemPool() const
const SdrPage * GetPage(sal_uInt16 nPgNum) const
sal_uInt16 GetPageCount() const
const SfxPoolItem & GetMergedItem(const sal_uInt16 nWhich) const
void SetMergedItem(const SfxPoolItem &rItem)
static bool ShowPasteInfo(SfxClassificationCheckPasteResult eResult)
static SfxClassificationCheckPasteResult CheckPaste(const css::uno::Reference< css::document::XDocumentProperties > &xSource, const css::uno::Reference< css::document::XDocumentProperties > &xDestination)
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
const INetURLObject & GetURLObject() const
comphelper::EmbeddedObjectContainer & GetEmbeddedObjectContainer() const
css::uno::Reference< css::document::XDocumentProperties > getDocProperties() const
void FillTransferableObjectDescriptor(TransferableObjectDescriptor &rDesc) const
virtual bool DoSaveCompleted(SfxMedium *pNewStor=nullptr, bool bRegisterRecent=true)
static OUString CreateShellID(const SfxObjectShell *pShell)
virtual void SetVisArea(const tools::Rectangle &rVisArea)
bool isContentExtractionLocked() const
static SAL_WARN_UNUSED_RESULT SfxObjectShell * GetNext(const SfxObjectShell &rPrev, const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
SfxMedium * GetMedium() const
bool DoSaveObjectAs(SfxMedium &rNewStor, bool bCommit)
void SetupStorage(const css::uno::Reference< css::embed::XStorage > &xStorage, sal_Int32 nVersion, bool bTemplate) const
static SAL_WARN_UNUSED_RESULT SfxObjectShell * GetFirst(const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
SfxObjectCreateMode GetCreateMode() const
SfxDispatcher * GetDispatcher()
SfxViewFrame & GetViewFrame() const
virtual SfxObjectShell * GetObjectShell() override
constexpr tools::Long Height() const
constexpr tools::Long Width() const
static bool GetFormatDataFlavor(SotClipboardFormatId nFormat, css::datatransfer::DataFlavor &rFlavor)
static SotClipboardFormatId GetFormat(const css::datatransfer::DataFlavor &rFlavor)
static sal_uInt8 GetExchangeAction(const DataFlavorExVector &rDataFlavorExVector, SotExchangeDest nDestination, sal_uInt16 nSourceOptions, sal_uInt8 nUserAction, SotClipboardFormatId &rFormat, sal_uInt8 &rDefaultAction, SotClipboardFormatId nOnlyTestFormat=SotClipboardFormatId::NONE, const css::uno::Reference< css::datatransfer::XTransferable > *pxTransferable=nullptr, SotExchangeActionFlags *pActionFlags=nullptr)
static SotClipboardFormatId GetFormatID(css::uno::Reference< css::embed::XStorage > const &xStorage)
static bool GetEmbeddedName(const TransferableDataHelper &rData, OUString &_rName, OUString &_rSource, SotClipboardFormatId const &_nFormat)
void SetEndian(SvStreamEndian SvStreamEndian)
std::size_t WriteBytes(const void *pData, std::size_t nSize)
sal_uInt32 GetHeight() const
void SetCharSet(rtl_TextEncoding nVal)
virtual sal_Int32 Len() const
void Push()
store a copy of the current cursor on the cursor stack
const SwTableNode * IsCursorInTable() const
Check if Point of current cursor is placed within a table.
bool GoPrevCursor()
go to the previous SSelection
const SwRect & GetCharRect() const
const Link< LinkParamNone *, void > & GetChgLnk() const
sal_uInt16 GetCursorCnt(bool bAll=true) const
Get the number of elements in the ring of cursors.
Point & GetCursorDocPos() const
bool IsInWord(sal_Int16 nWordType=css::i18n::WordType::ANYWORD_IGNOREWHITESPACES) const
::sw::mark::IMark * SetBookmark(const vcl::KeyCode &, const OUString &rName, IDocumentMarkAccess::MarkType eMark=IDocumentMarkAccess::MarkType::BOOKMARK)
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
OUString GetSelText() const
get selected text of a node at current cursor
bool ExtendSelection(bool bEnd=true, sal_Int32 nCount=1)
extend current SSelection by n characters
bool ShouldWait() const
Should WaitPtr be switched on for the clipboard?
bool GoNextCursor()
go to the next SSelection
SwPaM * CreateCursor()
delete the current cursor and make the following into the current
void EndAction(const bool bIdleEnd=false)
bool TestCurrPam(const Point &rPt, bool bTstHit=false)
Search in the selected area for a Selection that covers the given point.
const SwShellTableCursor * GetTableCursor() const
void DestroyCursor()
transform TableCursor to normal cursor, nullify Tablemode
void SetChgLnk(const Link< LinkParamNone *, void > &rLnk)
bool HasReadonlySel(bool isReplace=false) const
bool GetContentAtPos(const Point &rPt, SwContentAtPos &rContentAtPos, bool bSetCursor=false, SwRect *pFieldRect=nullptr)
bool IsStartWord(sal_Int16 nWordType=css::i18n::WordType::ANYWORD_IGNOREWHITESPACES) const
void SaveTableBoxContent(const SwPosition *pPos=nullptr)
void UnSetVisibleCursor()
OUString const & GetCmd() const
SfxLinkUpdateMode GetType() const
SwDoc & GetDoc()
Document is created after calling Read(...).
static SwTableNode * IsInTable(const SwNode &)
void ReplaceDefaults(const SwDoc &rSource)
void SetClipBoard(bool bNew)
IDocumentState const & getIDocumentState() const
void ReplaceCompatibilityOptions(const SwDoc &rSource)
bool InsertGlossary(SwTextBlocks &rBlock, const OUString &rEntry, SwPaM &rPaM, SwCursorShell *pShell=nullptr)
inserts an AutoText block
void SetOle2Link(const Link< bool, void > &rLink)
IDocumentContentOperations const & getIDocumentContentOperations() const
IDocumentUndoRedo & GetIDocumentUndoRedo()
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
void SetRowNotTracked(const SwCursor &rCursor, const SvxPrintItem &rNotTracked, bool bAll=false, bool bIns=false)
rNotTracked = false means that the row was deleted or inserted with its tracked cell content bAll: de...
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
void SetTmpDocShell(SfxObjectShellLock rLock)
in case during copying of embedded object a new shell is created, it should be set here and cleaned l...
IDocumentMarkAccess * getIDocumentMarkAccess()
const Link< bool, void > & GetOle2Link() const
OUString GetUniqueSectionName(const OUString *pChkStr=nullptr) const
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
const SfxObjectShellLock & GetTmpDocShell() const
void ReplaceStyles(const SwDoc &rSource, bool bIncludePageStyles=true)
::sw::MetaFieldManager & GetMetaFieldManager()
SwDocShell * GetDocShell()
sal_uInt16 GetCntType() const
Determine form of content. Return Type at CurrentCursor->SPoint.
virtual void CalcLayout() override
To enable set up of StartActions and EndActions.
void StartAllAction()
For all views of this document.
size_t GetFieldTypeCount(SwFieldIds nResId=SwFieldIds::Unknown) const
count field types with a ResId, if SwFieldIds::Unknown count all
bool IsModified() const
Changes in document?
SwSection const * InsertSection(SwSectionData &rNewData, SfxItemSet const *const =nullptr)
void DelINetAttrWithText()
If cursor is in an INetAttribute it will be deleted completely including the descriptive text (needed...
void GetGrfNms(OUString *pGrfName, OUString *pFltName, const SwFlyFrameFormat *=nullptr) const
Returns the name and the filter name of a graphic if the pointer is on a graphic.
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
bool Delete(bool isArtificialSelection=false)
Delete content of all ranges.
void RemoveFieldType(size_t nField)
delete field type
OUString Calculate()
Calculates selection.
SwFrameFormat * GetTableFormat()
bool InsertURL(const SwFormatINetFormat &rFormat, const OUString &rStr, bool bKeepSelection=false)
void InsertDDETable(const SwInsertTableOptions &rInsTableOpts, SwDDEFieldType *pDDEType, sal_uInt16 nRows, sal_uInt16 nCols)
SwFieldType * GetFieldType(size_t nField, SwFieldIds nResId=SwFieldIds::Unknown) const
get field types with a ResId, if 0 get all
SwFieldType * InsertFieldType(const SwFieldType &)
insert field type
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
void DoUndo(bool bOn=true)
Undo.
const Graphic * GetGraphic(bool bWait=true) const
void ReRead(const OUString &rGrfName, const OUString &rFltName, const Graphic *pGraphic=nullptr)
Re-read if graphic is not ok. Current graphic is replaced by the new one.
static tools::Long GetDDStartPosX()
static tools::Long GetDDStartPosY()
bool SetFlyFrameAttr(SfxItemSet &rSet)
FlyProtectFlags IsSelObjProtected(FlyProtectFlags eType) const
Which Protection is set at selected object?
comphelper::OInterfaceContainerHelper3< css::text::XPasteListener > & GetPasteListeners()
OUString GetFlyName() const
bool Paste(SwDoc &rClpDoc, bool bNestedTable=false)
bool IsFrameSelected() const
void SetTableInsertMode(SwTable::SearchType eFlag)
void SetTableCopied(bool bCopied)
const SwFrameFormat * GetFormatFromObj(const Point &rPt, SwRect **pRectToFill=nullptr) const
bool DeleteTableSel()
Current selection, may be whole table.
ObjCntType GetObjCntTypeOfSelection() const
void ReplaceSdrObj(const OUString &rGrfName, const Graphic *pGrf)
bool GetDrawObjGraphic(SotClipboardFormatId nFormat, Graphic &rGrf) const
Get selected DrawObj as graphics (MetaFile/Bitmap).
void Copy(SwDoc &rClpDoc, const OUString *pNewClpText=nullptr)
Copy and Paste methods for internal clipboard.
SwRect GetObjRect() const
For adjustment of PosAttr when anchor changes.
bool HasWholeTabSelection() const
bool GetFlyFrameAttr(SfxItemSet &rSet) const
size_t IsObjSelected() const
bool SelectObj(const Point &rSelPt, sal_uInt8 nFlag=0, SdrObject *pObj=nullptr)
If an object has been given, exactly this object is selected (instead of searching over position).
bool IsInsideSelectedObj(const Point &rPt)
returns enum values
SwTable::SearchType GetTableInsertMode() const
bool GetTableCopied() const
const SwFrameFormat * GetFlyFrameFormat() const
Get FlyFrameFormat; for UI macro linkage at Flys.
Instances of SwFields and those derived from it occur 0 to n times.
virtual OUString GetName() const
Only in derived classes.
static std::shared_ptr< const SfxFilter > GetFileFilter(const OUString &rFileName)
Detect for the given file which filter should be used.
SwTransferable * m_pXSelection
SwTransferable * m_pDragDrop
Marks a node in the document model.
Base class of the Writer document model elements.
SwStartNode * GetStartNode()
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwNodeOffset GetIndex() const
const SwStartNode * FindTableBoxStartNode() const
SwTableBox * GetTableBox() const
If node is in a table return the respective table box.
SwTableNode * FindTableNode()
Search table node, in which it is.
const SwStartNode * StartOfSectionNode() const
SwContentNode * GetContentNode()
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
SwContentNode * GoNext(SwNodeIndex *) const
PaM is Point and Mark: a selection of the document model.
SwNode & GetPointNode() const
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
const SwPosition * GetPoint() const
const SwPosition * Start() const
Tracks the boundaries of pasted content and notifies listeners.
sal_Int32 m_nStartContent
SwPasteContext(SwWrtShell &rWrtShell)
std::optional< SwPaM > m_oPaM
ErrCode Read(const Reader &)
Of course Writer needs its own rectangles.
void Pos(const Point &rNew)
tools::Rectangle SVRect() const
void AddRule(SwUndoArg eWhat, const OUString &rWith)
SAL_DLLPRIVATE void SetProtectFlag(bool const bFlag)
void SetLinkFileName(OUString const &rNew)
void SetDdeBookmark(::sw::mark::IMark &rBookmark)
Starts a section of nodes in the document model.
SwTableBox is one table cell in the document model.
const SwSelBoxes & GetSelectedBoxes() const
SwTableLine is one table row in the document model.
sal_uInt16 GetPos(const SwTableLine *pBox) const
const SwTable & GetTable() const
SwTableLines & GetTabLines()
SwTableFormat * GetFrameFormat()
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
SwTextNode is a paragraph in the document model.
SwpHints & GetSwpHints()
getters for SwpHints
const OUString & GetText() const
virtual void DragFinished(sal_Int8 nDropAction) override
static bool CheckForURLOrLNKFile(const TransferableDataHelper &rData, OUString &rFileName, OUString *pTitle=nullptr)
static void ClearSelection(const SwWrtShell &rSh, const SwFrameShell *pCreator=nullptr)
static void FillClipFormatItem(const SwWrtShell &rSh, const TransferableDataHelper &rData, SvxClipboardFormatItem &rToFill)
static void SetSelInShell(SwWrtShell &, bool, const Point *)
static void SelectPasteFormat(TransferableDataHelper &rData, sal_uInt8 &nAction, SotClipboardFormatId &nFormat)
virtual bool WriteObject(tools::SvRef< SotTempStream > &rxOStm, void *pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor &rFlavor) override
virtual void AddSupportedFormats() override
void SetDataForDragAndDrop(const Point &rSttPos)
static void PrePasteSpecial(const SwWrtShell &rSh, TransferableDataHelper &, const VclPtr< SfxAbstractPasteDialog > &pDlg)
PrePasteSpecial Prepares the given dialog without actually running it.
static bool PasteFileList(const TransferableDataHelper &rData, SwWrtShell &rSh, bool bLink, const Point *pPt, bool bMsg)
static bool PasteSdrFormat(const TransferableDataHelper &rData, SwWrtShell &rSh, SwPasteSdr nAction, const Point *pPt, SotExchangeActionFlags nActionFlags, bool bNeedToSelectBeforePaste)
virtual ~SwTransferable() override
TransferableObjectDescriptor m_aObjDesc
static bool PasteOLE(TransferableDataHelper &rData, SwWrtShell &rSh, SotClipboardFormatId nFormat, SotExchangeActionFlags nActionFlags, bool bMsg)
std::unique_ptr< INetImage > m_pTargetURL
static bool PasteAsHyperlink(const TransferableDataHelper &rData, SwWrtShell &rSh, SotClipboardFormatId nFormat)
std::unique_ptr< SwDocFac, o3tl::default_delete< SwDocFac > > m_pClpDocFac
static bool IsPasteOwnFormat(const TransferableDataHelper &)
tools::SvRef< sfx2::SvBaseLink > m_xDdeLink
int PrepareForCopy(bool bIsCut=false)
void PrepareForCopyTextRange(SwPaM &rPaM)
static void InitOle(SfxObjectShell *pDoc)
bool CopyGlossary(SwTextBlocks &rGlossary, const OUString &rStr)
static SwTransferable * GetSwTransferable(const TransferableDataHelper &rData)
static bool PasteImageMap(const TransferableDataHelper &rData, SwWrtShell &rSh)
std::optional< INetBookmark > m_oBookmark
const SwFrameShell * m_pCreatorView
TransferBufferType m_eBufferType
static bool PasteGrf(const TransferableDataHelper &rData, SwWrtShell &rSh, SotClipboardFormatId nFormat, SwPasteSdr nAction, const Point *pPt, SotExchangeActionFlags nActionFlags, sal_Int8 nDropAction, bool bNeedToSelectBeforePaste, RndStdIds nAnchorType=RndStdIds::FLY_AT_PARA)
virtual bool GetData(const css::datatransfer::DataFlavor &rFlavor, const OUString &rDestDoc) override
static void CreateSelection(SwWrtShell &rSh, const SwFrameShell *pCreator=nullptr)
virtual sal_Bool SAL_CALL isComplex() override
static bool Paste(SwWrtShell &, TransferableDataHelper &, RndStdIds nAnchorType=RndStdIds::FLY_AT_PARA, bool bIgnoreComments=false, PasteTableType ePasteTable=PasteTableType::PASTE_DEFAULT)
static bool PasteFileName(TransferableDataHelper &rData, SwWrtShell &rSh, SotClipboardFormatId nFormat, SwPasteSdr nAction, const Point *pPt, SotExchangeActionFlags nActionFlags, bool *graphicInserted)
std::unique_ptr< ImageMap > m_pImageMap
static bool IsPasteSpecial(const SwWrtShell &rWrtShell, const TransferableDataHelper &)
css::uno::Reference< css::embed::XEmbeddedObject > FindOLEObj(sal_Int64 &nAspect) const
static SotExchangeDest GetSotDestination(const SwWrtShell &rSh)
bool PrivatePaste(SwWrtShell &rShell, SwPasteContext *pContext=nullptr, PasteTableType ePasteTable=PasteTableType::PASTE_DEFAULT)
bool PrivateDrop(SwWrtShell &rSh, const Point &rDragPt, bool bMove, bool bIsXSelection)
SfxObjectShellLock m_aDocShellRef
static bool PasteFileContent(const TransferableDataHelper &, SwWrtShell &rSh, SotClipboardFormatId nFormat, bool bMsg, bool bIgnoreComments=false)
const Graphic * FindOLEReplacementGraphic() const
void RemoveDDELinkFormat(vcl::Window &rWin)
static bool TestAllowedFormat(const TransferableDataHelper &rData, SotClipboardFormatId nFormat, SotExchangeDest nDestination)
std::optional< Graphic > m_oClpGraphic
int Copy(bool bIsCut=false)
static bool PasteData(TransferableDataHelper &rData, SwWrtShell &rSh, sal_uInt8 nAction, SotExchangeActionFlags nActionFlags, SotClipboardFormatId nFormat, SotExchangeDest nDestination, bool bIsPasteFormat, bool bIsDefault, const Point *pDDPos=nullptr, sal_Int8 nDropAction=0, bool bPasteSelection=false, RndStdIds nAnchorType=RndStdIds::FLY_AT_PARA, bool bIgnoreComments=false, SwPasteContext *pContext=nullptr, PasteTableType nPaste=PasteTableType::PASTE_DEFAULT)
static bool PasteUnformatted(SwWrtShell &rSh, TransferableDataHelper &)
virtual void ObjectReleased() override
void StartDrag(vcl::Window *pWin, const Point &rPos)
static bool PasteDBData(const TransferableDataHelper &rData, SwWrtShell &rSh, SotClipboardFormatId nFormat, bool bLink, const Point *pDragPt, bool bMsg)
std::optional< Graphic > m_oClpBitmap
static bool IsPaste(const SwWrtShell &, const TransferableDataHelper &)
static bool PasteDDE(const TransferableDataHelper &rData, SwWrtShell &rWrtShell, bool bReReadGrf, bool bMsg)
SwTransferable(const SwTransferable &)=delete
static bool PasteTargetURL(const TransferableDataHelper &rData, SwWrtShell &rSh, SwPasteSdr nAction, const Point *pPt, bool bInsertGRF)
static bool PasteFormat(SwWrtShell &rSh, TransferableDataHelper &rData, SotClipboardFormatId nFormat)
void SetIdle(bool b) const
const SwViewOption * GetViewOptions() const
const IDocumentMarkAccess * getIDocumentMarkAccess() const
Provides access to the document bookmark interface.
const IDocumentRedlineAccess & getIDocumentRedlineAccess() const
Provides access to the document redline interface.
const SfxItemPool & GetAttrPool() const
void AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId=nullptr)
void AddTransferable(SwTransferable &rTransferable)
SwDrawBase * GetDrawFuncPtr() const
ShellMode GetShellMode() const
SwDocShell * GetDocShell()
ErrCode Write(WriterRef const &rxWriter, const OUString *=nullptr)
Used by the UI to modify the document model.
bool IsSelFrameMode() const
bool Down(bool bSelect, sal_uInt16 nCount=1, bool bBasicCall=false)
void EnterSelFrameMode(const Point *pStartDrag=nullptr)
void StartInsertRegionDialog(const SwSectionData &)
void GotoMark(const ::sw::mark::IMark *const pMark)
bool GotoFly(const OUString &rName, FlyCntType eType=FLYCNTTYPE_ALL, bool bSelFrame=true)
bool GetURLFromButton(OUString &rURL, OUString &rDescr) const
SelectionType GetSelectionType() const
void InsertGraphic(const OUString &rPath, const OUString &rFilter, const Graphic &, SwFlyFrameAttrMgr *=nullptr, RndStdIds nAnchorType=RndStdIds::FLY_AT_PARA)
bool InsertOleObject(const svt::EmbeddedObjectRef &xObj, SwFlyFrameFormat **pFlyFrameFormat=nullptr)
int IntelligentCut(SelectionType nSelectionType, bool bCut=true)
bool Up(bool bSelect, sal_uInt16 nCount=1, bool bBasicCall=false)
void NavigatorPaste(const NaviContentBookmark &rBkmk, const sal_uInt16 nAction)
void SetRetainSelection(bool bRet)
bool DelRight(bool isReplaceHeuristic=false)
bool HasSelection() const
bool InsertField2(SwField const &, SwPaM *pAnnotationRange=nullptr)
tools::Long ResetSelect(const Point *, bool)
OUString GetSelDescr() const
bool SelectTextAttr(sal_uInt16 nWhich, const SwTextAttr *pAttr=nullptr)
bool Pop(SwCursorShell::PopMode, ::std::optional< SwCallLink > &roLink)
const SwView & GetView() const
static rtl::Reference< SwXTextGraphicObject > CreateXTextGraphicObject(SwDoc &rDoc, SwFrameFormat *pFrameFormat)
void SetASCIIOpts(const SwAsciiOptions &rOpts)
SwTextAttr * Get(size_t nPos) const
bool GetTransferableObjectDescriptor(SotClipboardFormatId nFormat, TransferableObjectDescriptor &rDesc)
bool GetString(SotClipboardFormatId nFormat, OUString &rStr) const
bool GetImageMap(SotClipboardFormatId nFormat, ImageMap &rIMap) const
const DataFlavorExVector & GetDataFlavorExVector() const
css::uno::Any GetAny(SotClipboardFormatId nFormat, const OUString &rDestDoc) const
bool GetFileList(SotClipboardFormatId nFormat, FileList &rFileList) const
css::uno::Reference< css::io::XInputStream > GetInputStream(SotClipboardFormatId nFormat, const OUString &rDestDoc) const
bool GetSotStorageStream(SotClipboardFormatId nFormat, tools::SvRef< SotTempStream > &rStreamRef) const
bool GetGDIMetaFile(SotClipboardFormatId nFormat, GDIMetaFile &rMtf, size_t nMaxActions=0) const
bool HasFormat(SotClipboardFormatId nFormat) const
bool GetINetImage(SotClipboardFormatId nFormat, INetImage &rINtImg) const
const css::uno::Reference< css::datatransfer::XTransferable > & GetTransferable() const
bool GetGraphic(SotClipboardFormatId nFormat, Graphic &rGraphic) const
bool GetINetBookmark(SotClipboardFormatId nFormat, INetBookmark &rBmk) const
css::uno::Reference< css::datatransfer::XTransferable > GetXTransferable() const
void StartDrag(vcl::Window *pWindow, sal_Int8 nDragSourceActions)
bool SetGraphic(const Graphic &rGraphic)
void CopyToClipboard(const css::uno::Reference< css::datatransfer::clipboard::XClipboard > &rClipboard) const
bool SetTransferableObjectDescriptor(const TransferableObjectDescriptor &rDesc)
bool SetAny(const css::uno::Any &rAny)
bool SetObject(void *pUserObject, sal_uInt32 nUserObjectId, const css::datatransfer::DataFlavor &rFlavor)
void RemoveFormat(SotClipboardFormatId nFormat)
static void ClearPrimarySelection()
bool SetINetImage(const INetImage &rINtImg, const css::datatransfer::DataFlavor &rFlavor)
bool SetBitmapEx(const BitmapEx &rBitmap, const css::datatransfer::DataFlavor &rFlavor)
bool SetINetBookmark(const INetBookmark &rBmk, const css::datatransfer::DataFlavor &rFlavor)
bool HasFormat(SotClipboardFormatId nFormat)
void PrepareOLE(const TransferableObjectDescriptor &rObjDesc)
void AddFormat(SotClipboardFormatId nFormat)
bool SetImageMap(const ImageMap &rIMap)
bool SetGDIMetaFile(const GDIMetaFile &rMtf)
void readGraphic(Graphic &rGraphic)
static UITestLogger & getInstance()
void logEvent(const EventDescription &rDescription)
static MapUnit UnoEmbed2VCLMapUnit(sal_Int32 nUnoEmbedMapUnit)
bool InsertEmbeddedObject(const css::uno::Reference< css::embed::XEmbeddedObject > &, OUString &)
sal_Int32 getLength() const
void notifyEach(void(SAL_CALL ListenerT::*NotificationMethod)(const EventT &), const EventT &Event)
static css::uno::Reference< css::embed::XStorage > GetStorageFromInputStream(const css::uno::Reference< css::io::XInputStream > &xStream, const css::uno::Reference< css::uno::XComponentContext > &rxContext=css::uno::Reference< css::uno::XComponentContext >())
static css::uno::Reference< css::embed::XStorage > GetStorageFromStream(const css::uno::Reference< css::io::XStream > &xStream, sal_Int32 nStorageMode=css::embed::ElementModes::READWRITE, const css::uno::Reference< css::uno::XComponentContext > &rxContext=css::uno::Reference< css::uno::XComponentContext >())
static css::uno::Reference< css::embed::XStorage > GetTemporaryStorage(const css::uno::Reference< css::uno::XComponentContext > &rxContext=css::uno::Reference< css::uno::XComponentContext >())
SfxClassificationCheckPasteResult
const Value & back() const
const Value & front() const
virtual UpdateResult DataChanged(const OUString &rMimeType, const css::uno::Any &rValue)
void SetGraphic(const Graphic &rGraphic, const OUString &rMediaType)
Size GetSize(MapMode const *pTargetMapMode) const
ring_container GetRingContainer()
virtual bool IsExpanded() const =0
virtual const SwPosition & GetMarkEnd() const =0
virtual const SwPosition & GetMarkStart() const =0
virtual const OUString & GetName() const =0
SvStream * GetStream(StreamMode eMode)
#define FN_TABLE_PASTE_COL_BEFORE
#define FN_DB_DATA_SOURCE_ANY
#define FN_DB_DATA_CURSOR_ANY
#define FN_DB_CONNECTION_ANY
#define FN_TABLE_INSERT_ROW_BEFORE
#define FN_TABLE_DELETE_ROW
#define FN_TABLE_INSERT_COL_BEFORE
#define FN_QRY_INSERT_FIELD
#define FN_QRY_MERGE_FIELD
#define FN_PARAM_INSERT_AFTER
#define FN_DB_DATA_COLUMN_NAME_ANY
#define FN_PASTE_NESTED_TABLE
#define FN_DB_DATA_COMMAND_ANY
#define FN_START_OF_DOCUMENT
#define FN_DB_DATA_SELECTION_ANY
#define FN_TABLE_DELETE_COL
#define FN_TABLE_SELECT_ALL
#define FN_DB_DATA_COMMAND_TYPE_ANY
#define FN_TABLE_PASTE_ROW_BEFORE
#define FN_TABLE_DELETE_TABLE
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT(EE_CHAR_START+2)
EmbeddedObjectRef * pObject
#define EXCHG_OUT_ACTION_INSERT_INTERACTIVE
#define EXCHG_OUT_ACTION_INSERT_GDIMETAFILE
#define EXCHG_OUT_ACTION_INSERT_HTML
#define EXCHG_OUT_ACTION_INSERT_BITMAP
#define EXCHG_IN_ACTION_LINK
#define EXCHG_INOUT_ACTION_NONE
#define EXCHG_OUT_ACTION_INSERT_DRAWOBJ
::std::vector< DataFlavorEx > DataFlavorExVector
#define EXCHG_OUT_ACTION_REPLACE_GDIMETAFILE
#define EXCHG_OUT_ACTION_INSERT_GRAPH
#define EXCHG_OUT_ACTION_INSERT_IMAGEMAP
#define EXCHG_OUT_ACTION_INSERT_PRIVATE
#define EXCHG_OUT_ACTION_REPLACE_BITMAP
#define EXCHG_OUT_ACTION_REPLACE_SVXB
#define EXCHG_IN_ACTION_COPY
#define EXCHG_OUT_ACTION_REPLACE_GRAPH
#define EXCHG_OUT_ACTION_INSERT_OLE
#define EXCHG_OUT_ACTION_REPLACE_IMAGEMAP
#define EXCHG_OUT_ACTION_INSERT_HYPERLINK
#define EXCHG_OUT_ACTION_INSERT_DDE
#define EXCHG_OUT_ACTION_MOVE_PRIVATE
#define EXCHG_OUT_ACTION_REPLACE_DRAWOBJ
#define EXCHG_OUT_ACTION_INSERT_STRING
#define EXCHG_IN_ACTION_MOVE
#define EXCHG_OUT_ACTION_INSERT_SVXB
#define EXCHG_IN_ACTION_DEFAULT
#define EXCHG_OUT_ACTION_GET_ATTRIBUTES
#define EXCHG_OUT_ACTION_INSERT_FILE
void GetRTFWriter(std::u16string_view rFltName, const OUString &rBaseURL, WriterRef &xRet)
constexpr TypedWhichId< SwFormatURL > RES_URL(117)
constexpr TypedWhichId< SwFormatINetFormat > RES_TXTATR_INETFMT(51)
constexpr TypedWhichId< SwFormatFlyCnt > RES_TXTATR_FLYCNT(58)
constexpr TypedWhichId< SvxPrintItem > RES_PRINT(104)
const ::utl::TransliterationWrapper & GetAppCmpStrIgnore()
#define SAL_WARN(area, stream)
constexpr OUStringLiteral aData
SVL_DLLPUBLIC OUString SmartRel2Abs(INetURLObject const &rTheBaseURIRef, OUString const &rTheRelURIRef, Link< OUString *, bool > const &rMaybeFileHdl=Link< OUString *, bool >(), bool bCheckFileExists=true, bool bIgnoreFragment=false, INetURLObject::EncodeMechanism eEncodeMechanism=INetURLObject::EncodeMechanism::WasEncoded, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)
SVL_DLLPUBLIC OUString removePassword(OUString const &rURI, INetURLObject::EncodeMechanism eEncodeMechanism, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
sal_Int32 getTokenCount(std::string_view rIn, char cTok)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
void MakeLnkName(OUString &rName, const OUString *pType, std::u16string_view rFile, std::u16string_view rLink, const OUString *pFilter)
BitmapEx GetBitmapEx(BitmapEx const &rBitmapEx, DrawModeFlags nDrawMode)
HashMap_OWString_Interface aMap
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
TOOLS_DLLPUBLIC OUString read_zeroTerminated_uInt8s_ToOUString(SvStream &rStrm, rtl_TextEncoding eEnc)
SotClipboardFormatId mnSotId
std::map< OUString, OUString > aParameters
union SwContentAtPos::@21 aFnd
const SfxPoolItem * pAttr
Marks a position in the document model.
void SetMark(const sw::mark::IMark *pMark)
void Assign(const SwNode &rNd, SwNodeOffset nDelta, sal_Int32 nContentOffset=0)
These all set both nNode and nContent.
sal_Int32 GetContentIndex() const
constexpr sal_uInt32 SWTRANSFER_OBJECTTYPE_DRAWMODEL
static SwDoc & lcl_GetDoc(SwDocFac &rDocFac)
constexpr tools::Long constOleWidthInMm
constexpr sal_uInt32 SWTRANSFER_OBJECTTYPE_STRING
constexpr Size constOleSizeTwip
constexpr sal_uInt32 SWTRANSFER_OBJECTTYPE_HTML
static SotClipboardFormatId aPasteSpecialIds[]
the list of formats which will be offered to the user in the 'Paste Special...' dialog and the paste ...
static sal_Int32 lcl_getLevel(OUString &sText, sal_Int32 nIdx)
constexpr Size constOleSize100mm(constOleWidthInMm *100, 3000)
static uno::Reference< XTransferable > * lcl_getTransferPointer(uno::Reference< XTransferable > &xRef)
constexpr sal_uInt32 SWTRANSFER_OBJECTTYPE_RTF
constexpr sal_uInt32 SWTRANSFER_OBJECTTYPE_RICHTEXT
constexpr sal_uInt32 SWTRANSFER_OBJECTTYPE_DDE
constexpr sal_uInt32 SWTRANSFER_OBJECTTYPE_SWOLE
static void DeleteDDEMarks(SwDoc &rDest)
OUString SwResId(TranslateId aId)
constexpr SwTwips DOCUMENTBORDER
constexpr tools::Long lMinBorderInMm(20)
#define DND_ACTION_COPYMOVE
SVXCORE_DLLPUBLIC bool SvxDrawingLayerExport(SdrModel *pModel, const css::uno::Reference< css::io::XOutputStream > &xOut)
void GetASCWriter(std::u16string_view rFltNm, const OUString &, WriterRef &xRet)
void GetHTMLWriter(std::u16string_view rFilterOptions, const OUString &rBaseURL, WriterRef &xRet)