summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-07-13 08:16:57 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-07-13 08:34:41 +0200
commit0234b73de28098fc1cd37b55471ef924d2b584cc (patch)
tree381537042f7b0754ce22a9082b48d9d4feae5b4b /sc
parent902082656655aeab559c0b5781907ff004179468 (diff)
don't use wrong sort direction in some cases
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/dbgui/tpsort.cxx21
1 files changed, 20 insertions, 1 deletions
diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 303d6c6b8efb..3dccaa086423 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -227,6 +227,17 @@ sal_Bool ScTabPageSortFields::FillItemSet( SfxItemSet& rArgSet )
{
ScSortParam aNewSortData = aSortData;
+ if (pDlg)
+ {
+ const SfxItemSet* pExample = pDlg->GetExampleSet();
+ const SfxPoolItem* pItem;
+ if ( pExample && pExample->GetItemState( nWhichSort, sal_True, &pItem ) == SFX_ITEM_SET )
+ {
+ ScSortParam aTempData = static_cast<const ScSortItem*>(pItem)->GetSortData();
+ aTempData.maKeyState = aNewSortData.maKeyState;
+ aNewSortData = aTempData;
+ }
+ }
std::vector<sal_uInt16> nSortPos;
for ( sal_uInt16 i=0; i<nSortKeyCount; i++ )
@@ -624,7 +635,8 @@ void ScTabPageSortOptions::Init()
// -----------------------------------------------------------------------
-SfxTabPage* ScTabPageSortOptions::Create( Window* pParent,
+SfxTabPage* ScTabPageSortOptions::Create(
+ Window* pParent,
const SfxItemSet& rArgSet )
{
return ( new ScTabPageSortOptions( pParent, rArgSet ) );
@@ -707,6 +719,13 @@ sal_Bool ScTabPageSortOptions::FillItemSet( SfxItemSet& rArgSet )
// Create local copy of ScParam
ScSortParam aNewSortData = aSortData;
+ if (pDlg)
+ {
+ const SfxItemSet* pExample = pDlg->GetExampleSet();
+ const SfxPoolItem* pItem;
+ if ( pExample && pExample->GetItemState( nWhichSort, sal_True, &pItem ) == SFX_ITEM_SET )
+ aNewSortData = static_cast<const ScSortItem*>(pItem)->GetSortData();
+ }
aNewSortData.bByRow = aBtnTopDown.IsChecked();
aNewSortData.bHasHeader = aBtnHeader.IsChecked();
aNewSortData.bCaseSens = aBtnCase.IsChecked();