View | Details | Raw Unified | Return to issue 28535
Collapse All | Expand All

(-)sc/source/ui/inc/cellsh.hxx (+2 lines)
Lines 42-47 class SvxClipboardFmtItem; Link Here
42
class TransferableDataHelper;
42
class TransferableDataHelper;
43
class TransferableClipboardListener;
43
class TransferableClipboardListener;
44
class AbstractScLinkedAreaDlg;
44
class AbstractScLinkedAreaDlg;
45
class ScTabViewShell;
45
46
46
struct CellShell_Impl
47
struct CellShell_Impl
47
{
48
{
Lines 102-107 public: Link Here
102
	void		ExecutePageSel( SfxRequest& rReq );
103
	void		ExecutePageSel( SfxRequest& rReq );
103
	void		ExecuteMove( SfxRequest& rReq );
104
	void		ExecuteMove( SfxRequest& rReq );
104
	void		GetStateCursor( SfxItemSet& rSet );
105
	void		GetStateCursor( SfxItemSet& rSet );
106
	static void PasteFromClipboard( ScViewData* pViewData, ScTabViewShell* pTabViewShell, BOOL bShowDialog );
105
};
107
};
106
108
107
#endif
109
#endif
(-)sc/source/ui/inc/viewdata.hxx (+12 lines)
Lines 89-94 enum ScMarkType Link Here
89
#endif
89
#endif
90
};
90
};
91
91
92
enum ScPasteFlags
93
{
94
    SC_PASTE_NONE   = 0,    // No flags specified
95
    SC_PASTE_MODE   = 1,    // Enable paste-mode
96
    SC_PASTE_BORDER = 2,    // Show a border around the source cells
97
};
98
92
class ScDocShell;
99
class ScDocShell;
93
class ScDocument;
100
class ScDocument;
94
class ScDBFunc;
101
class ScDBFunc;
Lines 210-215 private: Link Here
210
	SCCOL				nTabStartCol;				// fuer Enter nach Tab
219
	SCCOL				nTabStartCol;				// fuer Enter nach Tab
211
	ScRange				aDelRange;					// fuer AutoFill-Loeschen
220
	ScRange				aDelRange;					// fuer AutoFill-Loeschen
212
221
222
	ScPasteFlags        nPasteFlags;
223
213
    ScSplitPos          eEditActivePart;            // the part that was active when edit mode was started
224
    ScSplitPos          eEditActivePart;            // the part that was active when edit mode was started
214
	BOOL				bEditActive[4];				// aktiv?
225
	BOOL				bEditActive[4];				// aktiv?
215
	BOOL				bActive;					// aktives Fenster ?
226
	BOOL				bActive;					// aktives Fenster ?
Lines 295-300 public: Link Here
295
	SCCOL			GetFixPosX() const						{ return pThisTab->nFixPosX; }
306
	SCCOL			GetFixPosX() const						{ return pThisTab->nFixPosX; }
296
	SCROW			GetFixPosY() const						{ return pThisTab->nFixPosY; }
307
	SCROW			GetFixPosY() const						{ return pThisTab->nFixPosY; }
297
	BOOL			IsPagebreakMode() const					{ return bPagebreak; }
308
	BOOL			IsPagebreakMode() const					{ return bPagebreak; }
309
	BOOL			IsPasteMode() const                     { return nPasteFlags & SC_PASTE_MODE; }
310
	BOOL			ShowPasteSource() const                 { return nPasteFlags & SC_PASTE_BORDER; }
298
311
299
	void			SetPosX( ScHSplitPos eWhich, SCCOL nNewPosX );
312
	void			SetPosX( ScHSplitPos eWhich, SCCOL nNewPosX );
300
	void			SetPosY( ScVSplitPos eWhich, SCROW nNewPosY );
313
	void			SetPosY( ScVSplitPos eWhich, SCROW nNewPosY );
Lines 309-314 public: Link Here
309
	void			SetFixPosX( SCCOL nPos )						{ pThisTab->nFixPosX = nPos; }
322
	void			SetFixPosX( SCCOL nPos )						{ pThisTab->nFixPosX = nPos; }
310
	void			SetFixPosY( SCROW nPos )						{ pThisTab->nFixPosY = nPos; }
323
	void			SetFixPosY( SCROW nPos )						{ pThisTab->nFixPosY = nPos; }
311
	void			SetPagebreakMode( BOOL bSet );
324
	void			SetPagebreakMode( BOOL bSet );
325
	void			SetPasteMode ( ScPasteFlags nFlags )            { nPasteFlags = nFlags; }
312
326
313
    void            SetZoomType( SvxZoomType eNew, BOOL bAll );
327
    void            SetZoomType( SvxZoomType eNew, BOOL bAll );
314
    void            SetZoom( const Fraction& rNewX, const Fraction& rNewY, BOOL bAll );
328
    void            SetZoom( const Fraction& rNewX, const Fraction& rNewY, BOOL bAll );
(-)sc/source/ui/view/cellsh1.cxx (-33 / +48 lines)
Lines 1168-1173 void ScCellShell::ExecuteEdit( SfxReques Link Here
1168
				WaitObject aWait( GetViewData()->GetDialogParent() );
1178
				WaitObject aWait( GetViewData()->GetDialogParent() );
1169
				pTabViewShell->CopyToClip( NULL, FALSE, FALSE, TRUE );
1179
				pTabViewShell->CopyToClip( NULL, FALSE, FALSE, TRUE );
1170
				rReq.Done();
1180
				rReq.Done();
1181
				GetViewData()->SetPasteMode( (ScPasteFlags) (SC_PASTE_MODE | SC_PASTE_BORDER) );
1182
				pTabViewShell->ShowCursor();
1171
			}
1183
			}
1172
			break;
1184
			break;
1173
1185
Lines 1176-1221 void ScCellShell::ExecuteEdit( SfxReques Link Here
1176
				WaitObject aWait( GetViewData()->GetDialogParent() );
1188
				WaitObject aWait( GetViewData()->GetDialogParent() );
1177
				pTabViewShell->CutToClip( NULL, TRUE );
1189
				pTabViewShell->CutToClip( NULL, TRUE );
1178
				rReq.Done();
1190
				rReq.Done();
1191
				GetViewData()->SetPasteMode( SC_PASTE_MODE );
1179
			}
1192
			}
1180
			break;
1193
			break;
1181
1194
1182
		case SID_PASTE:
1195
		case SID_PASTE:
1183
			{
1196
			{
1184
                Window* pWin = GetViewData()->GetActiveWin();
1197
				PasteFromClipboard ( GetViewData(), pTabViewShell, TRUE );
1185
                ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pWin );
1186
                ScDocument* pThisDoc = GetViewData()->GetDocument();
1187
                ScDPObject* pDPObj = pThisDoc->GetDPAtCursor( GetViewData()->GetCurX(),
1188
                                     GetViewData()->GetCurY(), GetViewData()->GetTabNo() );
1189
                if ( pOwnClip && pDPObj )
1190
                {
1191
                    // paste from Calc into DataPilot table: sort (similar to drag & drop)
1192
1193
                    ScDocument* pClipDoc = pOwnClip->GetDocument();
1194
                    SCTAB nSourceTab = pOwnClip->GetVisibleTab();
1195
1196
                    SCCOL nClipStartX;
1197
                    SCROW nClipStartY;
1198
                    SCCOL nClipEndX;
1199
                    SCROW nClipEndY;
1200
                    pClipDoc->GetClipStart( nClipStartX, nClipStartY );
1201
                    pClipDoc->GetClipArea( nClipEndX, nClipEndY, TRUE );
1202
                    nClipEndX = nClipEndX + nClipStartX;
1203
                    nClipEndY = nClipEndY + nClipStartY;   // GetClipArea returns the difference
1204
1205
                    ScRange aSource( nClipStartX, nClipStartY, nSourceTab, nClipEndX, nClipEndY, nSourceTab );
1206
                    BOOL bDone = pTabViewShell->DataPilotMove( aSource, GetViewData()->GetCurPos() );
1207
                    if ( !bDone )
1208
                        pTabViewShell->ErrorMessage( STR_ERR_DATAPILOT_INPUT );
1209
                }
1210
                else
1211
                {
1212
                    // normal paste
1213
                    WaitObject aWait( GetViewData()->GetDialogParent() );
1214
                    pTabViewShell->PasteFromSystem();
1215
                }
1216
				rReq.Done();
1198
				rReq.Done();
1217
			}
1199
			}
1218
			pTabViewShell->CellContentChanged();		// => PasteFromSystem() ???
1219
			break;
1200
			break;
1220
1201
1221
		case SID_CLIPBOARD_FORMAT_ITEMS:
1202
		case SID_CLIPBOARD_FORMAT_ITEMS:
Lines 2264-2266 IMPL_LINK( ScCellShell, DialogClosed, Ab Link Here
2264
    return 0;
2245
    return 0;
2265
}
2246
}
2266
2247
2248
void ScCellShell::PasteFromClipboard( ScViewData* pViewData, ScTabViewShell* pTabViewShell, BOOL bShowDialog )
2249
{
2250
    Window* pWin = pViewData->GetActiveWin();
2251
    ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pWin );
2252
    ScDocument* pThisDoc = pViewData->GetDocument();
2253
    ScDPObject* pDPObj = pThisDoc->GetDPAtCursor( pViewData->GetCurX(),
2254
                         pViewData->GetCurY(), pViewData->GetTabNo() );
2255
    if ( pOwnClip && pDPObj )
2256
    {
2257
        // paste from Calc into DataPilot table: sort (similar to drag & drop)
2258
2259
        ScDocument* pClipDoc = pOwnClip->GetDocument();
2260
        SCTAB nSourceTab = pOwnClip->GetVisibleTab();
2261
2262
        SCCOL nClipStartX;
2263
        SCROW nClipStartY;
2264
        SCCOL nClipEndX;
2265
        SCROW nClipEndY;
2266
        pClipDoc->GetClipStart( nClipStartX, nClipStartY );
2267
        pClipDoc->GetClipArea( nClipEndX, nClipEndY, TRUE );
2268
        nClipEndX = nClipEndX + nClipStartX;
2269
        nClipEndY = nClipEndY + nClipStartY;   // GetClipArea returns the difference
2270
2271
        ScRange aSource( nClipStartX, nClipStartY, nSourceTab, nClipEndX, nClipEndY, nSourceTab );
2272
        BOOL bDone = pTabViewShell->DataPilotMove( aSource, pViewData->GetCurPos() );
2273
        if ( !bDone )
2274
            pTabViewShell->ErrorMessage( STR_ERR_DATAPILOT_INPUT );
2275
    }
2276
    else
2277
    {
2278
        // normal paste
2279
        WaitObject aWait( pViewData->GetDialogParent() );
2280
        if (!pOwnClip)
2281
            pTabViewShell->PasteFromSystem();
2282
        else
2283
        {
2284
            pTabViewShell->PasteFromClip( IDF_ALL, pOwnClip->GetDocument(),
2285
                    PASTE_NOFUNC, FALSE, FALSE, FALSE, INS_NONE, IDF_NONE,
2286
                    bShowDialog );		// allow warning dialog
2287
        }
2288
    }
2289
    pTabViewShell->CellContentChanged();		// => PasteFromSystem() ???
2290
}
2291
(-)sc/source/ui/view/viewdata.cxx (+2 lines)
Lines 306-311 ScViewData::ScViewData( ScDocShell* pDocSh, ScTabViewShell* pViewSh ) Link Here
306
		eRefType	( SC_REFTYPE_NONE ),
306
		eRefType	( SC_REFTYPE_NONE ),
307
		nTabNo		( 0 ),
307
		nTabNo		( 0 ),
308
		nRefTabNo	( 0 ),
308
		nRefTabNo	( 0 ),
309
        nPasteFlags ( SC_PASTE_NONE ),
309
        eEditActivePart( SC_SPLIT_BOTTOMLEFT ),
310
        eEditActivePart( SC_SPLIT_BOTTOMLEFT ),
310
		bActive		( TRUE ),					//! wie initialisieren?
311
		bActive		( TRUE ),					//! wie initialisieren?
311
		bIsRefMode	( FALSE ),
312
		bIsRefMode	( FALSE ),
Lines 441-446 void ScViewData::InitFrom( const ScViewD Link Here
441
//UNUSED2008-05      aDefPageZoomX = pRef->aDefPageZoomX;
450
//UNUSED2008-05      aDefPageZoomX = pRef->aDefPageZoomX;
442
//UNUSED2008-05      aDefPageZoomY = pRef->aDefPageZoomY;
451
//UNUSED2008-05      aDefPageZoomY = pRef->aDefPageZoomY;
443
//UNUSED2008-05  	bPagebreak	= pRef->bPagebreak;
452
//UNUSED2008-05  	bPagebreak	= pRef->bPagebreak;
453
//UNUSED2008-05 	nPasteFlags = pRef->nPasteFlags;
444
//UNUSED2008-05  	aLogicMode	= pRef->aLogicMode;
454
//UNUSED2008-05  	aLogicMode	= pRef->aLogicMode;
445
//UNUSED2008-05  
455
//UNUSED2008-05  
446
//UNUSED2008-05  	SetGridMode		( pRef->IsGridMode() );
456
//UNUSED2008-05  	SetGridMode		( pRef->IsGridMode() );
(-)sc/source/ui/view/gridwin.cxx.old (-1 / +46 lines)
Lines 118-123 Link Here
118
#include "userdat.hxx"
118
#include "userdat.hxx"
119
#include "drwlayer.hxx"
119
#include "drwlayer.hxx"
120
#include "attrib.hxx"
120
#include "attrib.hxx"
121
#include "cellsh.hxx"
121
#include "tabprotection.hxx"
122
#include "tabprotection.hxx"
122
123
123
// #114409#
124
// #114409#
Lines 2934-2945 void ScGridWindow::SelectForContextMenu( Link Here
2934
    }
2935
    }
2935
}
2936
}
2936
2937
2938
static void ClearSingleSelection( ScViewData* pViewData )
2939
{
2940
    SCCOL nX;
2941
    SCROW nY;
2942
    ScTransferObj* pTransObj = ScTransferObj::GetOwnClipboard( 
2943
        pViewData->GetActiveWin() );
2944
    if (!pTransObj)
2945
        return;
2946
2947
    ScDocument* pClipDoc = pTransObj->GetDocument();
2948
    pClipDoc->GetClipArea( nX, nY, TRUE );
2949
    if (nX == 0 && nY == 0)
2950
    {
2951
        ScTabView* pView = pViewData->GetView();
2952
        pView->Unmark();
2953
    }
2954
}
2955
2937
void __EXPORT ScGridWindow::KeyInput(const KeyEvent& rKEvt)
2956
void __EXPORT ScGridWindow::KeyInput(const KeyEvent& rKEvt)
2938
{
2957
{
2939
    // #96965# Cursor control for ref input dialog
2958
    // #96965# Cursor control for ref input dialog
2959
    const KeyCode& rKeyCode = rKEvt.GetKeyCode();
2940
    if( SC_MOD()->IsRefDialogOpen() )
2960
    if( SC_MOD()->IsRefDialogOpen() )
2941
    {
2961
    {
2942
        const KeyCode& rKeyCode = rKEvt.GetKeyCode();
2943
        if( !rKeyCode.GetModifier() && (rKeyCode.GetCode() == KEY_F2) )
2962
        if( !rKeyCode.GetModifier() && (rKeyCode.GetCode() == KEY_F2) )
2944
        {
2963
        {
2945
            SC_MOD()->EndReference();
2964
            SC_MOD()->EndReference();
Lines 2954-2962 void __EXPORT ScGridWindow::KeyInput(con Link Here
2954
            return;
2973
            return;
2955
        }
2974
        }
2956
    }
2975
    }
2976
	else if( rKeyCode.GetCode() == KEY_RETURN && pViewData->IsPasteMode() )
2977
	{
2978
		ScTabViewShell* pTabViewShell = pViewData->GetViewShell();
2979
2980
		ScCellShell::PasteFromClipboard( pViewData, pTabViewShell, FALSE );
2981
		ClearSingleSelection( pViewData );
2982
2983
		uno::Reference<datatransfer::clipboard::XClipboard> xSystemClipboard = 
2984
			TransferableHelper::GetSystemClipboard();
2985
		if (xSystemClipboard.is())
2986
		{
2987
			xSystemClipboard->setContents(
2988
					uno::Reference<datatransfer::XTransferable>(),
2989
					uno::Reference<datatransfer::clipboard::XClipboardOwner>());
2990
		}
2991
2992
		// hide the border around the copy source
2993
		pViewData->SetPasteMode( SC_PASTE_NONE );
2994
		UpdateCursorOverlay();
2995
		return;
2996
	}
2957
	// wenn semi-Modeless-SfxChildWindow-Dialog oben, keine KeyInputs:
2997
	// wenn semi-Modeless-SfxChildWindow-Dialog oben, keine KeyInputs:
2958
    else if( !pViewData->IsAnyFillMode() )
2998
    else if( !pViewData->IsAnyFillMode() )
2959
	{
2999
	{
3000
		if (rKeyCode.GetCode() == KEY_ESCAPE)
3001
		{
3002
			pViewData->SetPasteMode( SC_PASTE_NONE );
3003
			UpdateCursorOverlay();
3004
		}
2960
		//	query for existing note marker before calling ViewShell's keyboard handling
3005
		//	query for existing note marker before calling ViewShell's keyboard handling
2961
		//	which may remove the marker
3006
		//	which may remove the marker
2962
		BOOL bHadKeyMarker = ( pNoteMarker && pNoteMarker->IsByKeyboard() );
3007
		BOOL bHadKeyMarker = ( pNoteMarker && pNoteMarker->IsByKeyboard() );
(-)sc/source/ui/app/inputhdl.cxx (+1 lines)
Lines 1699-1704 IMPL_LINK( ScInputHandler, ModifyHdl, vo Link Here
1699
1699
1700
BOOL ScInputHandler::DataChanging( sal_Unicode cTyped, BOOL bFromCommand )		// return TRUE = new view created
1700
BOOL ScInputHandler::DataChanging( sal_Unicode cTyped, BOOL bFromCommand )		// return TRUE = new view created
1701
{
1701
{
1702
	pActiveViewSh->GetViewData()->SetPasteMode( SC_PASTE_NONE );
1702
	bInOwnChange = TRUE;				// disable ModifyHdl (reset in DataChanged)
1703
	bInOwnChange = TRUE;				// disable ModifyHdl (reset in DataChanged)
1703
1704
1704
	if ( eMode == SC_INPUT_NONE )
1705
	if ( eMode == SC_INPUT_NONE )
(-)sc/source/ui/view/viewfunc.cxx (+1 lines)
Lines 1785-1790 void ScViewFunc::DeleteMulti( BOOL bRows Link Here
1785
1799
1786
void ScViewFunc::DeleteContents( USHORT nFlags, BOOL bRecord )
1800
void ScViewFunc::DeleteContents( USHORT nFlags, BOOL bRecord )
1787
{
1801
{
1802
	GetViewData()->SetPasteMode( SC_PASTE_NONE );
1788
	// nur wegen Matrix nicht editierbar? Attribute trotzdem ok
1803
	// nur wegen Matrix nicht editierbar? Attribute trotzdem ok
1789
	BOOL bOnlyNotBecauseOfMatrix;
1804
	BOOL bOnlyNotBecauseOfMatrix;
1790
	BOOL bEditable = SelectionEditable( &bOnlyNotBecauseOfMatrix );
1805
	BOOL bEditable = SelectionEditable( &bOnlyNotBecauseOfMatrix );

Return to issue 28535