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

(-)sc/inc/global.hxx (+1 lines)
Lines 236-241 const BYTE CR_MANUALSIZE = 32; Link Here
236
#define CR_SAVEMASK		( ~CR_PAGEBREAK )
236
#define CR_SAVEMASK		( ~CR_PAGEBREAK )
237
237
238
									// Insert-/Delete-Flags
238
									// Insert-/Delete-Flags
239
#define IDF_SPECIAL_NOMARKAREA  0x2000
239
#define IDF_VALUE			0x0001
240
#define IDF_VALUE			0x0001
240
#define IDF_DATETIME		0x0002
241
#define IDF_DATETIME		0x0002
241
#define IDF_STRING			0x0004
242
#define IDF_STRING			0x0004
(-)sc/source/ui/inc/cellsh.hxx (+2 lines)
Lines 60-65 class SvxClipboardFmtItem; Link Here
60
class TransferableDataHelper;
60
class TransferableDataHelper;
61
class TransferableClipboardListener;
61
class TransferableClipboardListener;
62
class AbstractScLinkedAreaDlg;
62
class AbstractScLinkedAreaDlg;
63
class ScTabViewShell;
63
64
64
struct CellShell_Impl
65
struct CellShell_Impl
65
{
66
{
Lines 120-125 public: Link Here
120
	void		ExecuteMove( SfxRequest& rReq );
121
	void		ExecuteMove( SfxRequest& rReq );
121
	void		GetStateCursor( SfxItemSet& rSet );
122
	void		GetStateCursor( SfxItemSet& rSet );
122
123
124
	static void PasteFromClipboard( ScViewData* pViewData, ScTabViewShell* pTabViewShell, USHORT nExtraFlags, BOOL bShowDialog );
123
};
125
};
124
126
125
#endif
127
#endif
(-)sc/source/ui/inc/viewdata.hxx (+3 lines)
Lines 208-213 private: Link Here
208
	BOOL				bDelMarkValid;				// nur gueltig bei SC_REFTYPE_FILL
212
	BOOL				bDelMarkValid;				// nur gueltig bei SC_REFTYPE_FILL
209
	BYTE				nFillMode;					// Modus
213
	BYTE				nFillMode;					// Modus
210
	BOOL				bPagebreak;					// Seitenumbruch-Vorschaumodus
214
	BOOL				bPagebreak;					// Seitenumbruch-Vorschaumodus
215
	BOOL				bPasteMode;
211
216
212
	BOOL				bSelCtrlMouseClick;         // special selection handling for ctrl-mouse-click
217
	BOOL				bSelCtrlMouseClick;         // special selection handling for ctrl-mouse-click
213
218
Lines 286-291 public: Link Here
286
	SCCOL			GetFixPosX() const						{ return pThisTab->nFixPosX; }
291
	SCCOL			GetFixPosX() const						{ return pThisTab->nFixPosX; }
287
	SCROW			GetFixPosY() const						{ return pThisTab->nFixPosY; }
292
	SCROW			GetFixPosY() const						{ return pThisTab->nFixPosY; }
288
	BOOL			IsPagebreakMode() const					{ return bPagebreak; }
293
	BOOL			IsPagebreakMode() const					{ return bPagebreak; }
294
	BOOL			IsPasteMode() const                     { return bPasteMode; }
289
295
290
	void			SetPosX( ScHSplitPos eWhich, SCCOL nNewPosX );
296
	void			SetPosX( ScHSplitPos eWhich, SCCOL nNewPosX );
291
	void			SetPosY( ScVSplitPos eWhich, SCROW nNewPosY );
297
	void			SetPosY( ScVSplitPos eWhich, SCROW nNewPosY );
Lines 300-305 public: Link Here
300
	void			SetFixPosX( SCCOL nPos )						{ pThisTab->nFixPosX = nPos; }
306
	void			SetFixPosX( SCCOL nPos )						{ pThisTab->nFixPosX = nPos; }
301
	void			SetFixPosY( SCROW nPos )						{ pThisTab->nFixPosY = nPos; }
307
	void			SetFixPosY( SCROW nPos )						{ pThisTab->nFixPosY = nPos; }
302
	void			SetPagebreakMode( BOOL bSet );
308
	void			SetPagebreakMode( BOOL bSet );
309
	void			SetPasteMode ( BOOL bSet )          { bPasteMode = bSet; }
303
310
304
    void            SetZoomType( SvxZoomType eNew, BOOL bAll );
311
    void            SetZoomType( SvxZoomType eNew, BOOL bAll );
305
    void            SetZoom( const Fraction& rNewX, const Fraction& rNewY, BOOL bAll );
312
    void            SetZoom( const Fraction& rNewX, const Fraction& rNewY, BOOL bAll );
(-)sc/source/ui/view/cellsh1.cxx (-33 / +46 lines)
Lines 1176-1181 void ScCellShell::ExecuteEdit( SfxReques Link Here
1176
				WaitObject aWait( GetViewData()->GetDialogParent() );
1184
				WaitObject aWait( GetViewData()->GetDialogParent() );
1177
				pTabViewShell->CopyToClip( NULL, FALSE, FALSE, TRUE );
1185
				pTabViewShell->CopyToClip( NULL, FALSE, FALSE, TRUE );
1178
				rReq.Done();
1186
				rReq.Done();
1187
				GetViewData()->SetPasteMode( TRUE );
1179
			}
1188
			}
1180
			break;
1189
			break;
1181
1190
Lines 1184-1229 void ScCellShell::ExecuteEdit( SfxReques Link Here
1184
				WaitObject aWait( GetViewData()->GetDialogParent() );
1193
				WaitObject aWait( GetViewData()->GetDialogParent() );
1185
				pTabViewShell->CutToClip( NULL, TRUE );
1194
				pTabViewShell->CutToClip( NULL, TRUE );
1186
				rReq.Done();
1195
				rReq.Done();
1196
				GetViewData()->SetPasteMode( TRUE );
1187
			}
1197
			}
1188
			break;
1198
			break;
1189
1199
1190
		case SID_PASTE:
1200
		case SID_PASTE:
1191
			{
1201
			{
1192
                Window* pWin = GetViewData()->GetActiveWin();
1202
				PasteFromClipboard ( GetViewData(), pTabViewShell, 0, TRUE );
1193
                ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pWin );
1194
                ScDocument* pThisDoc = GetViewData()->GetDocument();
1195
                ScDPObject* pDPObj = pThisDoc->GetDPAtCursor( GetViewData()->GetCurX(),
1196
                                     GetViewData()->GetCurY(), GetViewData()->GetTabNo() );
1197
                if ( pOwnClip && pDPObj )
1198
                {
1199
                    // paste from Calc into DataPilot table: sort (similar to drag & drop)
1200
1201
                    ScDocument* pClipDoc = pOwnClip->GetDocument();
1202
                    SCTAB nSourceTab = pOwnClip->GetVisibleTab();
1203
1204
                    SCCOL nClipStartX;
1205
                    SCROW nClipStartY;
1206
                    SCCOL nClipEndX;
1207
                    SCROW nClipEndY;
1208
                    pClipDoc->GetClipStart( nClipStartX, nClipStartY );
1209
                    pClipDoc->GetClipArea( nClipEndX, nClipEndY, TRUE );
1210
                    nClipEndX = nClipEndX + nClipStartX;
1211
                    nClipEndY = nClipEndY + nClipStartY;   // GetClipArea returns the difference
1212
1213
                    ScRange aSource( nClipStartX, nClipStartY, nSourceTab, nClipEndX, nClipEndY, nSourceTab );
1214
                    BOOL bDone = pTabViewShell->DataPilotMove( aSource, GetViewData()->GetCurPos() );
1215
                    if ( !bDone )
1216
                        pTabViewShell->ErrorMessage( STR_ERR_DATAPILOT_INPUT );
1217
                }
1218
                else
1219
                {
1220
                    // normal paste
1221
                    WaitObject aWait( GetViewData()->GetDialogParent() );
1222
                    pTabViewShell->PasteFromSystem();
1223
                }
1224
				rReq.Done();
1203
				rReq.Done();
1225
			}
1204
			}
1226
			pTabViewShell->CellContentChanged();		// => PasteFromSystem() ???
1227
			break;
1205
			break;
1228
1206
1229
		case SID_CLIPBOARD_FORMAT_ITEMS:
1207
		case SID_CLIPBOARD_FORMAT_ITEMS:
Lines 2270-2272 IMPL_LINK( ScCellShell, DialogClosed, Ab Link Here
2270
    return 0;
2248
    return 0;
2271
}
2249
}
2272
2250
2251
void ScCellShell::PasteFromClipboard( ScViewData* pViewData, ScTabViewShell* pTabViewShell, USHORT nExtraFlags, BOOL bShowDialog )
2252
{
2253
    Window* pWin = pViewData->GetActiveWin();
2254
    ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( pWin );
2255
    ScDocument* pThisDoc = pViewData->GetDocument();
2256
    ScDPObject* pDPObj = pThisDoc->GetDPAtCursor( pViewData->GetCurX(),
2257
                         pViewData->GetCurY(), pViewData->GetTabNo() );
2258
    if ( pOwnClip && pDPObj )
2259
    {
2260
        // paste from Calc into DataPilot table: sort (similar to drag & drop)
2261
2262
        ScDocument* pClipDoc = pOwnClip->GetDocument();
2263
        SCTAB nSourceTab = pOwnClip->GetVisibleTab();
2264
2265
        SCCOL nClipStartX;
2266
        SCROW nClipStartY;
2267
        SCCOL nClipEndX;
2268
        SCROW nClipEndY;
2269
        pClipDoc->GetClipStart( nClipStartX, nClipStartY );
2270
        pClipDoc->GetClipArea( nClipEndX, nClipEndY, TRUE );
2271
        nClipEndX = nClipEndX + nClipStartX;
2272
        nClipEndY = nClipEndY + nClipStartY;   // GetClipArea returns the difference
2273
2274
        ScRange aSource( nClipStartX, nClipStartY, nSourceTab, nClipEndX, nClipEndY, nSourceTab );
2275
        BOOL bDone = pTabViewShell->DataPilotMove( aSource, pViewData->GetCurPos() );
2276
        if ( !bDone )
2277
            pTabViewShell->ErrorMessage( STR_ERR_DATAPILOT_INPUT );
2278
    }
2279
    else
2280
    {
2281
        // normal paste
2282
        WaitObject aWait( pViewData->GetDialogParent() );
2283
        if (!pOwnClip)
2284
            pTabViewShell->PasteFromSystem();
2285
        else {
2286
            pTabViewShell->PasteFromClip( IDF_ALL | nExtraFlags, pOwnClip->GetDocument(),
2287
                    PASTE_NOFUNC, FALSE, FALSE, FALSE, INS_NONE, IDF_NONE,
2288
                    bShowDialog );		// allow warning dialog
2289
        }
2290
    }
2291
    pTabViewShell->CellContentChanged();		// => PasteFromSystem() ???
2292
}
2293
(-)sc/source/ui/view/viewdata.cxx (+2 lines)
Lines 344-349 ScViewData::ScViewData( ScDocShell* pDoc Link Here
344
		bDelMarkValid( FALSE ),
327
		bDelMarkValid( FALSE ),
345
		nFillMode	( SC_FILL_NONE ),
328
		nFillMode	( SC_FILL_NONE ),
346
		bPagebreak	( FALSE ),
329
		bPagebreak	( FALSE ),
330
		bPasteMode ( FALSE ),
347
		bSelCtrlMouseClick( FALSE )
331
		bSelCtrlMouseClick( FALSE )
348
{
332
{
349
333
Lines 472-477 void ScViewData::InitFrom( const ScViewD Link Here
472
    aDefPageZoomX = pRef->aDefPageZoomX;
456
    aDefPageZoomX = pRef->aDefPageZoomX;
473
    aDefPageZoomY = pRef->aDefPageZoomY;
457
    aDefPageZoomY = pRef->aDefPageZoomY;
474
	bPagebreak	= pRef->bPagebreak;
458
	bPagebreak	= pRef->bPagebreak;
459
	bPasteMode  = pRef->bPasteMode;
475
	aLogicMode	= pRef->aLogicMode;
460
	aLogicMode	= pRef->aLogicMode;
476
461
477
	SetGridMode		( pRef->IsGridMode() );
462
	SetGridMode		( pRef->IsGridMode() );
(-)sc/source/ui/view/viewfun3.cxx (-1 / +4 lines)
Lines 1038-1044 BOOL ScViewFunc::PasteFromClip( USHORT n Link Here
1038
		DoneBlockMode();
1053
		DoneBlockMode();
1039
		InitOwnBlockMode();
1054
		InitOwnBlockMode();
1040
	}
1055
	}
1041
	rMark.SetMarkArea( aUserRange );
1056
1057
	if (!(nFlags & IDF_SPECIAL_NOMARKAREA)) {
1058
		rMark.SetMarkArea( aUserRange );
1059
	}
1042
1060
1043
	HideCursor();							// Cursor aendert sich !
1061
	HideCursor();							// Cursor aendert sich !
1044
1062
(-)sc/source/ui/view/gridwin.cxx (-1 / +24 lines)
Lines 142-147 Link Here
142
#include "userdat.hxx"
146
#include "userdat.hxx"
143
#include "drwlayer.hxx"
147
#include "drwlayer.hxx"
144
#include "attrib.hxx"
148
#include "attrib.hxx"
149
#include "cellsh.hxx"
145
150
146
// #114409#
151
// #114409#
147
#ifndef _SV_SALBTYPE_HXX
152
#ifndef _SV_SALBTYPE_HXX
Lines 2944-2952 void ScGridWindow::SelectForContextMenu( Link Here
2944
void __EXPORT ScGridWindow::KeyInput(const KeyEvent& rKEvt)
2989
void __EXPORT ScGridWindow::KeyInput(const KeyEvent& rKEvt)
2945
{
2990
{
2946
    // #96965# Cursor control for ref input dialog
2991
    // #96965# Cursor control for ref input dialog
2992
    const KeyCode& rKeyCode = rKEvt.GetKeyCode();
2947
    if( SC_MOD()->IsRefDialogOpen() )
2993
    if( SC_MOD()->IsRefDialogOpen() )
2948
    {
2994
    {
2949
        const KeyCode& rKeyCode = rKEvt.GetKeyCode();
2950
        if( !rKeyCode.GetModifier() && (rKeyCode.GetCode() == KEY_F2) )
2995
        if( !rKeyCode.GetModifier() && (rKeyCode.GetCode() == KEY_F2) )
2951
        {
2996
        {
2952
            SC_MOD()->EndReference();
2997
            SC_MOD()->EndReference();
Lines 2961-2969 void __EXPORT ScGridWindow::KeyInput(con Link Here
2961
            return;
3006
            return;
2962
        }
3007
        }
2963
    }
3008
    }
3009
	else if( rKeyCode.GetCode() == KEY_RETURN && pViewData->IsPasteMode() )
3010
	{
3011
		ScTabViewShell* pTabViewShell = pViewData->GetViewShell();
3012
3013
		ScCellShell::PasteFromClipboard( pViewData, pTabViewShell, IDF_SPECIAL_NOMARKAREA, FALSE );
3014
3015
		uno::Reference<datatransfer::clipboard::XClipboard> xSystemClipboard = 
3016
			TransferableHelper::GetSystemClipboard();
3017
		if (xSystemClipboard.is())
3018
		{
3019
			xSystemClipboard->setContents(
3020
					uno::Reference<datatransfer::XTransferable>(),
3021
					uno::Reference<datatransfer::clipboard::XClipboardOwner>());
3022
		}
3023
3024
		pViewData->SetPasteMode( FALSE );
3025
		return;
3026
	}
2964
	// wenn semi-Modeless-SfxChildWindow-Dialog oben, keine KeyInputs:
3027
	// wenn semi-Modeless-SfxChildWindow-Dialog oben, keine KeyInputs:
2965
    else if( !pViewData->IsAnyFillMode() )
3028
    else if( !pViewData->IsAnyFillMode() )
2966
	{
3029
	{
3030
		USHORT nGroup = rKeyCode.GetGroup();
3031
		if (!rKeyCode.GetModifier() && 
3032
				(nGroup == KEYGROUP_NUM || nGroup == KEYGROUP_ALPHA))
3033
			pViewData->SetPasteMode( FALSE );
2967
		//	query for existing note marker before calling ViewShell's keyboard handling
3034
		//	query for existing note marker before calling ViewShell's keyboard handling
2968
		//	which may remove the marker
3035
		//	which may remove the marker
2969
		BOOL bHadKeyMarker = ( pNoteMarker && pNoteMarker->IsByKeyboard() );
3036
		BOOL bHadKeyMarker = ( pNoteMarker && pNoteMarker->IsByKeyboard() );

Return to issue 28535