[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sc/inc sc/source
Eike Rathke
erack at redhat.com
Tue Dec 9 02:26:52 PST 2014
sc/inc/sortparam.hxx | 1 +
sc/source/core/data/table3.cxx | 1 +
sc/source/ui/undo/undosort.cxx | 20 +++++++++++++++++++-
3 files changed, 21 insertions(+), 1 deletion(-)
New commits:
commit 6293a90ea5026c06a0fba622831ae7e92168c3f3
Author: Eike Rathke <erack at redhat.com>
Date: Sun Dec 7 17:32:09 2014 +0100
add ReorderParam.mbHasHeaders to include in Undo range mark
Undo Sort did not select/mark the original range if it included header
row/column.
(cherry picked from commit ec1b1af8af7ead149f96c09e16402e66e0973372)
Backported with merge conflicts.
umm.. row is row and col is col
(cherry picked from commit 413a0655adec3e9364bc94afff638a5a9f88560c)
26c62fa1fc97aa0dd4eda1102422e5f012a126eb
Change-Id: Ie4c800e7a44fd910c871731673093400c6400e4a
Reviewed-on: https://gerrit.libreoffice.org/13379
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
diff --git a/sc/inc/sortparam.hxx b/sc/inc/sortparam.hxx
index 6f6364a..6735a13 100644
--- a/sc/inc/sortparam.hxx
+++ b/sc/inc/sortparam.hxx
@@ -98,6 +98,7 @@ struct SC_DLLPUBLIC ReorderParam
bool mbPattern;
bool mbHiddenFiltered;
bool mbUpdateRefs;
+ bool mbHasHeaders;
/**
* Reorder the position indices such that it can be used to undo the
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index b226c62..6a1a305 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -1416,6 +1416,7 @@ void ScTable::Sort(
pUndo->mbPattern = rSortParam.bIncludePattern;
pUndo->mbHiddenFiltered = bKeepQuery;
pUndo->mbUpdateRefs = bUpdateRefs;
+ pUndo->mbHasHeaders = rSortParam.bHasHeader;
}
if (rSortParam.bByRow)
diff --git a/sc/source/ui/undo/undosort.cxx b/sc/source/ui/undo/undosort.cxx
index f86bdc2..ea847cc 100644
--- a/sc/source/ui/undo/undosort.cxx
+++ b/sc/source/ui/undo/undosort.cxx
@@ -44,7 +44,25 @@ void UndoSort::Execute( bool bUndo )
aParam.reverse();
rDoc.Reorder(aParam, NULL);
- ScUndoUtil::MarkSimpleBlock(pDocShell, maParam.maSortRange);
+ if (maParam.mbHasHeaders)
+ {
+ ScRange aMarkRange( maParam.maSortRange);
+ if (maParam.mbByRow)
+ {
+ if (aMarkRange.aStart.Row() > 0)
+ aMarkRange.aStart.IncRow(-1);
+ }
+ else
+ {
+ if (aMarkRange.aStart.Col() > 0)
+ aMarkRange.aStart.IncCol(-1);
+ }
+ ScUndoUtil::MarkSimpleBlock(pDocShell, aMarkRange);
+ }
+ else
+ {
+ ScUndoUtil::MarkSimpleBlock(pDocShell, maParam.maSortRange);
+ }
rDoc.SetDirty(maParam.maSortRange);
if (!aParam.mbUpdateRefs)
More information about the Libreoffice-commits
mailing list