[Libreoffice-commits] .: 2 commits - sc/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Aug 27 07:35:32 PDT 2012
sc/source/core/data/table3.cxx | 49 ++++++++++++++++++++++---------------
sc/source/ui/optdlg/tpdefaults.cxx | 2 -
2 files changed, 31 insertions(+), 20 deletions(-)
New commits:
commit 1b0a7dc8b787b7be31b1b58a5ea6a9fc7207996d
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sun Aug 26 14:04:37 2012 +0200
when swaping cols or rows insert notes at the right place, fdo#53979
Change-Id: I1228b3a064623e810265b47776e33f81f4bf0e51
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index ef7b3b6..1ea61fb 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -563,7 +563,9 @@ void ScTable::QuickSort( ScSortInfoArray* pArray, SCsCOLROW nLo, SCsCOLROW nHi )
void ScTable::SwapCol(SCCOL nCol1, SCCOL nCol2)
{
- for (SCROW nRow = aSortParam.nRow1; nRow <= aSortParam.nRow2; nRow++)
+ SCROW nRowStart = aSortParam.nRow1;
+ SCROW nRowEnd = aSortParam.nRow2;
+ for (SCROW nRow = nRowStart; nRow <= nRowEnd; nRow++)
{
aCol[nCol1].SwapCell(nRow, aCol[nCol2]);
if (aSortParam.bIncludePattern)
@@ -589,16 +591,19 @@ void ScTable::SwapCol(SCCOL nCol1, SCCOL nCol2)
ScPostIt* pPostIt = itr->second;
++itr;
- if (nCol == nCol1)
+ if(nRow >= nRowStart && nRow <= nRowEnd)
{
- aNoteMap.insert(nCol, nRow, pPostIt);
- maNotes.ReleaseNote(nCol2, nRow);
- }
- else if (nCol == nCol2)
- {
- aNoteMap.insert(nCol, nRow, pPostIt);
- maNotes.ReleaseNote(nCol1, nRow);
+ if (nCol == nCol1)
+ {
+ aNoteMap.insert(nCol2, nRow, pPostIt);
+ maNotes.ReleaseNote(nCol, nRow);
+ }
+ else if (nCol == nCol2)
+ {
+ aNoteMap.insert(nCol1, nRow, pPostIt);
+ maNotes.ReleaseNote(nCol, nRow);
+ }
}
}
@@ -609,6 +614,7 @@ void ScTable::SwapCol(SCCOL nCol1, SCCOL nCol2)
SCCOL nCol = itr->first.first;
SCROW nRow = itr->first.second;
ScPostIt* pPostIt = itr->second;
+ ++itr;
maNotes.insert(nCol, nRow, pPostIt);
aNoteMap.ReleaseNote(nCol, nRow);
@@ -617,7 +623,9 @@ void ScTable::SwapCol(SCCOL nCol1, SCCOL nCol2)
void ScTable::SwapRow(SCROW nRow1, SCROW nRow2)
{
- for (SCCOL nCol = aSortParam.nCol1; nCol <= aSortParam.nCol2; nCol++)
+ SCCOL nColStart = aSortParam.nCol1;
+ SCCOL nColEnd = aSortParam.nCol2;
+ for (SCCOL nCol = nColStart; nCol <= nColEnd; nCol++)
{
aCol[nCol].SwapRow(nRow1, nRow2);
if (aSortParam.bIncludePattern)
@@ -655,16 +663,18 @@ void ScTable::SwapRow(SCROW nRow1, SCROW nRow2)
ScPostIt* pPostIt = itr->second;
++itr;
- if (nRow == nRow1)
+ if( nCol >= nColStart && nCol <= nColEnd )
{
- aNoteMap.insert(nCol, nRow, pPostIt);
- maNotes.ReleaseNote(nCol, nRow2);
- }
- else if (nRow == nRow2)
- {
- aNoteMap.insert(nCol, nRow, pPostIt);
- maNotes.ReleaseNote(nCol, nRow1);
-
+ if (nRow == nRow1)
+ {
+ aNoteMap.insert(nCol, nRow2, pPostIt);
+ maNotes.ReleaseNote(nCol, nRow);
+ }
+ else if (nRow == nRow2)
+ {
+ aNoteMap.insert(nCol, nRow1, pPostIt);
+ maNotes.ReleaseNote(nCol, nRow);
+ }
}
}
@@ -675,6 +685,7 @@ void ScTable::SwapRow(SCROW nRow1, SCROW nRow2)
SCCOL nCol = itr->first.first;
SCROW nRow = itr->first.second;
ScPostIt* pPostIt = itr->second;
+ ++itr;
maNotes.insert(nCol, nRow, pPostIt);
aNoteMap.ReleaseNote(nCol, nRow);
commit 4d3ad7c59e0d0fe322c76eb4335440e1d1269ac0
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Mon Aug 27 09:58:27 2012 -0400
Quick indentation fix on closing brace.
Change-Id: I8626b0b3338e17b1b0fc713d4dba5545e1faba1c
diff --git a/sc/source/ui/optdlg/tpdefaults.cxx b/sc/source/ui/optdlg/tpdefaults.cxx
index c0db2c1..5020b9c 100644
--- a/sc/source/ui/optdlg/tpdefaults.cxx
+++ b/sc/source/ui/optdlg/tpdefaults.cxx
@@ -65,7 +65,7 @@ ScTpDefaultsOptions::ScTpDefaultsOptions(Window *pParent, const SfxItemSet &rCor
aEdNSheets.SetPosPixel( aNewPoint );
aNewPoint.Y() = aEdSheetPrefix.GetPosPixel().Y();
aEdSheetPrefix.SetPosPixel( aNewPoint );
- }
+ }
aEdNSheets.SetModifyHdl( LINK(this, ScTpDefaultsOptions, NumModifiedHdl) );
aEdSheetPrefix.SetModifyHdl( LINK(this, ScTpDefaultsOptions, PrefixModifiedHdl) );
aEdSheetPrefix.SetGetFocusHdl( LINK(this, ScTpDefaultsOptions, PrefixEditOnFocusHdl) );
More information about the Libreoffice-commits
mailing list