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
f2431c94
Kaydet (Commit)
f2431c94
authored
Nis 23, 2014
tarafından
Markus Mohrhard
Kaydeden (comit)
Markus Mohrhard
Nis 24, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
add undo action for conditional formatting, cp#1000050, fdo#77381
Change-Id: I11db1e5824077135c4352ae43cc0e8d139244268
üst
96475ada
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
120 additions
and
3 deletions
+120
-3
globstr.hrc
sc/inc/globstr.hrc
+3
-1
docfunc.cxx
sc/source/ui/docshell/docfunc.cxx
+38
-2
undoblk.hxx
sc/source/ui/inc/undoblk.hxx
+22
-0
globstr.src
sc/source/ui/src/globstr.src
+5
-0
undoblk.cxx
sc/source/ui/undo/undoblk.cxx
+52
-0
No files found.
sc/inc/globstr.hrc
Dosyayı görüntüle @
f2431c94
...
@@ -692,7 +692,9 @@
...
@@ -692,7 +692,9 @@
#define STR_PRINT_PREVIEW_NODATA 529
#define STR_PRINT_PREVIEW_NODATA 529
#define STR_PRINT_PREVIEW_EMPTY_RANGE 530
#define STR_PRINT_PREVIEW_EMPTY_RANGE 530
#define SC_GLOBSTR_STR_COUNT 531 /**< the count of permanently resident strings */
#define STR_UNDO_CONDFORMAT 531
#define SC_GLOBSTR_STR_COUNT 532 /**< the count of permanently resident strings */
#endif
#endif
...
...
sc/source/ui/docshell/docfunc.cxx
Dosyayı görüntüle @
f2431c94
...
@@ -5302,6 +5302,31 @@ void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFor
...
@@ -5302,6 +5302,31 @@ void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFor
if
(
pDoc
->
IsTabProtected
(
nTab
))
if
(
pDoc
->
IsTabProtected
(
nTab
))
return
;
return
;
bool
bUndo
=
pDoc
->
IsUndoEnabled
();
ScDocument
*
pUndoDoc
=
NULL
;
ScRange
aCombinedRange
=
rRanges
.
Combine
();
ScRange
aCompleteRange
;
if
(
bUndo
)
{
pUndoDoc
=
new
ScDocument
(
SCDOCMODE_UNDO
);
pUndoDoc
->
InitUndo
(
pDoc
,
nTab
,
nTab
);
if
(
pFormat
)
{
aCompleteRange
=
aCombinedRange
;
}
if
(
nOldFormat
)
{
ScConditionalFormat
*
pOldFormat
=
pDoc
->
GetCondFormList
(
nTab
)
->
GetFormat
(
nOldFormat
);
if
(
pOldFormat
)
aCompleteRange
.
ExtendTo
(
pOldFormat
->
GetRange
().
Combine
());
}
pDoc
->
CopyToDocument
(
aCompleteRange
.
aStart
.
Col
(),
aCompleteRange
.
aStart
.
Row
(),
nTab
,
aCompleteRange
.
aEnd
.
Col
(),
aCompleteRange
.
aEnd
.
Row
(),
nTab
,
IDF_ALL
,
false
,
pUndoDoc
);
}
boost
::
scoped_ptr
<
ScRange
>
pRepaintRange
;
boost
::
scoped_ptr
<
ScRange
>
pRepaintRange
;
if
(
nOldFormat
)
if
(
nOldFormat
)
{
{
...
@@ -5318,9 +5343,9 @@ void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFor
...
@@ -5318,9 +5343,9 @@ void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFor
if
(
pFormat
)
if
(
pFormat
)
{
{
if
(
pRepaintRange
)
if
(
pRepaintRange
)
pRepaintRange
->
ExtendTo
(
rRanges
.
Combine
()
);
pRepaintRange
->
ExtendTo
(
aCombinedRange
);
else
else
pRepaintRange
.
reset
(
new
ScRange
(
rRanges
.
Combine
()
));
pRepaintRange
.
reset
(
new
ScRange
(
aCombinedRange
));
sal_uLong
nIndex
=
pDoc
->
AddCondFormat
(
pFormat
,
nTab
);
sal_uLong
nIndex
=
pDoc
->
AddCondFormat
(
pFormat
,
nTab
);
...
@@ -5328,6 +5353,17 @@ void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFor
...
@@ -5328,6 +5353,17 @@ void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFor
pDoc
->
SetStreamValid
(
nTab
,
false
);
pDoc
->
SetStreamValid
(
nTab
,
false
);
}
}
if
(
bUndo
)
{
ScDocument
*
pRedoDoc
=
new
ScDocument
(
SCDOCMODE_UNDO
);
pRedoDoc
->
InitUndo
(
pDoc
,
nTab
,
nTab
);
pDoc
->
CopyToDocument
(
aCompleteRange
.
aStart
.
Col
(),
aCompleteRange
.
aStart
.
Row
(),
nTab
,
aCompleteRange
.
aEnd
.
Col
(),
aCompleteRange
.
aEnd
.
Row
(),
nTab
,
IDF_ALL
,
false
,
pRedoDoc
);
rDocShell
.
GetUndoManager
()
->
AddUndoAction
(
new
ScUndoConditionalFormat
(
&
rDocShell
,
pUndoDoc
,
pRedoDoc
,
aCompleteRange
));
}
if
(
pRepaintRange
)
if
(
pRepaintRange
)
rDocShell
.
PostPaint
(
*
pRepaintRange
,
PAINT_GRID
);
rDocShell
.
PostPaint
(
*
pRepaintRange
,
PAINT_GRID
);
...
...
sc/source/ui/inc/undoblk.hxx
Dosyayı görüntüle @
f2431c94
...
@@ -636,6 +636,28 @@ private:
...
@@ -636,6 +636,28 @@ private:
void
DoChange
(
ScDocument
*
pSrcDoc
)
const
;
void
DoChange
(
ScDocument
*
pSrcDoc
)
const
;
};
};
class
ScUndoConditionalFormat
:
public
ScSimpleUndo
{
public
:
TYPEINFO_OVERRIDE
();
ScUndoConditionalFormat
(
ScDocShell
*
pNewDocShell
,
ScDocument
*
pUndoDoc
,
ScDocument
*
pRedoDoc
,
const
ScRange
&
rRange
);
virtual
~
ScUndoConditionalFormat
();
virtual
void
Undo
()
SAL_OVERRIDE
;
virtual
void
Redo
()
SAL_OVERRIDE
;
virtual
void
Repeat
(
SfxRepeatTarget
&
rTarget
)
SAL_OVERRIDE
;
virtual
bool
CanRepeat
(
SfxRepeatTarget
&
rTarget
)
const
SAL_OVERRIDE
;
virtual
OUString
GetComment
()
const
SAL_OVERRIDE
;
private
:
void
DoChange
(
ScDocument
*
pDoc
);
boost
::
scoped_ptr
<
ScDocument
>
mpUndoDoc
;
boost
::
scoped_ptr
<
ScDocument
>
mpRedoDoc
;
ScRange
maRange
;
};
class
ScUndoUseScenario
:
public
ScSimpleUndo
class
ScUndoUseScenario
:
public
ScSimpleUndo
{
{
...
...
sc/source/ui/src/globstr.src
Dosyayı görüntüle @
f2431c94
...
@@ -2071,6 +2071,11 @@ Resource RID_GLOBSTR
...
@@ -2071,6 +2071,11 @@ Resource RID_GLOBSTR
{
{
Text [ en-US ] = "Print Range Empty";
Text [ en-US ] = "Print Range Empty";
};
};
String STR_UNDO_CONDFORMAT
{
Text [ en-US ] = "Conditional Format";
};
};
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sc/source/ui/undo/undoblk.cxx
Dosyayı görüntüle @
f2431c94
...
@@ -61,6 +61,7 @@ TYPEINIT1(ScUndoCut, ScBlockUndo);
...
@@ -61,6 +61,7 @@ TYPEINIT1(ScUndoCut, ScBlockUndo);
TYPEINIT1
(
ScUndoPaste
,
SfxUndoAction
);
TYPEINIT1
(
ScUndoPaste
,
SfxUndoAction
);
TYPEINIT1
(
ScUndoDragDrop
,
SfxUndoAction
);
TYPEINIT1
(
ScUndoDragDrop
,
SfxUndoAction
);
TYPEINIT1
(
ScUndoListNames
,
SfxUndoAction
);
TYPEINIT1
(
ScUndoListNames
,
SfxUndoAction
);
TYPEINIT1
(
ScUndoConditionalFormat
,
SfxUndoAction
);
TYPEINIT1
(
ScUndoUseScenario
,
SfxUndoAction
);
TYPEINIT1
(
ScUndoUseScenario
,
SfxUndoAction
);
TYPEINIT1
(
ScUndoSelectionStyle
,
SfxUndoAction
);
TYPEINIT1
(
ScUndoSelectionStyle
,
SfxUndoAction
);
TYPEINIT1
(
ScUndoEnterMatrix
,
ScBlockUndo
);
TYPEINIT1
(
ScUndoEnterMatrix
,
ScBlockUndo
);
...
@@ -1430,6 +1431,57 @@ bool ScUndoListNames::CanRepeat(SfxRepeatTarget& rTarget) const
...
@@ -1430,6 +1431,57 @@ bool ScUndoListNames::CanRepeat(SfxRepeatTarget& rTarget) const
return
rTarget
.
ISA
(
ScTabViewTarget
);
return
rTarget
.
ISA
(
ScTabViewTarget
);
}
}
ScUndoConditionalFormat
::
ScUndoConditionalFormat
(
ScDocShell
*
pNewDocShell
,
ScDocument
*
pUndoDoc
,
ScDocument
*
pRedoDoc
,
const
ScRange
&
rRange
)
:
ScSimpleUndo
(
pNewDocShell
),
mpUndoDoc
(
pUndoDoc
),
mpRedoDoc
(
pRedoDoc
),
maRange
(
rRange
)
{
}
ScUndoConditionalFormat
::~
ScUndoConditionalFormat
()
{
}
OUString
ScUndoConditionalFormat
::
GetComment
()
const
{
return
ScGlobal
::
GetRscString
(
STR_UNDO_CONDFORMAT
);
}
void
ScUndoConditionalFormat
::
Undo
()
{
DoChange
(
mpUndoDoc
.
get
());
}
void
ScUndoConditionalFormat
::
Redo
()
{
DoChange
(
mpRedoDoc
.
get
());
}
void
ScUndoConditionalFormat
::
DoChange
(
ScDocument
*
pSrcDoc
)
{
ScDocument
*
pDoc
=
pDocShell
->
GetDocument
();
pDoc
->
DeleteAreaTab
(
maRange
,
IDF_ALL
);
pSrcDoc
->
CopyToDocument
(
maRange
,
IDF_ALL
,
false
,
pDoc
);
pDocShell
->
PostPaint
(
maRange
,
PAINT_GRID
);
pDocShell
->
PostDataChanged
();
ScTabViewShell
*
pViewShell
=
ScTabViewShell
::
GetActiveViewShell
();
if
(
pViewShell
)
pViewShell
->
CellContentChanged
();
}
void
ScUndoConditionalFormat
::
Repeat
(
SfxRepeatTarget
&
)
{
}
bool
ScUndoConditionalFormat
::
CanRepeat
(
SfxRepeatTarget
&
)
const
{
return
false
;
}
ScUndoUseScenario
::
ScUndoUseScenario
(
ScDocShell
*
pNewDocShell
,
ScUndoUseScenario
::
ScUndoUseScenario
(
ScDocShell
*
pNewDocShell
,
const
ScMarkData
&
rMark
,
const
ScMarkData
&
rMark
,
/*C*/
const
ScArea
&
rDestArea
,
/*C*/
const
ScArea
&
rDestArea
,
...
...
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