Hi Markus,
On Sat, Mar 31, 2012 at 18:36, Markus Mohrhard
<markus.mohrhard@googlemail.com> wrote:
And had to revert it immediately. We can use initializer lists because
older gcc versions don't know this feature. I got spammed by nearly
every of our tinderbox. I tried to fix them but the whole patch is
build around that.
Can you try to create a version of the patch without initializer list usage?
Shame, using them was kind of elegant. Attached a follow-on patch
which reverts the use of these lists.
Hope I got them all.
(I guess doing it as a follow-on patch should make easier if one whats
to go back to using lists in the future(?))
/Albert
From 33b68f52e399e7894b4307131c2d9629a3a76067 Mon Sep 17 00:00:00 2001
From: Albert Thuswaldner <albert.thuswaldner@gmail.com>
Date: Mon, 2 Apr 2012 22:00:59 +0200
Subject: [PATCH] fdo#45747 reverted use of init lists for backwards compabillity
---
sc/source/core/data/sortparam.cxx | 35 +++++++++++++++++++++++++++++------
sc/source/ui/dbgui/tpsort.cxx | 19 +++++++++++++++----
sc/source/ui/view/cellsh2.cxx | 4 +++-
3 files changed, 47 insertions(+), 11 deletions(-)
diff --git a/sc/source/core/data/sortparam.cxx b/sc/source/core/data/sortparam.cxx
index b7788e5..069e410 100644
--- a/sc/source/core/data/sortparam.cxx
+++ b/sc/source/core/data/sortparam.cxx
@@ -61,6 +61,8 @@ ScSortParam::ScSortParam( const ScSortParam& r ) :
void ScSortParam::Clear()
{
+ ScSortKeyState aKeyState;
+
nCol1=nCol2=nDestCol = 0;
nRow1=nRow2=nDestRow = 0;
nCompatHeader = 2;
@@ -71,8 +73,12 @@ void ScSortParam::Clear()
aCollatorLocale = ::com::sun::star::lang::Locale();
aCollatorAlgorithm = ::rtl::OUString();
+ aKeyState.bDoSort = false;
+ aKeyState.nField = 0;
+ aKeyState.bAscending = true;
+
// Initialize to default size
- maKeyState.assign( DEFSORT, { false, 0, true } );
+ maKeyState.assign( DEFSORT, aKeyState );
}
//------------------------------------------------------------------------
@@ -180,7 +186,9 @@ ScSortParam::ScSortParam( const ScSubTotalParam& rSub, const ScSortParam& rOld )
{
if (nNewCount < nSortSize)
{
- maKeyState[nNewCount] = { true, rSub.nField[i], rSub.bAscending };
+ maKeyState[nNewCount].bDoSort = true;
+ maKeyState[nNewCount].nField = rSub.nField[i];
+ maKeyState[nNewCount].bAscending = rSub.bAscending;
++nNewCount;
}
}
@@ -198,14 +206,20 @@ ScSortParam::ScSortParam( const ScSubTotalParam& rSub, const ScSortParam&
rOld )
{
if (nNewCount < nSortSize)
{
- maKeyState[nNewCount] = { true, nThisField, rOld.maKeyState[i].bAscending };
+ maKeyState[nNewCount].bDoSort = true;
+ maKeyState[nNewCount].nField = nThisField;
+ maKeyState[nNewCount].bAscending = rOld.maKeyState[i].bAscending;
++nNewCount;
}
}
}
for (i=nNewCount; i<nSortSize; i++) // Rest loeschen
- maKeyState.push_back( ScSortKeyState({ false, 0, true }) );
+ {
+ maKeyState[nNewCount].bDoSort = false;
+ maKeyState[nNewCount].nField = 0;
+ maKeyState[nNewCount].bAscending = true;
+ }
}
//------------------------------------------------------------------------
@@ -219,10 +233,19 @@ ScSortParam::ScSortParam( const ScQueryParam& rParam, SCCOL nCol ) :
bInplace(true),
nDestTab(0),nDestCol(0),nDestRow(0), nCompatHeader(2)
{
- maKeyState.push_back( ScSortKeyState( { true, nCol, true } ) );
+ ScSortKeyState aKeyState;
+ aKeyState.bDoSort = true;
+ aKeyState.nField = nCol;
+ aKeyState.bAscending = true;
+
+ maKeyState.push_back( aKeyState );
+
+ // Set the rest
+ aKeyState.bDoSort = false;
+ aKeyState.nField = 0;
for (sal_uInt16 i=1; i<GetSortKeyCount(); i++)
- maKeyState.push_back( ScSortKeyState( { false, 0, true } ) );
+ maKeyState.push_back( aKeyState );
}
//------------------------------------------------------------------------
diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index a964391..f36c0a3 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -165,10 +165,21 @@ void ScTabPageSortFields::Init()
aLbSort2.Clear();
aLbSort3.Clear();
- aLbSortArr = { &aLbSort1, &aLbSort2, &aLbSort3 };
- aBtnUp = { &aBtnUp1, &aBtnUp2, &aBtnUp3 };
- aBtnDown = { &aBtnDown1, &aBtnDown2, &aBtnDown3 };
- aFlArr = { &aFlSort1, &aFlSort2, &aFlSort3 };
+ aLbSortArr.push_back( &aLbSort1 );
+ aLbSortArr.push_back( &aLbSort2 );
+ aLbSortArr.push_back( &aLbSort3 );
+
+ aBtnUp.push_back( &aBtnUp1 );
+ aBtnUp.push_back( &aBtnUp2 );
+ aBtnUp.push_back( &aBtnUp3 );
+
+ aBtnDown.push_back( &aBtnDown1 );
+ aBtnDown.push_back( &aBtnDown2 );
+ aBtnDown.push_back( &aBtnDown3 );
+
+ aFlArr.push_back( &aFlSort1 );
+ aFlArr.push_back( &aFlSort2 );
+ aFlArr.push_back( &aFlSort3 );
}
// -----------------------------------------------------------------------
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index cc29587..a5f44a8 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -376,7 +376,9 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
aSortParam.bNaturalSort = false;
aSortParam.bIncludePattern = true;
aSortParam.bInplace = true;
- aSortParam.maKeyState[0] = { true, nCol, nSlotId == SID_SORT_ASCENDING };
+ aSortParam.maKeyState[0].bDoSort = true;
+ aSortParam.maKeyState[0].nField = nCol;
+ aSortParam.maKeyState[0].bAscending = ( nSlotId == SID_SORT_ASCENDING );
for ( sal_uInt16 i=1; i<aSortParam.GetSortKeyCount(); i++ )
aSortParam.maKeyState[i].bDoSort = false;
--
1.7.3.4
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.