Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
abccf9b8
Kaydet (Commit)
abccf9b8
authored
Eyl 12, 2011
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Moved PasteFromClipboard() from ScCellShell to ScClipUtil (new class).
üst
ea280cef
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
134 additions
and
54 deletions
+134
-54
Library_sc.mk
sc/Library_sc.mk
+1
-0
cellsh.hxx
sc/source/ui/inc/cellsh.hxx
+0
-2
cliputil.hxx
sc/source/ui/inc/cliputil.hxx
+42
-0
cellsh1.cxx
sc/source/ui/view/cellsh1.cxx
+2
-51
cliputil.cxx
sc/source/ui/view/cliputil.cxx
+87
-0
gridwin.cxx
sc/source/ui/view/gridwin.cxx
+2
-1
No files found.
sc/Library_sc.mk
Dosyayı görüntüle @
abccf9b8
...
@@ -472,6 +472,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
...
@@ -472,6 +472,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
sc/source/ui/view/cellsh3 \
sc/source/ui/view/cellsh3 \
sc/source/ui/view/cellsh4 \
sc/source/ui/view/cellsh4 \
sc/source/ui/view/colrowba \
sc/source/ui/view/colrowba \
sc/source/ui/view/cliputil \
sc/source/ui/view/dbfunc \
sc/source/ui/view/dbfunc \
sc/source/ui/view/dbfunc2 \
sc/source/ui/view/dbfunc2 \
sc/source/ui/view/dbfunc3 \
sc/source/ui/view/dbfunc3 \
...
...
sc/source/ui/inc/cellsh.hxx
Dosyayı görüntüle @
abccf9b8
...
@@ -108,8 +108,6 @@ public:
...
@@ -108,8 +108,6 @@ public:
void
ExecutePageSel
(
SfxRequest
&
rReq
);
void
ExecutePageSel
(
SfxRequest
&
rReq
);
void
ExecuteMove
(
SfxRequest
&
rReq
);
void
ExecuteMove
(
SfxRequest
&
rReq
);
void
GetStateCursor
(
SfxItemSet
&
rSet
);
void
GetStateCursor
(
SfxItemSet
&
rSet
);
static
void
PasteFromClipboard
(
ScViewData
*
pViewData
,
ScTabViewShell
*
pTabViewShell
,
bool
bShowDialog
);
};
};
#endif
#endif
...
...
sc/source/ui/inc/cliputil.hxx
0 → 100644
Dosyayı görüntüle @
abccf9b8
/*
* Version: MPL 1.1 / GPLv3+ / LGPLv3+
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License or as specified alternatively below. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* Major Contributor(s):
* Copyright (C) 2011 Kohei Yoshida <kohei.yoshida@suse.com>
*
* All Rights Reserved.
*
* For minor contributions see the git repository.
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 3 or later (the "GPLv3+"), or
* the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
* in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
* instead of those above.
*/
#ifndef __SC_CLIPUTIL_HXX__
#define __SC_CLIPUTIL_HXX__
class
ScViewData
;
class
ScTabViewShell
;
class
ScClipUtil
{
ScClipUtil
();
~
ScClipUtil
();
public
:
static
void
PasteFromClipboard
(
ScViewData
*
pViewData
,
ScTabViewShell
*
pTabViewShell
,
bool
bShowDialog
);
};
#endif
sc/source/ui/view/cellsh1.cxx
Dosyayı görüntüle @
abccf9b8
...
@@ -100,6 +100,7 @@
...
@@ -100,6 +100,7 @@
#include "dpshttab.hxx" // ScSheetSourceDesc
#include "dpshttab.hxx" // ScSheetSourceDesc
#include "dbdata.hxx"
#include "dbdata.hxx"
#include "docsh.hxx"
#include "docsh.hxx"
#include "cliputil.hxx"
#include "globstr.hrc"
#include "globstr.hrc"
#include "scui_def.hxx"
#include "scui_def.hxx"
...
@@ -1169,7 +1170,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
...
@@ -1169,7 +1170,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
case
SID_PASTE
:
case
SID_PASTE
:
{
{
PasteFromClipboard
(
GetViewData
(),
pTabViewShell
,
true
);
ScClipUtil
::
PasteFromClipboard
(
GetViewData
(),
pTabViewShell
,
true
);
rReq
.
Done
();
rReq
.
Done
();
}
}
break
;
break
;
...
@@ -2433,54 +2434,4 @@ IMPL_LINK( ScCellShell, DialogClosed, AbstractScLinkedAreaDlg*, EMPTYARG )
...
@@ -2433,54 +2434,4 @@ IMPL_LINK( ScCellShell, DialogClosed, AbstractScLinkedAreaDlg*, EMPTYARG )
return
0
;
return
0
;
}
}
void
ScCellShell
::
PasteFromClipboard
(
ScViewData
*
pViewData
,
ScTabViewShell
*
pTabViewShell
,
bool
bShowDialog
)
{
Window
*
pWin
=
pViewData
->
GetActiveWin
();
ScTransferObj
*
pOwnClip
=
ScTransferObj
::
GetOwnClipboard
(
pWin
);
ScDocument
*
pThisDoc
=
pViewData
->
GetDocument
();
ScDPObject
*
pDPObj
=
pThisDoc
->
GetDPAtCursor
(
pViewData
->
GetCurX
(),
pViewData
->
GetCurY
(),
pViewData
->
GetTabNo
()
);
if
(
pOwnClip
&&
pDPObj
)
{
// paste from Calc into DataPilot table: sort (similar to drag & drop)
ScDocument
*
pClipDoc
=
pOwnClip
->
GetDocument
();
SCTAB
nSourceTab
=
pOwnClip
->
GetVisibleTab
();
SCCOL
nClipStartX
;
SCROW
nClipStartY
;
SCCOL
nClipEndX
;
SCROW
nClipEndY
;
pClipDoc
->
GetClipStart
(
nClipStartX
,
nClipStartY
);
pClipDoc
->
GetClipArea
(
nClipEndX
,
nClipEndY
,
sal_True
);
nClipEndX
=
nClipEndX
+
nClipStartX
;
nClipEndY
=
nClipEndY
+
nClipStartY
;
// GetClipArea returns the difference
ScRange
aSource
(
nClipStartX
,
nClipStartY
,
nSourceTab
,
nClipEndX
,
nClipEndY
,
nSourceTab
);
sal_Bool
bDone
=
pTabViewShell
->
DataPilotMove
(
aSource
,
pViewData
->
GetCurPos
()
);
if
(
!
bDone
)
pTabViewShell
->
ErrorMessage
(
STR_ERR_DATAPILOT_INPUT
);
}
else
{
// normal paste
WaitObject
aWait
(
pViewData
->
GetDialogParent
()
);
if
(
!
pOwnClip
)
pTabViewShell
->
PasteFromSystem
();
else
{
ScDocument
*
pClipDoc
=
pOwnClip
->
GetDocument
();
sal_uInt16
nFlags
=
IDF_ALL
;
if
(
pClipDoc
->
GetClipParam
().
isMultiRange
())
// For multi-range paste, we paste values by default.
nFlags
&=
~
IDF_FORMULA
;
pTabViewShell
->
PasteFromClip
(
nFlags
,
pClipDoc
,
PASTE_NOFUNC
,
false
,
false
,
false
,
INS_NONE
,
IDF_NONE
,
bShowDialog
);
// allow warning dialog
}
}
pTabViewShell
->
CellContentChanged
();
// => PasteFromSystem() ???
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sc/source/ui/view/cliputil.cxx
0 → 100644
Dosyayı görüntüle @
abccf9b8
/*
* Version: MPL 1.1 / GPLv3+ / LGPLv3+
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License or as specified alternatively below. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* Major Contributor(s):
* Copyright (C) 2011 Kohei Yoshida <kohei.yoshida@suse.com>
*
* All Rights Reserved.
*
* For minor contributions see the git repository.
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 3 or later (the "GPLv3+"), or
* the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
* in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
* instead of those above.
*/
#include "cliputil.hxx"
#include "viewdata.hxx"
#include "tabvwsh.hxx"
#include "transobj.hxx"
#include "document.hxx"
#include "dpobject.hxx"
#include "globstr.hrc"
#include "clipparam.hxx"
#include "vcl/waitobj.hxx"
void
ScClipUtil
::
PasteFromClipboard
(
ScViewData
*
pViewData
,
ScTabViewShell
*
pTabViewShell
,
bool
bShowDialog
)
{
Window
*
pWin
=
pViewData
->
GetActiveWin
();
ScTransferObj
*
pOwnClip
=
ScTransferObj
::
GetOwnClipboard
(
pWin
);
ScDocument
*
pThisDoc
=
pViewData
->
GetDocument
();
ScDPObject
*
pDPObj
=
pThisDoc
->
GetDPAtCursor
(
pViewData
->
GetCurX
(),
pViewData
->
GetCurY
(),
pViewData
->
GetTabNo
()
);
if
(
pOwnClip
&&
pDPObj
)
{
// paste from Calc into DataPilot table: sort (similar to drag & drop)
ScDocument
*
pClipDoc
=
pOwnClip
->
GetDocument
();
SCTAB
nSourceTab
=
pOwnClip
->
GetVisibleTab
();
SCCOL
nClipStartX
;
SCROW
nClipStartY
;
SCCOL
nClipEndX
;
SCROW
nClipEndY
;
pClipDoc
->
GetClipStart
(
nClipStartX
,
nClipStartY
);
pClipDoc
->
GetClipArea
(
nClipEndX
,
nClipEndY
,
sal_True
);
nClipEndX
=
nClipEndX
+
nClipStartX
;
nClipEndY
=
nClipEndY
+
nClipStartY
;
// GetClipArea returns the difference
ScRange
aSource
(
nClipStartX
,
nClipStartY
,
nSourceTab
,
nClipEndX
,
nClipEndY
,
nSourceTab
);
sal_Bool
bDone
=
pTabViewShell
->
DataPilotMove
(
aSource
,
pViewData
->
GetCurPos
()
);
if
(
!
bDone
)
pTabViewShell
->
ErrorMessage
(
STR_ERR_DATAPILOT_INPUT
);
}
else
{
// normal paste
WaitObject
aWait
(
pViewData
->
GetDialogParent
()
);
if
(
!
pOwnClip
)
pTabViewShell
->
PasteFromSystem
();
else
{
ScDocument
*
pClipDoc
=
pOwnClip
->
GetDocument
();
sal_uInt16
nFlags
=
IDF_ALL
;
if
(
pClipDoc
->
GetClipParam
().
isMultiRange
())
// For multi-range paste, we paste values by default.
nFlags
&=
~
IDF_FORMULA
;
pTabViewShell
->
PasteFromClip
(
nFlags
,
pClipDoc
,
PASTE_NOFUNC
,
false
,
false
,
false
,
INS_NONE
,
IDF_NONE
,
bShowDialog
);
// allow warning dialog
}
}
pTabViewShell
->
CellContentChanged
();
// => PasteFromSystem() ???
}
sc/source/ui/view/gridwin.cxx
Dosyayı görüntüle @
abccf9b8
...
@@ -130,6 +130,7 @@
...
@@ -130,6 +130,7 @@
#include "cellsuno.hxx"
#include "cellsuno.hxx"
#include "drawview.hxx"
#include "drawview.hxx"
#include "dragdata.hxx"
#include "dragdata.hxx"
#include "cliputil.hxx"
#include <svx/sdrpagewindow.hxx>
#include <svx/sdrpagewindow.hxx>
#include <svx/sdr/overlay/overlaymanager.hxx>
#include <svx/sdr/overlay/overlaymanager.hxx>
...
@@ -3044,7 +3045,7 @@ void ScGridWindow::KeyInput(const KeyEvent& rKEvt)
...
@@ -3044,7 +3045,7 @@ void ScGridWindow::KeyInput(const KeyEvent& rKEvt)
else
if
(
rKeyCode
.
GetCode
()
==
KEY_RETURN
&&
pViewData
->
IsPasteMode
()
)
else
if
(
rKeyCode
.
GetCode
()
==
KEY_RETURN
&&
pViewData
->
IsPasteMode
()
)
{
{
ScTabViewShell
*
pTabViewShell
=
pViewData
->
GetViewShell
();
ScTabViewShell
*
pTabViewShell
=
pViewData
->
GetViewShell
();
ScC
ellShel
l
::
PasteFromClipboard
(
pViewData
,
pTabViewShell
,
false
);
ScC
lipUti
l
::
PasteFromClipboard
(
pViewData
,
pTabViewShell
,
false
);
// Clear clipboard content.
// Clear clipboard content.
uno
::
Reference
<
datatransfer
::
clipboard
::
XClipboard
>
xSystemClipboard
=
uno
::
Reference
<
datatransfer
::
clipboard
::
XClipboard
>
xSystemClipboard
=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment