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
ab0096ed
Kaydet (Commit)
ab0096ed
authored
Şub 15, 2012
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fdo#46070: Allow copying of adjacent cells via Fill Down/Up/Left/Right.
üst
843eafc7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
124 additions
and
43 deletions
+124
-43
docfunc.cxx
sc/source/ui/docshell/docfunc.cxx
+86
-14
docfunc.hxx
sc/source/ui/inc/docfunc.hxx
+2
-2
viewfunc.hxx
sc/source/ui/inc/viewfunc.hxx
+1
-1
cellsh.cxx
sc/source/ui/view/cellsh.cxx
+33
-24
viewfun2.cxx
sc/source/ui/view/viewfun2.cxx
+2
-2
No files found.
sc/source/ui/docshell/docfunc.cxx
Dosyayı görüntüle @
ab0096ed
...
...
@@ -3933,19 +3933,91 @@ inline ScDirection DirFromFillDir( FillDir eDir )
return
DIR_LEFT
;
}
sal_Bool
ScDocFunc
::
FillSimple
(
const
ScRange
&
rRange
,
const
ScMarkData
*
pTabMark
,
FillDir
eDir
,
sal_Bool
bRecord
,
sal_Bool
bApi
)
namespace
{
/**
* Expand the fill range as necessary, to allow copying of adjacent cell(s)
* even when those cells are not in the original range.
*/
void
adjustFillRangeForAdjacentCopy
(
ScRange
&
rRange
,
FillDir
eDir
)
{
ScDocShellModificator
aModificator
(
rDocShell
);
switch
(
eDir
)
{
case
FILL_TO_BOTTOM
:
{
if
(
rRange
.
aStart
.
Row
()
==
0
)
return
;
sal_Bool
bSuccess
=
false
;
if
(
rRange
.
aStart
.
Row
()
!=
rRange
.
aEnd
.
Row
())
return
;
// Include the above row.
ScAddress
&
s
=
rRange
.
aStart
;
s
.
SetRow
(
s
.
Row
()
-
1
);
}
break
;
case
FILL_TO_TOP
:
{
if
(
rRange
.
aStart
.
Row
()
==
MAXROW
)
return
;
if
(
rRange
.
aStart
.
Row
()
!=
rRange
.
aEnd
.
Row
())
return
;
// Include the row below.
ScAddress
&
e
=
rRange
.
aEnd
;
e
.
SetRow
(
e
.
Row
()
+
1
);
}
break
;
case
FILL_TO_LEFT
:
{
if
(
rRange
.
aStart
.
Col
()
==
MAXCOL
)
return
;
if
(
rRange
.
aStart
.
Col
()
!=
rRange
.
aEnd
.
Col
())
return
;
// Include the column to the right.
ScAddress
&
e
=
rRange
.
aEnd
;
e
.
SetCol
(
e
.
Col
()
+
1
);
}
break
;
case
FILL_TO_RIGHT
:
{
if
(
rRange
.
aStart
.
Col
()
==
0
)
return
;
if
(
rRange
.
aStart
.
Col
()
!=
rRange
.
aEnd
.
Col
())
return
;
// Include the column to the left.
ScAddress
&
s
=
rRange
.
aStart
;
s
.
SetCol
(
s
.
Col
()
-
1
);
}
break
;
default
:
;
}
}
}
bool
ScDocFunc
::
FillSimple
(
const
ScRange
&
rRange
,
const
ScMarkData
*
pTabMark
,
FillDir
eDir
,
bool
bRecord
,
bool
bApi
)
{
ScDocShellModificator
aModificator
(
rDocShell
);
ScDocument
*
pDoc
=
rDocShell
.
GetDocument
();
SCCOL
nStartCol
=
rRange
.
aStart
.
Col
();
SCROW
nStartRow
=
rRange
.
aStart
.
Row
();
SCTAB
nStartTab
=
rRange
.
aStart
.
Tab
();
SCCOL
nEndCol
=
rRange
.
aEnd
.
Col
();
SCROW
nEndRow
=
rRange
.
aEnd
.
Row
();
SCTAB
nEndTab
=
rRange
.
aEnd
.
Tab
();
bool
bSuccess
=
false
;
ScRange
aRange
=
rRange
;
adjustFillRangeForAdjacentCopy
(
aRange
,
eDir
);
SCCOL
nStartCol
=
aRange
.
aStart
.
Col
();
SCROW
nStartRow
=
aRange
.
aStart
.
Row
();
SCTAB
nStartTab
=
aRange
.
aStart
.
Tab
();
SCCOL
nEndCol
=
aRange
.
aEnd
.
Col
();
SCROW
nEndRow
=
aRange
.
aEnd
.
Row
();
SCTAB
nEndTab
=
aRange
.
aEnd
.
Tab
();
if
(
bRecord
&&
!
pDoc
->
IsUndoEnabled
())
bRecord
=
false
;
...
...
@@ -3964,8 +4036,8 @@ sal_Bool ScDocFunc::FillSimple( const ScRange& rRange, const ScMarkData* pTabMar
{
WaitObject
aWait
(
rDocShell
.
GetActiveDialogParent
()
);
ScRange
aSourceArea
=
r
Range
;
ScRange
aDestArea
=
r
Range
;
ScRange
aSourceArea
=
a
Range
;
ScRange
aDestArea
=
a
Range
;
SCCOLROW
nCount
=
0
;
switch
(
eDir
)
...
...
@@ -4010,7 +4082,7 @@ sal_Bool ScDocFunc::FillSimple( const ScRange& rRange, const ScMarkData* pTabMar
pDoc
->
Fill
(
aSourceArea
.
aStart
.
Col
(),
aSourceArea
.
aStart
.
Row
(),
aSourceArea
.
aEnd
.
Col
(),
aSourceArea
.
aEnd
.
Row
(),
aMark
,
nCount
,
eDir
,
FILL_SIMPLE
);
AdjustRowHeight
(
r
Range
);
AdjustRowHeight
(
a
Range
);
if
(
bRecord
)
// Draw-Undo erst jetzt verfuegbar
{
...
...
@@ -4022,7 +4094,7 @@ sal_Bool ScDocFunc::FillSimple( const ScRange& rRange, const ScMarkData* pTabMar
rDocShell
.
PostPaintGridAll
();
aModificator
.
SetDocumentModified
();
bSuccess
=
sal_T
rue
;
bSuccess
=
t
rue
;
}
else
if
(
!
bApi
)
rDocShell
.
ErrorMessage
(
aTester
.
GetMessageId
());
...
...
sc/source/ui/inc/docfunc.hxx
Dosyayı görüntüle @
ab0096ed
...
...
@@ -163,8 +163,8 @@ public:
sal_Bool
TabOp
(
const
ScRange
&
rRange
,
const
ScMarkData
*
pTabMark
,
const
ScTabOpParam
&
rParam
,
sal_Bool
bRecord
,
sal_Bool
bApi
);
sal_B
ool
FillSimple
(
const
ScRange
&
rRange
,
const
ScMarkData
*
pTabMark
,
FillDir
eDir
,
sal_Bool
bRecord
,
sal_B
ool
bApi
);
b
ool
FillSimple
(
const
ScRange
&
rRange
,
const
ScMarkData
*
pTabMark
,
FillDir
eDir
,
bool
bRecord
,
b
ool
bApi
);
sal_Bool
FillSeries
(
const
ScRange
&
rRange
,
const
ScMarkData
*
pTabMark
,
FillDir
eDir
,
FillCmd
eCmd
,
FillDateCmd
eDateCmd
,
double
fStart
,
double
fStep
,
double
fMax
,
...
...
sc/source/ui/inc/viewfunc.hxx
Dosyayı görüntüle @
ab0096ed
...
...
@@ -236,7 +236,7 @@ public:
sal_Bool
MergeCells
(
sal_Bool
bApi
,
sal_Bool
&
rDoContents
,
sal_Bool
bRecord
=
true
,
sal_Bool
bCenter
=
false
);
sal_Bool
RemoveMerge
(
sal_Bool
bRecord
=
true
);
void
FillSimple
(
FillDir
eDir
,
sal_Bool
bRecord
=
sal_T
rue
);
void
FillSimple
(
FillDir
eDir
,
bool
bRecord
=
t
rue
);
void
FillSeries
(
FillDir
eDir
,
FillCmd
eCmd
,
FillDateCmd
eDateCmd
,
double
fStart
,
double
fStep
,
double
fMax
,
sal_Bool
bRecord
=
sal_True
);
void
FillAuto
(
FillDir
eDir
,
SCCOL
nStartCol
,
SCROW
nStartRow
,
...
...
sc/source/ui/view/cellsh.cxx
Dosyayı görüntüle @
ab0096ed
...
...
@@ -118,9 +118,9 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet )
ScTabViewShell
*
pTabViewShell
=
GetViewData
()
->
GetViewShell
();
ScRange
aMarkRange
;
ScMarkType
eMarkType
=
GetViewData
()
->
GetSimpleArea
(
aMarkRange
);
sal_B
ool
bSimpleArea
=
(
eMarkType
==
SC_MARK_SIMPLE
);
b
ool
bSimpleArea
=
(
eMarkType
==
SC_MARK_SIMPLE
);
bool
bOnlyNotBecauseOfMatrix
;
sal_B
ool
bEditable
=
pTabViewShell
->
SelectionEditable
(
&
bOnlyNotBecauseOfMatrix
);
b
ool
bEditable
=
pTabViewShell
->
SelectionEditable
(
&
bOnlyNotBecauseOfMatrix
);
ScDocument
*
pDoc
=
GetViewData
()
->
GetDocument
();
ScDocShell
*
pDocShell
=
GetViewData
()
->
GetDocShell
();
ScMarkData
&
rMark
=
GetViewData
()
->
GetMarkData
();
...
...
@@ -135,38 +135,47 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet )
sal_uInt16
nWhich
=
aIter
.
FirstWhich
();
while
(
nWhich
)
{
sal_B
ool
bDisable
=
false
;
sal_Bool
bNeedEdit
=
sal_T
rue
;
// need selection be editable?
b
ool
bDisable
=
false
;
bool
bNeedEdit
=
t
rue
;
// need selection be editable?
switch
(
nWhich
)
{
case
FID_FILL_TO_BOTTOM
:
// fill to top / bottom
case
FID_FILL_TO_TOP
:
// are at least 2 rows marked?
bDisable
=
(
!
bSimpleArea
)
||
(
nRow1
==
nRow2
);
{
bDisable
=
!
bSimpleArea
||
(
nRow1
==
0
&&
nRow2
==
0
);
if
(
!
bDisable
&&
bEditable
)
{
// do not damage matrix
if
(
nWhich
==
FID_FILL_TO_BOTTOM
)
bDisable
=
pDoc
->
HasSelectedBlockMatrixFragment
(
nCol1
,
nRow1
,
nCol2
,
nRow1
,
rMark
);
// first row
else
bDisable
=
pDoc
->
HasSelectedBlockMatrixFragment
(
nCol1
,
nRow2
,
nCol2
,
nRow2
,
rMark
);
// last row
bDisable
=
pDoc
->
HasSelectedBlockMatrixFragment
(
nCol1
,
nRow1
,
nCol2
,
nRow1
,
rMark
);
// first row
}
break
;
}
break
;
case
FID_FILL_TO_TOP
:
{
bDisable
=
(
!
bSimpleArea
)
||
(
nRow1
==
MAXROW
&&
nRow2
==
MAXROW
);
if
(
!
bDisable
&&
bEditable
)
{
// do not damage matrix
bDisable
=
pDoc
->
HasSelectedBlockMatrixFragment
(
nCol1
,
nRow2
,
nCol2
,
nRow2
,
rMark
);
// last row
}
}
break
;
case
FID_FILL_TO_RIGHT
:
// fill to left / right
case
FID_FILL_TO_LEFT
:
// are at least 2 columns marked?
bDisable
=
(
!
bSimpleArea
)
||
(
nCol1
==
nCol2
);
{
bDisable
=
!
bSimpleArea
||
(
nCol1
==
0
&&
nCol2
==
0
);
bDisable
=
pDoc
->
HasSelectedBlockMatrixFragment
(
nCol1
,
nRow1
,
nCol1
,
nRow2
,
rMark
);
// first column
}
break
;
case
FID_FILL_TO_LEFT
:
{
bDisable
=
(
!
bSimpleArea
)
||
(
nCol1
==
MAXCOL
&&
nCol2
==
MAXCOL
);
if
(
!
bDisable
&&
bEditable
)
{
// Matrix nicht zerreissen
if
(
nWhich
==
FID_FILL_TO_RIGHT
)
bDisable
=
pDoc
->
HasSelectedBlockMatrixFragment
(
nCol1
,
nRow1
,
nCol1
,
nRow2
,
rMark
);
// first column
else
bDisable
=
pDoc
->
HasSelectedBlockMatrixFragment
(
nCol2
,
nRow1
,
nCol2
,
nRow2
,
rMark
);
// last column
bDisable
=
pDoc
->
HasSelectedBlockMatrixFragment
(
nCol2
,
nRow1
,
nCol2
,
nRow2
,
rMark
);
// last column
}
break
;
}
break
;
case
FID_FILL_SERIES
:
// fill block
case
SID_OPENDLG_TABOP
:
// multiple-cell operations, are at least 2 cells marked?
if
(
pDoc
->
GetChangeTrack
()
!=
NULL
&&
nWhich
==
SID_OPENDLG_TABOP
)
...
...
sc/source/ui/view/viewfun2.cxx
Dosyayı görüntüle @
ab0096ed
...
...
@@ -1264,14 +1264,14 @@ sal_Bool ScViewFunc::RemoveMerge( sal_Bool bRecord )
//----------------------------------------------------------------------------
void
ScViewFunc
::
FillSimple
(
FillDir
eDir
,
sal_B
ool
bRecord
)
void
ScViewFunc
::
FillSimple
(
FillDir
eDir
,
b
ool
bRecord
)
{
ScRange
aRange
;
if
(
GetViewData
()
->
GetSimpleArea
(
aRange
)
==
SC_MARK_SIMPLE
)
{
ScDocShell
*
pDocSh
=
GetViewData
()
->
GetDocShell
();
const
ScMarkData
&
rMark
=
GetViewData
()
->
GetMarkData
();
sal_B
ool
bSuccess
=
pDocSh
->
GetDocFunc
().
FillSimple
(
aRange
,
&
rMark
,
eDir
,
bRecord
,
false
);
b
ool
bSuccess
=
pDocSh
->
GetDocFunc
().
FillSimple
(
aRange
,
&
rMark
,
eDir
,
bRecord
,
false
);
if
(
bSuccess
)
{
pDocSh
->
UpdateOle
(
GetViewData
());
...
...
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