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
6a3a25fa
Kaydet (Commit)
6a3a25fa
authored
Eyl 09, 2011
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
ScMultiBlockUndo in place.
üst
90f571cf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
121 additions
and
0 deletions
+121
-0
undobase.hxx
sc/source/ui/inc/undobase.hxx
+20
-0
undobase.cxx
sc/source/ui/undo/undobase.cxx
+101
-0
No files found.
sc/source/ui/inc/undobase.hxx
Dosyayı görüntüle @
6a3a25fa
...
...
@@ -94,6 +94,26 @@ protected:
void
ShowBlock
();
};
class
ScMultiBlockUndo
:
public
ScSimpleUndo
{
public
:
ScMultiBlockUndo
(
ScDocShell
*
pDocSh
,
const
ScRangeList
&
rRanges
,
ScBlockUndoMode
eBlockMode
);
virtual
~
ScMultiBlockUndo
();
protected
:
ScRangeList
maBlockRanges
;
SdrUndoAction
*
mpDrawUndo
;
ScBlockUndoMode
meMode
;
void
BeginUndo
();
void
EndUndo
();
void
EndRedo
();
void
AdjustHeight
();
void
ShowBlock
();
};
//----------------------------------------------------------------------------
// for functions that act on a database range - takes care of the unnamed database range
...
...
sc/source/ui/undo/undobase.cxx
Dosyayı görüntüle @
6a3a25fa
...
...
@@ -280,6 +280,107 @@ void ScBlockUndo::ShowBlock()
}
}
ScMultiBlockUndo
::
ScMultiBlockUndo
(
ScDocShell
*
pDocSh
,
const
ScRangeList
&
rRanges
,
ScBlockUndoMode
eBlockMode
)
:
ScSimpleUndo
(
pDocSh
),
maBlockRanges
(
rRanges
),
meMode
(
eBlockMode
)
{
mpDrawUndo
=
GetSdrUndoAction
(
pDocShell
->
GetDocument
()
);
}
ScMultiBlockUndo
::~
ScMultiBlockUndo
()
{
DeleteSdrUndoAction
(
mpDrawUndo
);
}
void
ScMultiBlockUndo
::
BeginUndo
()
{
ScSimpleUndo
::
BeginUndo
();
EnableDrawAdjust
(
pDocShell
->
GetDocument
(),
false
);
}
void
ScMultiBlockUndo
::
EndUndo
()
{
if
(
meMode
==
SC_UNDO_AUTOHEIGHT
)
AdjustHeight
();
EnableDrawAdjust
(
pDocShell
->
GetDocument
(),
true
);
DoSdrUndoAction
(
mpDrawUndo
,
pDocShell
->
GetDocument
());
ShowBlock
();
ScSimpleUndo
::
EndUndo
();
}
void
ScMultiBlockUndo
::
EndRedo
()
{
if
(
meMode
==
SC_UNDO_AUTOHEIGHT
)
AdjustHeight
();
ShowBlock
();
ScSimpleUndo
::
EndRedo
();
}
void
ScMultiBlockUndo
::
AdjustHeight
()
{
ScDocument
*
pDoc
=
pDocShell
->
GetDocument
();
VirtualDevice
aVirtDev
;
Fraction
aZoomX
(
1
,
1
);
Fraction
aZoomY
=
aZoomX
;
double
nPPTX
,
nPPTY
;
ScTabViewShell
*
pViewShell
=
ScTabViewShell
::
GetActiveViewShell
();
if
(
pViewShell
)
{
ScViewData
*
pData
=
pViewShell
->
GetViewData
();
nPPTX
=
pData
->
GetPPTX
();
nPPTY
=
pData
->
GetPPTY
();
aZoomX
=
pData
->
GetZoomX
();
aZoomY
=
pData
->
GetZoomY
();
}
else
{
// Zoom auf 100 lassen
nPPTX
=
ScGlobal
::
nScreenPPTX
;
nPPTY
=
ScGlobal
::
nScreenPPTY
;
}
for
(
size_t
i
=
0
,
n
=
maBlockRanges
.
size
();
i
<
n
;
++
i
)
{
const
ScRange
&
r
=
*
maBlockRanges
[
i
];
bool
bRet
=
pDoc
->
SetOptimalHeight
(
r
.
aStart
.
Row
(),
r
.
aEnd
.
Row
(),
r
.
aStart
.
Tab
(),
0
,
&
aVirtDev
,
nPPTX
,
nPPTY
,
aZoomX
,
aZoomY
,
false
);
if
(
bRet
)
pDocShell
->
PostPaint
(
0
,
r
.
aStart
.
Row
(),
r
.
aStart
.
Tab
(),
MAXCOL
,
MAXROW
,
r
.
aEnd
.
Tab
(),
PAINT_GRID
|
PAINT_LEFT
);
}
}
void
ScMultiBlockUndo
::
ShowBlock
()
{
if
(
IsPaintLocked
()
)
return
;
ScTabViewShell
*
pViewShell
=
ScTabViewShell
::
GetActiveViewShell
();
if
(
!
pViewShell
)
return
;
if
(
maBlockRanges
.
empty
())
return
;
// Show the very first range.
ScRange
aRange
=
*
maBlockRanges
[
0
];
ShowTable
(
aRange
);
pViewShell
->
MoveCursorAbs
(
aRange
.
aStart
.
Col
(),
aRange
.
aStart
.
Row
(),
SC_FOLLOW_JUMP
,
false
,
false
);
SCTAB
nTab
=
pViewShell
->
GetViewData
()
->
GetTabNo
();
aRange
.
aStart
.
SetTab
(
nTab
);
aRange
.
aEnd
.
SetTab
(
nTab
);
pViewShell
->
MarkRange
(
aRange
);
}
// -----------------------------------------------------------------------
...
...
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