diff options
Diffstat (limited to 'sc/source/ui/view')
-rw-r--r-- | sc/source/ui/view/cellsh.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/editsh.cxx | 14 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwshe.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun3.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun5.cxx | 6 |
6 files changed, 24 insertions, 6 deletions
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index 6c96acf74570..da7d1d30eeb4 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -464,6 +464,7 @@ void ScCellShell::GetPossibleClipboardFormats( SvxClipboardFormatItem& rFormats { lcl_TestFormat( rFormats, aDataHelper, SotClipboardFormatId::LINK ); lcl_TestFormat( rFormats, aDataHelper, SotClipboardFormatId::STRING ); + lcl_TestFormat( rFormats, aDataHelper, SotClipboardFormatId::STRING_TSVC ); lcl_TestFormat( rFormats, aDataHelper, SotClipboardFormatId::DIF ); lcl_TestFormat( rFormats, aDataHelper, SotClipboardFormatId::RTF ); lcl_TestFormat( rFormats, aDataHelper, SotClipboardFormatId::RICHTEXT ); @@ -499,6 +500,7 @@ static bool lcl_IsCellPastePossible( const TransferableDataHelper& rData ) rData.HasFormat( SotClipboardFormatId::LINK_SOURCE_OLE ) || rData.HasFormat( SotClipboardFormatId::EMBEDDED_OBJ_OLE ) || rData.HasFormat( SotClipboardFormatId::STRING ) || + rData.HasFormat( SotClipboardFormatId::STRING_TSVC ) || rData.HasFormat( SotClipboardFormatId::SYLK ) || rData.HasFormat( SotClipboardFormatId::LINK ) || rData.HasFormat( SotClipboardFormatId::HTML ) || diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index 42e8c4a6d0f4..3d1876798c88 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -280,6 +280,8 @@ void ScEditShell::Execute( SfxRequest& rReq ) pDlg->Insert( SotClipboardFormatId::STRING, EMPTY_OUSTRING ); pDlg->Insert( SotClipboardFormatId::RTF, EMPTY_OUSTRING ); pDlg->Insert( SotClipboardFormatId::RICHTEXT, EMPTY_OUSTRING ); + // Do not offer SotClipboardFormatId::STRING_TSVC for + // in-cell paste. TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pViewData->GetActiveWin() ) ); @@ -798,8 +800,9 @@ const SvxURLField* ScEditShell::GetURLField() IMPL_LINK( ScEditShell, ClipboardChanged, TransferableDataHelper*, pDataHelper, void ) { - bPastePossible = ( pDataHelper->HasFormat( SotClipboardFormatId::STRING ) || pDataHelper->HasFormat( SotClipboardFormatId::RTF ) - || pDataHelper->HasFormat( SotClipboardFormatId::RICHTEXT ) ); + bPastePossible = ( pDataHelper->HasFormat( SotClipboardFormatId::STRING ) + || pDataHelper->HasFormat( SotClipboardFormatId::RTF ) + || pDataHelper->HasFormat( SotClipboardFormatId::RICHTEXT )); SfxBindings& rBindings = pViewData->GetBindings(); rBindings.Invalidate( SID_PASTE ); @@ -809,6 +812,8 @@ IMPL_LINK( ScEditShell, ClipboardChanged, TransferableDataHelper*, pDataHelper, void ScEditShell::GetClipState( SfxItemSet& rSet ) { + // Do not offer SotClipboardFormatId::STRING_TSVC for in-cell paste. + if ( !mxClipEvtLstnr.is() ) { // create listener @@ -818,8 +823,9 @@ void ScEditShell::GetClipState( SfxItemSet& rSet ) // get initial state TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( pViewData->GetActiveWin() ) ); - bPastePossible = ( aDataHelper.HasFormat( SotClipboardFormatId::STRING ) || aDataHelper.HasFormat( SotClipboardFormatId::RTF ) - || aDataHelper.HasFormat( SotClipboardFormatId::RICHTEXT ) ); + bPastePossible = ( aDataHelper.HasFormat( SotClipboardFormatId::STRING ) + || aDataHelper.HasFormat( SotClipboardFormatId::RTF ) + || aDataHelper.HasFormat( SotClipboardFormatId::RICHTEXT ) ); } SfxWhichIter aIter( rSet ); diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 6741839dd5ea..b2b553f24700 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -3642,6 +3642,7 @@ sal_Int8 ScGridWindow::AcceptDrop( const AcceptDropEvent& rEvt ) IsDropFormatSupported( SotClipboardFormatId::LINK_SOURCE_OLE ) || IsDropFormatSupported( SotClipboardFormatId::EMBEDDED_OBJ_OLE ) || IsDropFormatSupported( SotClipboardFormatId::STRING ) || + IsDropFormatSupported( SotClipboardFormatId::STRING_TSVC ) || IsDropFormatSupported( SotClipboardFormatId::SYLK ) || IsDropFormatSupported( SotClipboardFormatId::LINK ) || IsDropFormatSupported( SotClipboardFormatId::HTML ) || @@ -3791,6 +3792,8 @@ static SotClipboardFormatId lcl_GetDropFormatId( const uno::Reference<datatransf nFormatId = SotClipboardFormatId::FILE_LIST; else if ( aDataHelper.HasFormat( SotClipboardFormatId::SIMPLE_FILE ) ) // #i62773# FILE_LIST/FILE before STRING (Unix file managers) nFormatId = SotClipboardFormatId::SIMPLE_FILE; + else if ( aDataHelper.HasFormat( SotClipboardFormatId::STRING_TSVC ) ) + nFormatId = SotClipboardFormatId::STRING_TSVC; else if ( aDataHelper.HasFormat( SotClipboardFormatId::STRING ) ) nFormatId = SotClipboardFormatId::STRING; else if ( aDataHelper.HasFormat( SotClipboardFormatId::GDIMETAFILE ) ) diff --git a/sc/source/ui/view/tabvwshe.cxx b/sc/source/ui/view/tabvwshe.cxx index 78e83bf3a3b9..fe0ae20854f3 100644 --- a/sc/source/ui/view/tabvwshe.cxx +++ b/sc/source/ui/view/tabvwshe.cxx @@ -97,6 +97,7 @@ OUString ScTabViewShell::GetSelectionText( bool bWholeWord ) ScImportExport aObj( pDoc, aRange ); aObj.SetFormulas( GetViewData().GetOptions().GetOption( VOPT_FORMULAS ) ); OUString aExportOUString; + /* TODO: STRING_TSVC under some circumstances? */ aObj.ExportString( aExportOUString, SotClipboardFormatId::STRING ); aStrSelection = convertLineEnd(aExportOUString, LINEEND_CR); diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index 4756372d151f..3f18067a8d3f 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -586,6 +586,8 @@ void ScViewFunc::PasteFromSystem() PasteFromSystem(SotClipboardFormatId::HTML_SIMPLE); else if (aDataHelper.HasFormat(SotClipboardFormatId::SYLK)) PasteFromSystem(SotClipboardFormatId::SYLK); + else if (aDataHelper.HasFormat(SotClipboardFormatId::STRING_TSVC)) + PasteFromSystem(SotClipboardFormatId::STRING_TSVC); else if (aDataHelper.HasFormat(SotClipboardFormatId::STRING)) PasteFromSystem(SotClipboardFormatId::STRING); // xxx_OLE formats come last, like in SotExchange tables @@ -685,6 +687,8 @@ void ScViewFunc::PasteFromTransferable( const uno::Reference<datatransfer::XTran nFormatId = SotClipboardFormatId::HTML_SIMPLE; else if (aDataHelper.HasFormat(SotClipboardFormatId::SYLK)) nFormatId = SotClipboardFormatId::SYLK; + else if (aDataHelper.HasFormat(SotClipboardFormatId::STRING_TSVC)) + nFormatId = SotClipboardFormatId::STRING_TSVC; else if (aDataHelper.HasFormat(SotClipboardFormatId::STRING)) nFormatId = SotClipboardFormatId::STRING; else if (aDataHelper.HasFormat(SotClipboardFormatId::GDIMETAFILE)) diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx index f1feed622442..7e3194ab64d4 100644 --- a/sc/source/ui/view/viewfun5.cxx +++ b/sc/source/ui/view/viewfun5.cxx @@ -327,7 +327,8 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId, bRet = aObj.ImportStream( *xStream, OUString(), nFormatId ); // mba: clipboard always must contain absolute URLs (could be from alien source) } - else if (nFormatId == SotClipboardFormatId::STRING && aDataHelper.GetString( nFormatId, aStr )) + else if ((nFormatId == SotClipboardFormatId::STRING || nFormatId == SotClipboardFormatId::STRING_TSVC) + && aDataHelper.GetString( nFormatId, aStr )) { // Do CSV dialog if more than one line. sal_Int32 nDelim = aStr.indexOf('\n'); @@ -362,7 +363,8 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId, else bRet = aObj.ImportString( aStr, nFormatId ); } - else if (nFormatId != SotClipboardFormatId::STRING && aDataHelper.GetString( nFormatId, aStr )) + else if ((nFormatId != SotClipboardFormatId::STRING && nFormatId != SotClipboardFormatId::STRING_TSVC) + && aDataHelper.GetString( nFormatId, aStr )) bRet = aObj.ImportString( aStr, nFormatId ); InvalidateAttribs(); |