tdf#101828 handle rtf/richtext correctly
Change-Id: Id894f62a918bd6e6fa59f8d546307343bf2bd4b0 Reviewed-on: https://gerrit.libreoffice.org/32682 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
This commit is contained in:
parent
6f0993f236
commit
048e30c1f8
@ -134,7 +134,7 @@ static const std::vector< FormatEntry > g_TranslTable {
|
||||
// SotClipboardFormatId::SIMPLE_FILE
|
||||
FormatEntry("application/x-openoffice-file;windows_formatname=\"FileName\"", "FileName", nullptr, CF_INVALID, CPPUTYPE_DEFAULT),
|
||||
// SotClipboardFormatId::RTF
|
||||
FormatEntry("text/richtext", "Rich Text Format", nullptr, CF_INVALID, CPPUTYPE_DEFAULT),
|
||||
FormatEntry("text/rtf", "Rich Text Format", nullptr, CF_INVALID, CPPUTYPE_DEFAULT),
|
||||
// SotClipboardFormatId::DRAWING
|
||||
FormatEntry("application/x-openoffice-drawing;windows_formatname=\"Drawing Format\"", "Drawing Format", nullptr, CF_INVALID, CPPUTYPE_DEFAULT),
|
||||
// SotClipboardFormatId::SVXB
|
||||
@ -352,6 +352,8 @@ static const std::vector< FormatEntry > g_TranslTable {
|
||||
FormatEntry("application/x-openoffice-dummy3;windows_formatname=\"SO_DUMMYFORMAT_3\"", "SO_DUMMYFORMAT_3", nullptr, CF_INVALID, CPPUTYPE_DEFAULT),
|
||||
//SotClipboardFormatId::DUMMY4
|
||||
FormatEntry("application/x-openoffice-dummy4;windows_formatname=\"SO_DUMMYFORMAT_4\"", "SO_DUMMYFORMAT_4", nullptr, CF_INVALID, CPPUTYPE_DEFAULT),
|
||||
// SotClipboardFormatId::RICHTEXT
|
||||
FormatEntry("text/richtext", "Richtext Format", nullptr, CF_INVALID, CPPUTYPE_DEFAULT),
|
||||
};
|
||||
|
||||
namespace {
|
||||
|
@ -57,7 +57,7 @@ uno::Any EditDataObject::getTransferData( const datatransfer::DataFlavor& rFlavo
|
||||
{
|
||||
aAny <<= GetString();
|
||||
}
|
||||
else if ( ( nT == SotClipboardFormatId::EDITENGINE ) || ( nT == SotClipboardFormatId::RTF ) )
|
||||
else if ( ( nT == SotClipboardFormatId::EDITENGINE ) || ( nT == SotClipboardFormatId::RTF ) || ( nT == SotClipboardFormatId::RICHTEXT ) )
|
||||
{
|
||||
// No RTF on demand any more:
|
||||
// 1) Was not working, because I had to flush() the clipboard immediately anyway
|
||||
@ -84,10 +84,11 @@ uno::Any EditDataObject::getTransferData( const datatransfer::DataFlavor& rFlavo
|
||||
|
||||
uno::Sequence< datatransfer::DataFlavor > EditDataObject::getTransferDataFlavors( ) throw(uno::RuntimeException, std::exception)
|
||||
{
|
||||
uno::Sequence< datatransfer::DataFlavor > aDataFlavors(3);
|
||||
uno::Sequence< datatransfer::DataFlavor > aDataFlavors(4);
|
||||
SotExchange::GetFormatDataFlavor( SotClipboardFormatId::EDITENGINE, aDataFlavors.getArray()[0] );
|
||||
SotExchange::GetFormatDataFlavor( SotClipboardFormatId::STRING, aDataFlavors.getArray()[1] );
|
||||
SotExchange::GetFormatDataFlavor( SotClipboardFormatId::RTF, aDataFlavors.getArray()[2] );
|
||||
SotExchange::GetFormatDataFlavor( SotClipboardFormatId::RICHTEXT, aDataFlavors.getArray()[3] );
|
||||
|
||||
return aDataFlavors;
|
||||
}
|
||||
@ -97,7 +98,8 @@ sal_Bool EditDataObject::isDataFlavorSupported( const datatransfer::DataFlavor&
|
||||
bool bSupported = false;
|
||||
|
||||
SotClipboardFormatId nT = SotExchange::GetFormat( rFlavor );
|
||||
if ( ( nT == SotClipboardFormatId::STRING ) || ( nT == SotClipboardFormatId::RTF ) || ( nT == SotClipboardFormatId::EDITENGINE ) )
|
||||
if ( ( nT == SotClipboardFormatId::STRING ) || ( nT == SotClipboardFormatId::RTF ) || ( nT == SotClipboardFormatId::RICHTEXT )
|
||||
|| ( nT == SotClipboardFormatId::EDITENGINE ) )
|
||||
bSupported = true;
|
||||
|
||||
return bSupported;
|
||||
|
@ -3490,8 +3490,17 @@ EditSelection ImpEditEngine::InsertText( uno::Reference< datatransfer::XTransfer
|
||||
{
|
||||
// RTF
|
||||
SotExchange::GetFormatDataFlavor( SotClipboardFormatId::RTF, aFlavor );
|
||||
if ( rxDataObj->isDataFlavorSupported( aFlavor ) )
|
||||
// RICHTEXT
|
||||
datatransfer::DataFlavor aFlavorRichtext;
|
||||
SotExchange::GetFormatDataFlavor( SotClipboardFormatId::RTF, aFlavorRichtext );
|
||||
bool bRtfSupported = rxDataObj->isDataFlavorSupported( aFlavor );
|
||||
bool bRichtextSupported = rxDataObj->isDataFlavorSupported( aFlavorRichtext );
|
||||
if ( bRtfSupported || bRichtextSupported )
|
||||
{
|
||||
if(bRichtextSupported)
|
||||
{
|
||||
aFlavor = aFlavorRichtext;
|
||||
}
|
||||
try
|
||||
{
|
||||
uno::Any aData = rxDataObj->getTransferData( aFlavor );
|
||||
|
@ -137,7 +137,8 @@ namespace frm
|
||||
|
||||
// initial state
|
||||
TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( _rView.GetWindow() ) );
|
||||
m_bPastePossible = ( aDataHelper.HasFormat( SotClipboardFormatId::STRING ) || aDataHelper.HasFormat( SotClipboardFormatId::RTF ) );
|
||||
m_bPastePossible = ( aDataHelper.HasFormat( SotClipboardFormatId::STRING ) ||
|
||||
aDataHelper.HasFormat( SotClipboardFormatId::RTF ) || aDataHelper.HasFormat( SotClipboardFormatId::RICHTEXT ) );
|
||||
}
|
||||
|
||||
|
||||
@ -155,7 +156,8 @@ namespace frm
|
||||
{
|
||||
OSL_ENSURE( _pDataHelper, "OPasteClipboardDispatcher::OnClipboardChanged: ooops!" );
|
||||
m_bPastePossible = _pDataHelper->HasFormat( SotClipboardFormatId::STRING )
|
||||
|| _pDataHelper->HasFormat( SotClipboardFormatId::RTF );
|
||||
|| _pDataHelper->HasFormat( SotClipboardFormatId::RTF )
|
||||
|| _pDataHelper->HasFormat( SotClipboardFormatId::RICHTEXT );
|
||||
|
||||
invalidate();
|
||||
}
|
||||
|
@ -172,8 +172,9 @@ enum class SotClipboardFormatId : sal_uLong
|
||||
STARWRITERGLOB_8_TEMPLATE = 142,
|
||||
MATHML = 143,
|
||||
JPEG = 144,
|
||||
RICHTEXT = 145,
|
||||
// the point at which we start allocating "runtime" format IDs
|
||||
USER_END = JPEG
|
||||
USER_END = RICHTEXT
|
||||
};
|
||||
|
||||
/** Make it easier to iterate over format IDs */
|
||||
|
@ -100,7 +100,9 @@
|
||||
#define STR_FORMAT_ID_DBACCESS_COMMAND (STR_FORMAT_START + 115)
|
||||
#define STR_FORMAT_ID_DIALOG_60 (STR_FORMAT_START + 116)
|
||||
#define STR_FORMAT_ID_HTML_NO_COMMENT (STR_FORMAT_START + 119)
|
||||
#define STR_FORMAT_END (STR_FORMAT_ID_HTML_NO_COMMENT)
|
||||
#define STR_FORMAT_ID_RICHTEXT (STR_FORMAT_START + 120)
|
||||
|
||||
#define STR_FORMAT_END (STR_FORMAT_ID_RICHTEXT)
|
||||
|
||||
#endif // INCLUDED_SVTOOLS_SORES_HXX
|
||||
|
||||
|
@ -201,6 +201,7 @@ void ScSelectionTransferObj::AddSupportedFormats()
|
||||
AddFormat( SotClipboardFormatId::DIF );
|
||||
AddFormat( SotClipboardFormatId::STRING );
|
||||
AddFormat( SotClipboardFormatId::RTF );
|
||||
AddFormat( SotClipboardFormatId::RICHTEXT );
|
||||
if ( eMode == SC_SELTRANS_CELL )
|
||||
AddFormat( SotClipboardFormatId::EDITENGINE );
|
||||
break;
|
||||
|
@ -240,6 +240,7 @@ void ScTransferObj::AddSupportedFormats()
|
||||
AddFormat( SotClipboardFormatId::STRING );
|
||||
|
||||
AddFormat( SotClipboardFormatId::RTF );
|
||||
AddFormat( SotClipboardFormatId::RICHTEXT );
|
||||
if ( aBlock.aStart == aBlock.aEnd )
|
||||
AddFormat( SotClipboardFormatId::EDITENGINE );
|
||||
}
|
||||
@ -255,7 +256,8 @@ bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor, const OUSt
|
||||
{
|
||||
bOK = SetTransferableObjectDescriptor( aObjDesc, rFlavor );
|
||||
}
|
||||
else if ( ( nFormat == SotClipboardFormatId::RTF || nFormat == SotClipboardFormatId::EDITENGINE ) &&
|
||||
else if ( ( nFormat == SotClipboardFormatId::RTF || nFormat == SotClipboardFormatId::RICHTEXT ||
|
||||
nFormat == SotClipboardFormatId::EDITENGINE ) &&
|
||||
aBlock.aStart == aBlock.aEnd )
|
||||
{
|
||||
// RTF from a single cell is handled by EditEngine
|
||||
@ -288,7 +290,8 @@ bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor, const OUSt
|
||||
(nFormat == SotClipboardFormatId::RTF) ? SCTRANS_TYPE_EDIT_RTF : SCTRANS_TYPE_EDIT_BIN,
|
||||
rFlavor );
|
||||
}
|
||||
else if ( ScImportExport::IsFormatSupported( nFormat ) || nFormat == SotClipboardFormatId::RTF )
|
||||
else if ( ScImportExport::IsFormatSupported( nFormat ) || nFormat == SotClipboardFormatId::RTF
|
||||
|| nFormat == SotClipboardFormatId::RICHTEXT )
|
||||
{
|
||||
// if this transfer object was used to create a DDE link, filtered rows
|
||||
// have to be included for subsequent calls (to be consistent with link data)
|
||||
@ -297,7 +300,8 @@ bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor, const OUSt
|
||||
|
||||
bool bIncludeFiltered = pDoc->IsCutMode() || bUsedForLink;
|
||||
|
||||
bool bReduceBlockFormat = nFormat == SotClipboardFormatId::HTML || nFormat == SotClipboardFormatId::RTF;
|
||||
bool bReduceBlockFormat = nFormat == SotClipboardFormatId::HTML || nFormat == SotClipboardFormatId::RTF
|
||||
|| nFormat == SotClipboardFormatId::RICHTEXT;
|
||||
ScRange aReducedBlock = aBlock;
|
||||
if (bReduceBlockFormat && (aBlock.aEnd.Col() == MAXCOL || aBlock.aEnd.Row() == MAXROW) && aBlock.aStart.Tab() == aBlock.aEnd.Tab())
|
||||
{
|
||||
|
@ -385,7 +385,7 @@ bool ScImportExport::ImportStream( SvStream& rStrm, const OUString& rBaseURL, So
|
||||
if( Dif2Doc( rStrm ) )
|
||||
return true;
|
||||
}
|
||||
if( nFmt == SotClipboardFormatId::RTF )
|
||||
if( nFmt == SotClipboardFormatId::RTF || nFmt == SotClipboardFormatId::RICHTEXT )
|
||||
{
|
||||
if( RTF2Doc( rStrm, rBaseURL ) )
|
||||
return true;
|
||||
@ -473,7 +473,7 @@ bool ScImportExport::ExportStream( SvStream& rStrm, const OUString& rBaseURL, So
|
||||
if( Doc2HTML( rStrm, rBaseURL ) )
|
||||
return true;
|
||||
}
|
||||
if( nFmt == SotClipboardFormatId::RTF )
|
||||
if( nFmt == SotClipboardFormatId::RTF || nFmt == SotClipboardFormatId::RICHTEXT )
|
||||
{
|
||||
if( Doc2RTF( rStrm ) )
|
||||
return true;
|
||||
|
@ -473,7 +473,8 @@ void ScDrawTextObjectBar::GetState( SfxItemSet& rSet )
|
||||
|
||||
IMPL_LINK( ScDrawTextObjectBar, ClipboardChanged, TransferableDataHelper*, pDataHelper, void )
|
||||
{
|
||||
bPastePossible = ( pDataHelper->HasFormat( SotClipboardFormatId::STRING ) || pDataHelper->HasFormat( SotClipboardFormatId::RTF ) );
|
||||
bPastePossible = ( pDataHelper->HasFormat( SotClipboardFormatId::STRING ) || pDataHelper->HasFormat( SotClipboardFormatId::RTF )
|
||||
|| pDataHelper->HasFormat( SotClipboardFormatId::RICHTEXT ) );
|
||||
|
||||
SfxBindings& rBindings = pViewData->GetBindings();
|
||||
rBindings.Invalidate( SID_PASTE );
|
||||
@ -499,7 +500,8 @@ void ScDrawTextObjectBar::GetClipState( SfxItemSet& rSet )
|
||||
|
||||
// get initial state
|
||||
TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pViewData->GetActiveWin() ) );
|
||||
bPastePossible = ( aDataHelper.HasFormat( SotClipboardFormatId::STRING ) || aDataHelper.HasFormat( SotClipboardFormatId::RTF ) );
|
||||
bPastePossible = ( aDataHelper.HasFormat( SotClipboardFormatId::STRING ) || aDataHelper.HasFormat( SotClipboardFormatId::RTF )
|
||||
|| aDataHelper.HasFormat( SotClipboardFormatId::RICHTEXT ) );
|
||||
}
|
||||
|
||||
SfxWhichIter aIter( rSet );
|
||||
@ -524,6 +526,8 @@ void ScDrawTextObjectBar::GetClipState( SfxItemSet& rSet )
|
||||
aFormats.AddClipbrdFormat( SotClipboardFormatId::STRING );
|
||||
if ( aDataHelper.HasFormat( SotClipboardFormatId::RTF ) )
|
||||
aFormats.AddClipbrdFormat( SotClipboardFormatId::RTF );
|
||||
if ( aDataHelper.HasFormat( SotClipboardFormatId::RICHTEXT ) )
|
||||
aFormats.AddClipbrdFormat( SotClipboardFormatId::RICHTEXT );
|
||||
|
||||
rSet.Put( aFormats );
|
||||
}
|
||||
|
@ -118,6 +118,7 @@ void ScDrawTextObjectBar::ExecutePasteContents( SfxRequest & /* rReq */ )
|
||||
|
||||
pDlg->Insert( SotClipboardFormatId::STRING, EMPTY_OUSTRING );
|
||||
pDlg->Insert( SotClipboardFormatId::RTF, EMPTY_OUSTRING );
|
||||
pDlg->Insert( SotClipboardFormatId::RICHTEXT, EMPTY_OUSTRING );
|
||||
|
||||
TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pViewData->GetActiveWin() ) );
|
||||
|
||||
|
@ -446,6 +446,7 @@ void ScCellShell::GetPossibleClipboardFormats( SvxClipboardFormatItem& rFormats
|
||||
lcl_TestFormat( rFormats, aDataHelper, SotClipboardFormatId::STRING );
|
||||
lcl_TestFormat( rFormats, aDataHelper, SotClipboardFormatId::DIF );
|
||||
lcl_TestFormat( rFormats, aDataHelper, SotClipboardFormatId::RTF );
|
||||
lcl_TestFormat( rFormats, aDataHelper, SotClipboardFormatId::RICHTEXT );
|
||||
lcl_TestFormat( rFormats, aDataHelper, SotClipboardFormatId::HTML );
|
||||
lcl_TestFormat( rFormats, aDataHelper, SotClipboardFormatId::HTML_SIMPLE );
|
||||
lcl_TestFormat( rFormats, aDataHelper, SotClipboardFormatId::BIFF_8 );
|
||||
@ -471,6 +472,7 @@ static bool lcl_IsCellPastePossible( const TransferableDataHelper& rData )
|
||||
rData.HasFormat( SotClipboardFormatId::SVXB ) ||
|
||||
rData.HasFormat( SotClipboardFormatId::PRIVATE ) ||
|
||||
rData.HasFormat( SotClipboardFormatId::RTF ) ||
|
||||
rData.HasFormat( SotClipboardFormatId::RICHTEXT ) ||
|
||||
rData.HasFormat( SotClipboardFormatId::EMBED_SOURCE ) ||
|
||||
rData.HasFormat( SotClipboardFormatId::LINK_SOURCE ) ||
|
||||
rData.HasFormat( SotClipboardFormatId::EMBED_SOURCE_OLE ) ||
|
||||
|
@ -279,6 +279,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
|
||||
{
|
||||
pDlg->Insert( SotClipboardFormatId::STRING, EMPTY_OUSTRING );
|
||||
pDlg->Insert( SotClipboardFormatId::RTF, EMPTY_OUSTRING );
|
||||
pDlg->Insert( SotClipboardFormatId::RICHTEXT, EMPTY_OUSTRING );
|
||||
|
||||
TransferableDataHelper aDataHelper(
|
||||
TransferableDataHelper::CreateFromSystemClipboard( pViewData->GetActiveWin() ) );
|
||||
@ -799,7 +800,8 @@ const SvxURLField* ScEditShell::GetURLField()
|
||||
|
||||
IMPL_LINK( ScEditShell, ClipboardChanged, TransferableDataHelper*, pDataHelper, void )
|
||||
{
|
||||
bPastePossible = ( pDataHelper->HasFormat( SotClipboardFormatId::STRING ) || pDataHelper->HasFormat( SotClipboardFormatId::RTF ) );
|
||||
bPastePossible = ( pDataHelper->HasFormat( SotClipboardFormatId::STRING ) || pDataHelper->HasFormat( SotClipboardFormatId::RTF )
|
||||
|| pDataHelper->HasFormat( SotClipboardFormatId::RICHTEXT ) );
|
||||
|
||||
SfxBindings& rBindings = pViewData->GetBindings();
|
||||
rBindings.Invalidate( SID_PASTE );
|
||||
@ -818,7 +820,8 @@ void ScEditShell::GetClipState( SfxItemSet& rSet )
|
||||
|
||||
// get initial state
|
||||
TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pViewData->GetActiveWin() ) );
|
||||
bPastePossible = ( aDataHelper.HasFormat( SotClipboardFormatId::STRING ) || aDataHelper.HasFormat( SotClipboardFormatId::RTF ) );
|
||||
bPastePossible = ( aDataHelper.HasFormat( SotClipboardFormatId::STRING ) || aDataHelper.HasFormat( SotClipboardFormatId::RTF )
|
||||
|| aDataHelper.HasFormat( SotClipboardFormatId::RICHTEXT ) );
|
||||
}
|
||||
|
||||
SfxWhichIter aIter( rSet );
|
||||
|
@ -3826,6 +3826,7 @@ sal_Int8 ScGridWindow::AcceptDrop( const AcceptDropEvent& rEvt )
|
||||
IsDropFormatSupported( SotClipboardFormatId::DRAWING ) ||
|
||||
IsDropFormatSupported( SotClipboardFormatId::SVXB ) ||
|
||||
IsDropFormatSupported( SotClipboardFormatId::RTF ) ||
|
||||
IsDropFormatSupported( SotClipboardFormatId::RICHTEXT ) ||
|
||||
IsDropFormatSupported( SotClipboardFormatId::GDIMETAFILE ) ||
|
||||
IsDropFormatSupported( SotClipboardFormatId::PNG ) ||
|
||||
IsDropFormatSupported( SotClipboardFormatId::BITMAP ) ||
|
||||
@ -3925,10 +3926,10 @@ static SotClipboardFormatId lcl_GetDropFormatId( const uno::Reference<datatransf
|
||||
tools::SvRef<SotStorage> xStore( new SotStorage( *xStm ) );
|
||||
bDoRtf = ( ( aObjDesc.maClassName == SvGlobalName( SO3_SW_CLASSID ) ||
|
||||
aObjDesc.maClassName == SvGlobalName( SO3_SWWEB_CLASSID ) )
|
||||
&& aDataHelper.HasFormat( SotClipboardFormatId::RTF ) );
|
||||
&& ( aDataHelper.HasFormat( SotClipboardFormatId::RTF ) || aDataHelper.HasFormat( SotClipboardFormatId::RICHTEXT ) ) );
|
||||
}
|
||||
if ( bDoRtf )
|
||||
nFormatId = SotClipboardFormatId::RTF;
|
||||
nFormatId = aDataHelper.HasFormat( SotClipboardFormatId::RTF ) ? SotClipboardFormatId::RTF : SotClipboardFormatId::RICHTEXT;
|
||||
else
|
||||
nFormatId = SotClipboardFormatId::EMBED_SOURCE;
|
||||
}
|
||||
@ -3950,6 +3951,8 @@ static SotClipboardFormatId lcl_GetDropFormatId( const uno::Reference<datatransf
|
||||
nFormatId = SotClipboardFormatId::LINK_SOURCE_OLE;
|
||||
else if ( aDataHelper.HasFormat( SotClipboardFormatId::RTF ) )
|
||||
nFormatId = SotClipboardFormatId::RTF;
|
||||
else if ( aDataHelper.HasFormat( SotClipboardFormatId::RICHTEXT ) )
|
||||
nFormatId = SotClipboardFormatId::RICHTEXT;
|
||||
else if ( aDataHelper.HasFormat( SotClipboardFormatId::HTML ) )
|
||||
nFormatId = SotClipboardFormatId::HTML;
|
||||
else if ( aDataHelper.HasFormat( SotClipboardFormatId::HTML_SIMPLE ) )
|
||||
|
@ -529,6 +529,10 @@ void ScViewFunc::PasteFromSystem()
|
||||
{
|
||||
PasteFromSystem( SotClipboardFormatId::RTF );
|
||||
}
|
||||
else if( aDataHelper.HasFormat( SotClipboardFormatId::RICHTEXT ) )
|
||||
{
|
||||
PasteFromSystem( SotClipboardFormatId::RICHTEXT );
|
||||
}
|
||||
else
|
||||
{
|
||||
PasteFromSystem( SotClipboardFormatId::DRAWING );
|
||||
@ -548,10 +552,10 @@ void ScViewFunc::PasteFromSystem()
|
||||
{
|
||||
bDoRtf = ( ( aObjDesc.maClassName == SvGlobalName( SO3_SW_CLASSID ) ||
|
||||
aObjDesc.maClassName == SvGlobalName( SO3_SWWEB_CLASSID ) )
|
||||
&& aDataHelper.HasFormat( SotClipboardFormatId::RTF ) );
|
||||
&& ( aDataHelper.HasFormat( SotClipboardFormatId::RTF ) || aDataHelper.HasFormat( SotClipboardFormatId::RICHTEXT ) ) );
|
||||
}
|
||||
if ( bDoRtf )
|
||||
PasteFromSystem( SotClipboardFormatId::RTF );
|
||||
PasteFromSystem( aDataHelper.HasFormat( SotClipboardFormatId::RTF ) ? SotClipboardFormatId::RTF : SotClipboardFormatId::RICHTEXT );
|
||||
else if ( aObjDesc.maClassName == SvGlobalName( 0,0,0,0,0,0,0,0,0,0,0 )
|
||||
&& aDataHelper.HasFormat( SotClipboardFormatId::SYLK ))
|
||||
PasteFromSystem( SotClipboardFormatId::SYLK );
|
||||
@ -570,6 +574,8 @@ void ScViewFunc::PasteFromSystem()
|
||||
PasteFromSystem(nBiff5);
|
||||
else if (aDataHelper.HasFormat(SotClipboardFormatId::RTF))
|
||||
PasteFromSystem(SotClipboardFormatId::RTF);
|
||||
else if (aDataHelper.HasFormat(SotClipboardFormatId::RICHTEXT))
|
||||
PasteFromSystem(SotClipboardFormatId::RICHTEXT);
|
||||
else if (aDataHelper.HasFormat(SotClipboardFormatId::HTML))
|
||||
PasteFromSystem(SotClipboardFormatId::HTML);
|
||||
else if (aDataHelper.HasFormat(SotClipboardFormatId::HTML_SIMPLE))
|
||||
@ -648,10 +654,10 @@ void ScViewFunc::PasteFromTransferable( const uno::Reference<datatransfer::XTran
|
||||
{
|
||||
bDoRtf = ( ( aObjDesc.maClassName == SvGlobalName( SO3_SW_CLASSID ) ||
|
||||
aObjDesc.maClassName == SvGlobalName( SO3_SWWEB_CLASSID ) )
|
||||
&& aDataHelper.HasFormat( SotClipboardFormatId::RTF ) );
|
||||
&& ( aDataHelper.HasFormat( SotClipboardFormatId::RTF ) || aDataHelper.HasFormat( SotClipboardFormatId::RICHTEXT ) ));
|
||||
}
|
||||
if ( bDoRtf )
|
||||
nFormatId = SotClipboardFormatId::RTF;
|
||||
nFormatId = aDataHelper.HasFormat( SotClipboardFormatId::RTF ) ? SotClipboardFormatId::RTF : SotClipboardFormatId::RICHTEXT;
|
||||
else
|
||||
nFormatId = SotClipboardFormatId::EMBED_SOURCE;
|
||||
}
|
||||
@ -667,6 +673,8 @@ void ScViewFunc::PasteFromTransferable( const uno::Reference<datatransfer::XTran
|
||||
nFormatId = nBiff5;
|
||||
else if (aDataHelper.HasFormat(SotClipboardFormatId::RTF))
|
||||
nFormatId = SotClipboardFormatId::RTF;
|
||||
else if (aDataHelper.HasFormat(SotClipboardFormatId::RICHTEXT))
|
||||
nFormatId = SotClipboardFormatId::RICHTEXT;
|
||||
else if (aDataHelper.HasFormat(SotClipboardFormatId::HTML))
|
||||
nFormatId = SotClipboardFormatId::HTML;
|
||||
else if (aDataHelper.HasFormat(SotClipboardFormatId::HTML_SIMPLE))
|
||||
|
@ -166,6 +166,10 @@ void ScViewFunc::PasteRTF( SCCOL nStartCol, SCROW nStartRow,
|
||||
aImpEx.ImportStream( *xStream, OUString(), SotClipboardFormatId::RTF );
|
||||
else if ( aDataHelper.GetString( SotClipboardFormatId::RTF, aStr ) )
|
||||
aImpEx.ImportString( aStr, SotClipboardFormatId::RTF );
|
||||
else if ( aDataHelper.GetSotStorageStream( SotClipboardFormatId::RICHTEXT, xStream ) && xStream.Is() )
|
||||
aImpEx.ImportStream( *xStream, OUString(), SotClipboardFormatId::RICHTEXT );
|
||||
else if ( aDataHelper.GetString( SotClipboardFormatId::RICHTEXT, aStr ) )
|
||||
aImpEx.ImportString( aStr, SotClipboardFormatId::RICHTEXT );
|
||||
|
||||
AdjustRowHeight( nStartRow, aImpEx.GetRange().aEnd.Row() );
|
||||
pDocSh->UpdateOle(&GetViewData());
|
||||
|
@ -445,8 +445,10 @@ void SdTransferable::AddSupportedFormats()
|
||||
AddFormat( SotClipboardFormatId::BITMAP );
|
||||
}
|
||||
|
||||
if( lcl_HasOnlyOneTable( mpSdDrawDocument ) )
|
||||
if( lcl_HasOnlyOneTable( mpSdDrawDocument ) ) {
|
||||
AddFormat( SotClipboardFormatId::RTF );
|
||||
AddFormat( SotClipboardFormatId::RICHTEXT );
|
||||
}
|
||||
}
|
||||
|
||||
if( mpImageMap )
|
||||
|
@ -253,6 +253,7 @@ void FuInsertClipboard::DoExecute( SfxRequest& )
|
||||
pDlg->Insert( SotClipboardFormatId::STRING, OUString() );
|
||||
pDlg->Insert( SotClipboardFormatId::HTML, OUString() );
|
||||
pDlg->Insert( SotClipboardFormatId::RTF, OUString() );
|
||||
pDlg->Insert( SotClipboardFormatId::RICHTEXT, OUString() );
|
||||
pDlg->Insert( SotClipboardFormatId::EDITENGINE, OUString() );
|
||||
|
||||
//TODO/MBA: testing
|
||||
|
@ -157,6 +157,7 @@ using namespace ::com::sun::star::linguistic2;
|
||||
case SotClipboardFormatId::STRING:
|
||||
case SotClipboardFormatId::HTML:
|
||||
case SotClipboardFormatId::RTF:
|
||||
case SotClipboardFormatId::RICHTEXT:
|
||||
case SotClipboardFormatId::EDITENGINE:
|
||||
pResult->AddClipbrdFormat(nTestFormat);
|
||||
break;
|
||||
|
@ -707,6 +707,7 @@ IMPL_LINK( OutlineViewShell, ClipboardChanged, TransferableDataHelper*, pDataHel
|
||||
bPastePossible = pDataHelper->GetFormatCount() != 0 &&
|
||||
( pDataHelper->HasFormat( SotClipboardFormatId::STRING ) ||
|
||||
pDataHelper->HasFormat( SotClipboardFormatId::RTF ) ||
|
||||
pDataHelper->HasFormat( SotClipboardFormatId::RICHTEXT ) ||
|
||||
pDataHelper->HasFormat( SotClipboardFormatId::HTML ) );
|
||||
|
||||
SfxBindings& rBindings = GetViewFrame()->GetBindings();
|
||||
@ -890,6 +891,7 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet )
|
||||
bPastePossible = ( aDataHelper.GetFormatCount() != 0 &&
|
||||
( aDataHelper.HasFormat( SotClipboardFormatId::STRING ) ||
|
||||
aDataHelper.HasFormat( SotClipboardFormatId::RTF ) ||
|
||||
aDataHelper.HasFormat( SotClipboardFormatId::RICHTEXT ) ||
|
||||
aDataHelper.HasFormat( SotClipboardFormatId::HTML ) ) );
|
||||
}
|
||||
|
||||
|
@ -327,14 +327,16 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
|
||||
|
||||
bool bTable = false;
|
||||
// check special cases for pasting table formats as RTL
|
||||
if( !bLink && (nFormat == SotClipboardFormatId::NONE || (nFormat == SotClipboardFormatId::RTF)) )
|
||||
if( !bLink && (nFormat == SotClipboardFormatId::NONE || (nFormat == SotClipboardFormatId::RTF) || (nFormat == SotClipboardFormatId::RICHTEXT)) )
|
||||
{
|
||||
// if the objekt supports rtf and there is a table involved, default is to create a table
|
||||
if( aDataHelper.HasFormat( SotClipboardFormatId::RTF ) && ! aDataHelper.HasFormat( SotClipboardFormatId::DRAWING ) )
|
||||
bool bIsRTF = aDataHelper.HasFormat( SotClipboardFormatId::RTF );
|
||||
if( ( bIsRTF || aDataHelper.HasFormat( SotClipboardFormatId::RICHTEXT ) )
|
||||
&& ! aDataHelper.HasFormat( SotClipboardFormatId::DRAWING ) )
|
||||
{
|
||||
::tools::SvRef<SotStorageStream> xStm;
|
||||
|
||||
if( aDataHelper.GetSotStorageStream( SotClipboardFormatId::RTF, xStm ) )
|
||||
if( aDataHelper.GetSotStorageStream( bIsRTF ? SotClipboardFormatId::RTF : SotClipboardFormatId::RICHTEXT, xStm ) )
|
||||
{
|
||||
xStm->Seek( 0 );
|
||||
|
||||
@ -345,7 +347,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
|
||||
if (x != -1)
|
||||
{
|
||||
bTable = true;
|
||||
nFormat = SotClipboardFormatId::RTF;
|
||||
nFormat = bIsRTF ? SotClipboardFormatId::RTF : SotClipboardFormatId::RICHTEXT;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1419,11 +1421,12 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
|
||||
}
|
||||
}
|
||||
|
||||
if(!bReturn && !bLink && CHECK_FORMAT_TRANS(SotClipboardFormatId::RTF))
|
||||
bool bIsRTF = false;
|
||||
if(!bReturn && !bLink && (( bIsRTF = CHECK_FORMAT_TRANS(SotClipboardFormatId::RTF) ) || CHECK_FORMAT_TRANS(SotClipboardFormatId::RICHTEXT) ))
|
||||
{
|
||||
::tools::SvRef<SotStorageStream> xStm;
|
||||
|
||||
if( aDataHelper.GetSotStorageStream( SotClipboardFormatId::RTF, xStm ) )
|
||||
if( aDataHelper.GetSotStorageStream( bIsRTF ? SotClipboardFormatId::RTF : SotClipboardFormatId::RICHTEXT, xStm ) )
|
||||
{
|
||||
xStm->Seek( 0 );
|
||||
|
||||
|
@ -434,6 +434,7 @@ bool SfxApplication::InitializeDde()
|
||||
|
||||
// we certainly want to support RTF!
|
||||
pImpl->pDdeService->AddFormat( SotClipboardFormatId::RTF );
|
||||
pImpl->pDdeService->AddFormat( SotClipboardFormatId::RICHTEXT );
|
||||
|
||||
// Config path as a topic because of multiple starts
|
||||
INetURLObject aOfficeLockFile( SvtPathOptions().GetUserConfigPath() );
|
||||
|
@ -203,6 +203,7 @@ namespace
|
||||
/*142 SotClipboardFormatId::STARWRITERGLOB_8_TEMPLATE*/ { MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL_TEMPLATE_ASCII, "Writer/Global 8 Template", &cppu::UnoType<Sequence<sal_Int8>>::get() },
|
||||
/*143 SotClipboardFormatId::MATHML*/ { "application/mathml+xml", "MathML", &::cppu::UnoType<const Sequence< sal_Int8 >>::get() },
|
||||
/*144 SotClipboardFormatId::JPEG*/ { "image/jpeg", "JPEG Bitmap", &cppu::UnoType<Sequence<sal_Int8>>::get() },
|
||||
/*145 SotClipboardFormatId::RICHTEXT*/ { "text/richtext", "Richtext Format", &cppu::UnoType<Sequence<sal_Int8>>::get() }
|
||||
};
|
||||
return &aInstance[0];
|
||||
}
|
||||
|
@ -195,6 +195,7 @@ static SotAction_Impl const aEXCHG_DEST_DOC_TEXTFRAME_Move[] = \
|
||||
{ SotClipboardFormatId::HTML_NO_COMMENT, EXCHG_OUT_ACTION_INSERT_HTML, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },\
|
||||
{ SotClipboardFormatId::HTML_SIMPLE, EXCHG_OUT_ACTION_INSERT_HTML, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },\
|
||||
{ SotClipboardFormatId::RTF, EXCHG_IN_ACTION_COPY, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },\
|
||||
{ SotClipboardFormatId::RICHTEXT, EXCHG_IN_ACTION_COPY, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },\
|
||||
{ SotClipboardFormatId::NETSCAPE_IMAGE, EXCHG_IN_ACTION_COPY, SotExchangeActionFlags::InsertTargetUrl, 0 }, \
|
||||
{ SotClipboardFormatId::STRING, EXCHG_OUT_ACTION_INSERT_STRING, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },\
|
||||
{ SotClipboardFormatId::GDIMETAFILE, EXCHG_OUT_ACTION_INSERT_GDIMETAFILE, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },\
|
||||
@ -226,6 +227,7 @@ static SotAction_Impl const aEXCHG_DEST_DOC_TEXTFRAME_Copy[] = \
|
||||
{ SotClipboardFormatId::HTML_NO_COMMENT, EXCHG_OUT_ACTION_INSERT_HTML, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },\
|
||||
{ SotClipboardFormatId::HTML_SIMPLE, EXCHG_OUT_ACTION_INSERT_HTML, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },\
|
||||
{ SotClipboardFormatId::RTF, EXCHG_IN_ACTION_COPY, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },\
|
||||
{ SotClipboardFormatId::RICHTEXT, EXCHG_IN_ACTION_COPY, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },\
|
||||
{ SotClipboardFormatId::NETSCAPE_IMAGE, EXCHG_IN_ACTION_COPY, SotExchangeActionFlags::InsertTargetUrl, 0 }, \
|
||||
{ SotClipboardFormatId::STRING, EXCHG_OUT_ACTION_INSERT_STRING, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },\
|
||||
{ SotClipboardFormatId::NETSCAPE_BOOKMARK, EXCHG_OUT_ACTION_INSERT_HYPERLINK, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },\
|
||||
@ -292,6 +294,7 @@ static SotAction_Impl const aEXCHG_DEST_DOC_TEXTFRAME_WEB_Move[] = \
|
||||
{ SotClipboardFormatId::HTML_NO_COMMENT, EXCHG_OUT_ACTION_INSERT_HTML, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },\
|
||||
{ SotClipboardFormatId::HTML_SIMPLE, EXCHG_OUT_ACTION_INSERT_HTML, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },\
|
||||
{ SotClipboardFormatId::RTF, EXCHG_IN_ACTION_COPY, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },\
|
||||
{ SotClipboardFormatId::RICHTEXT, EXCHG_IN_ACTION_COPY, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },\
|
||||
{ SotClipboardFormatId::NETSCAPE_IMAGE, EXCHG_IN_ACTION_COPY, SotExchangeActionFlags::InsertTargetUrl, 0 }, \
|
||||
{ SotClipboardFormatId::STRING, EXCHG_OUT_ACTION_INSERT_STRING, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },\
|
||||
{ SotClipboardFormatId::GDIMETAFILE, EXCHG_OUT_ACTION_INSERT_GDIMETAFILE, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },\
|
||||
@ -317,6 +320,7 @@ static SotAction_Impl const aEXCHG_DEST_DOC_TEXTFRAME_WEB_Copy[] = \
|
||||
{ SotClipboardFormatId::HTML_NO_COMMENT, EXCHG_OUT_ACTION_INSERT_HTML, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },\
|
||||
{ SotClipboardFormatId::HTML_SIMPLE, EXCHG_OUT_ACTION_INSERT_HTML, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },\
|
||||
{ SotClipboardFormatId::RTF, EXCHG_IN_ACTION_COPY, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },\
|
||||
{ SotClipboardFormatId::RICHTEXT, EXCHG_IN_ACTION_COPY, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },\
|
||||
{ SotClipboardFormatId::NETSCAPE_IMAGE, EXCHG_IN_ACTION_COPY, SotExchangeActionFlags::InsertTargetUrl, 0 }, \
|
||||
{ SotClipboardFormatId::STRING, EXCHG_OUT_ACTION_INSERT_STRING, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },\
|
||||
{ SotClipboardFormatId::NETSCAPE_BOOKMARK, EXCHG_OUT_ACTION_INSERT_HYPERLINK, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },\
|
||||
@ -832,6 +836,7 @@ static SotAction_Impl const aEXCHG_DEST_SWDOC_FREE_AREA_Def[] = \
|
||||
{ SotClipboardFormatId::HTML_NO_COMMENT, EXCHG_IN_ACTION_COPY }, \
|
||||
{ SotClipboardFormatId::HTML_SIMPLE, EXCHG_IN_ACTION_COPY }, \
|
||||
{ SotClipboardFormatId::RTF, EXCHG_IN_ACTION_COPY }, \
|
||||
{ SotClipboardFormatId::RICHTEXT, EXCHG_IN_ACTION_COPY }, \
|
||||
{ SotClipboardFormatId::SVIM, EXCHG_IN_ACTION_COPY }, \
|
||||
{ SotClipboardFormatId::NETSCAPE_IMAGE, EXCHG_IN_ACTION_COPY }, \
|
||||
{ SotClipboardFormatId::STRING, EXCHG_IN_ACTION_COPY }, \
|
||||
@ -868,6 +873,7 @@ static SotAction_Impl const aEXCHG_DEST_SWDOC_FREE_AREA_Move[] = \
|
||||
{ SotClipboardFormatId::HTML_NO_COMMENT, EXCHG_OUT_ACTION_INSERT_HTML, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },\
|
||||
{ SotClipboardFormatId::HTML_SIMPLE, EXCHG_OUT_ACTION_INSERT_HTML, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },\
|
||||
{ SotClipboardFormatId::RTF, EXCHG_IN_ACTION_COPY, SotExchangeActionFlags::InsertTargetUrl, 0 }, \
|
||||
{ SotClipboardFormatId::RICHTEXT, EXCHG_IN_ACTION_COPY, SotExchangeActionFlags::InsertTargetUrl, 0 }, \
|
||||
{ SotClipboardFormatId::STRING, EXCHG_OUT_ACTION_INSERT_STRING }, \
|
||||
{ SotClipboardFormatId::GDIMETAFILE, EXCHG_OUT_ACTION_INSERT_GDIMETAFILE, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },\
|
||||
{ SotClipboardFormatId::PNG, EXCHG_OUT_ACTION_INSERT_BITMAP, SotExchangeActionFlags::InsertImageMap | SotExchangeActionFlags::InsertTargetUrl, 0 },\
|
||||
|
@ -35,6 +35,10 @@ String STR_FORMAT_RTF
|
||||
{
|
||||
Text [ en-US ] = "Formatted text [RTF]" ;
|
||||
};
|
||||
String STR_FORMAT_ID_RICHTEXT
|
||||
{
|
||||
Text [ en-US ] = "Formatted text [Richtext]" ;
|
||||
};
|
||||
String STR_FORMAT_ID_DRAWING
|
||||
{
|
||||
Text [ en-US ] = "Drawing format";
|
||||
|
@ -263,7 +263,8 @@ OUString SvPasteObjectHelper::GetSotFormatUIName( SotClipboardFormatId nId )
|
||||
{ SotClipboardFormatId::DBACCESS_COMMAND, STR_FORMAT_ID_DBACCESS_COMMAND },
|
||||
{ SotClipboardFormatId::DIALOG_60, STR_FORMAT_ID_DIALOG_60 },
|
||||
{ SotClipboardFormatId::FILEGRPDESCRIPTOR, STR_FORMAT_ID_FILEGRPDESCRIPTOR },
|
||||
{ SotClipboardFormatId::HTML_NO_COMMENT, STR_FORMAT_ID_HTML_NO_COMMENT }
|
||||
{ SotClipboardFormatId::HTML_NO_COMMENT, STR_FORMAT_ID_HTML_NO_COMMENT },
|
||||
{ SotClipboardFormatId::RICHTEXT, STR_FORMAT_ID_RICHTEXT },
|
||||
};
|
||||
|
||||
OUString aUIName;
|
||||
|
@ -1271,6 +1271,10 @@ void TransferableDataHelper::FillDataFlavorExVector( const Sequence< DataFlavor
|
||||
{
|
||||
rDataFlavorExVector[ rDataFlavorExVector.size() - 1 ].mnSotId = SotClipboardFormatId::RTF;
|
||||
}
|
||||
else if( xMimeType.is() && xMimeType->getFullMediaType().equalsIgnoreAsciiCase( "text/richtext" ) )
|
||||
{
|
||||
rDataFlavorExVector[ rDataFlavorExVector.size() - 1 ].mnSotId = SotClipboardFormatId::RICHTEXT;
|
||||
}
|
||||
else if( xMimeType.is() && xMimeType->getFullMediaType().equalsIgnoreAsciiCase( "text/html" ) )
|
||||
|
||||
{
|
||||
|
@ -51,6 +51,7 @@ bool SwServerObject::GetData( uno::Any & rData,
|
||||
break;
|
||||
|
||||
case SotClipboardFormatId::RTF:
|
||||
case SotClipboardFormatId::RICHTEXT:
|
||||
// mba: no BaseURL for data exchange
|
||||
::GetRTFWriter( OUString(), OUString(), xWrt );
|
||||
break;
|
||||
|
@ -1244,6 +1244,7 @@ static void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, SwSectionNode& rSectNd )
|
||||
pRead = ReadAscii;
|
||||
break;
|
||||
|
||||
case SotClipboardFormatId::RICHTEXT:
|
||||
case SotClipboardFormatId::RTF:
|
||||
pRead = SwReaderWriter::GetRtfReader();
|
||||
break;
|
||||
|
@ -144,6 +144,7 @@ extern bool g_bExecuteDrag;
|
||||
#define SWTRANSFER_OBJECTTYPE_STRING static_cast<SotClipboardFormatId>(0x00000008)
|
||||
#define SWTRANSFER_OBJECTTYPE_SWOLE static_cast<SotClipboardFormatId>(0x00000010)
|
||||
#define SWTRANSFER_OBJECTTYPE_DDE static_cast<SotClipboardFormatId>(0x00000020)
|
||||
#define SWTRANSFER_OBJECTTYPE_RICHTEXT static_cast<SotClipboardFormatId>(0x00000040)
|
||||
|
||||
using namespace ::svx;
|
||||
using namespace ::com::sun::star;
|
||||
@ -547,7 +548,13 @@ bool SwTransferable::GetData( const DataFlavor& rFlavor, const OUString& rDestDo
|
||||
SwDoc *const pDoc = lcl_GetDoc(*m_pClpDocFac);
|
||||
bOK = SetObject( pDoc, SWTRANSFER_OBJECTTYPE_RTF, rFlavor );
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case SotClipboardFormatId::RICHTEXT:
|
||||
{
|
||||
SwDoc *const pDoc = lcl_GetDoc(*m_pClpDocFac);
|
||||
bOK = SetObject( pDoc, SWTRANSFER_OBJECTTYPE_RICHTEXT, rFlavor );
|
||||
}
|
||||
break;
|
||||
|
||||
case SotClipboardFormatId::HTML:
|
||||
{
|
||||
@ -719,6 +726,7 @@ bool SwTransferable::WriteObject( tools::SvRef<SotStorageStream>& xStream,
|
||||
break;
|
||||
|
||||
case SWTRANSFER_OBJECTTYPE_RTF:
|
||||
case SWTRANSFER_OBJECTTYPE_RICHTEXT:
|
||||
GetRTFWriter( aEmptyOUStr, OUString(), xWrt );
|
||||
break;
|
||||
|
||||
@ -927,6 +935,7 @@ int SwTransferable::PrepareForCopy( bool bIsCut )
|
||||
if( !m_pWrtShell->IsObjSelected() )
|
||||
{
|
||||
AddFormat( SotClipboardFormatId::RTF );
|
||||
AddFormat( SotClipboardFormatId::RICHTEXT );
|
||||
AddFormat( SotClipboardFormatId::HTML );
|
||||
}
|
||||
if( m_pWrtShell->IsSelection() )
|
||||
@ -1066,6 +1075,7 @@ int SwTransferable::CopyGlossary( SwTextBlocks& rGlossary, const OUString& rStr
|
||||
//When someone needs it, we 'OLE' her something.
|
||||
AddFormat( SotClipboardFormatId::EMBED_SOURCE );
|
||||
AddFormat( SotClipboardFormatId::RTF );
|
||||
AddFormat( SotClipboardFormatId::RICHTEXT );
|
||||
AddFormat( SotClipboardFormatId::HTML );
|
||||
AddFormat( SotClipboardFormatId::STRING );
|
||||
|
||||
@ -1168,6 +1178,11 @@ bool SwTransferable::Paste(SwWrtShell& rSh, TransferableDataHelper& rData, sal_u
|
||||
nAction = EXCHG_OUT_ACTION_INSERT_STRING;
|
||||
nFormat = SotClipboardFormatId::RTF;
|
||||
}
|
||||
else if( rData.HasFormat( SotClipboardFormatId::RICHTEXT ) )
|
||||
{
|
||||
nAction = EXCHG_OUT_ACTION_INSERT_STRING;
|
||||
nFormat = SotClipboardFormatId::RICHTEXT;
|
||||
}
|
||||
}
|
||||
|
||||
return EXCHG_INOUT_ACTION_NONE != nAction &&
|
||||
@ -1324,6 +1339,7 @@ bool SwTransferable::PasteData( TransferableDataHelper& rData,
|
||||
case SotClipboardFormatId::HTML_SIMPLE:
|
||||
case SotClipboardFormatId::HTML_NO_COMMENT:
|
||||
case SotClipboardFormatId::RTF:
|
||||
case SotClipboardFormatId::RICHTEXT:
|
||||
case SotClipboardFormatId::STRING:
|
||||
bRet = SwTransferable::PasteFileContent( rData, rSh,
|
||||
nFormat, bMsg );
|
||||
@ -1658,7 +1674,7 @@ bool SwTransferable::PasteFileContent( TransferableDataHelper& rData,
|
||||
else
|
||||
{
|
||||
pStream = xStrm.get();
|
||||
if( SotClipboardFormatId::RTF == nFormat )
|
||||
if( SotClipboardFormatId::RTF == nFormat || SotClipboardFormatId::RICHTEXT == nFormat)
|
||||
pRead = SwReaderWriter::GetRtfReader();
|
||||
else if( !pRead )
|
||||
{
|
||||
@ -2068,6 +2084,7 @@ bool SwTransferable::PasteDDE( TransferableDataHelper& rData,
|
||||
// do we want to read in a graphic now?
|
||||
SotClipboardFormatId nFormat;
|
||||
if( !rData.HasFormat( SotClipboardFormatId::RTF ) &&
|
||||
!rData.HasFormat( SotClipboardFormatId::RICHTEXT ) &&
|
||||
!rData.HasFormat( SotClipboardFormatId::HTML ) &&
|
||||
!rData.HasFormat( SotClipboardFormatId::STRING ) &&
|
||||
(rData.HasFormat( nFormat = SotClipboardFormatId::GDIMETAFILE ) ||
|
||||
@ -2856,6 +2873,7 @@ static SotClipboardFormatId aPasteSpecialIds[] =
|
||||
SotClipboardFormatId::HTML_SIMPLE,
|
||||
SotClipboardFormatId::HTML_NO_COMMENT,
|
||||
SotClipboardFormatId::RTF,
|
||||
SotClipboardFormatId::RICHTEXT,
|
||||
SotClipboardFormatId::STRING,
|
||||
SotClipboardFormatId::SONLK,
|
||||
SotClipboardFormatId::NETSCAPE_BOOKMARK,
|
||||
@ -3051,6 +3069,7 @@ void SwTransferable::SetDataForDragAndDrop( const Point& rSttPos )
|
||||
if( !m_pWrtShell->IsObjSelected() )
|
||||
{
|
||||
AddFormat( SotClipboardFormatId::RTF );
|
||||
AddFormat( SotClipboardFormatId::RICHTEXT );
|
||||
AddFormat( SotClipboardFormatId::HTML );
|
||||
}
|
||||
if( m_pWrtShell->IsSelection() )
|
||||
|
@ -921,6 +921,7 @@ void SwAnnotationShell::ExecClpbrd(SfxRequest &rReq)
|
||||
|
||||
pDlg->Insert( SotClipboardFormatId::STRING, OUString() );
|
||||
pDlg->Insert( SotClipboardFormatId::RTF, OUString() );
|
||||
pDlg->Insert( SotClipboardFormatId::RICHTEXT, OUString() );
|
||||
|
||||
TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( &rView.GetEditWin() ) );
|
||||
|
||||
@ -967,7 +968,8 @@ void SwAnnotationShell::StateClpbrd(SfxItemSet &rSet)
|
||||
OutlinerView* pOLV = pPostItMgr->GetActiveSidebarWin()->GetOutlinerView();
|
||||
|
||||
TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( &rView.GetEditWin() ) );
|
||||
bool bPastePossible = ( aDataHelper.HasFormat( SotClipboardFormatId::STRING ) || aDataHelper.HasFormat( SotClipboardFormatId::RTF ) );
|
||||
bool bPastePossible = ( aDataHelper.HasFormat( SotClipboardFormatId::STRING ) || aDataHelper.HasFormat( SotClipboardFormatId::RTF )
|
||||
|| aDataHelper.HasFormat( SotClipboardFormatId::RICHTEXT ));
|
||||
bPastePossible = bPastePossible && (pPostItMgr->GetActiveSidebarWin()->GetLayoutStatus()!=SwPostItHelper::DELETED);
|
||||
|
||||
SfxWhichIter aIter(rSet);
|
||||
@ -1003,6 +1005,8 @@ void SwAnnotationShell::StateClpbrd(SfxItemSet &rSet)
|
||||
SvxClipboardFormatItem aFormats( SID_CLIPBOARD_FORMAT_ITEMS );
|
||||
if ( aDataHelper.HasFormat( SotClipboardFormatId::RTF ) )
|
||||
aFormats.AddClipbrdFormat( SotClipboardFormatId::RTF );
|
||||
if ( aDataHelper.HasFormat( SotClipboardFormatId::RICHTEXT ) )
|
||||
aFormats.AddClipbrdFormat( SotClipboardFormatId::RICHTEXT );
|
||||
aFormats.AddClipbrdFormat( SotClipboardFormatId::STRING );
|
||||
rSet.Put( aFormats );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user