diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2011-09-05 22:01:41 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2011-09-06 23:53:43 +0200 |
commit | 5b47818367290640421f835bdd038bc35c6b0781 (patch) | |
tree | 62c41a82c50a3b41d2f576d80c66bec19323510c /sc | |
parent | 450b31a056a8fb277a7b5f1e6827bb85b4c1f9fd (diff) |
merge area does not need to be increased if a shadow is attached
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/attarray.hxx | 2 | ||||
-rw-r--r-- | sc/inc/column.hxx | 2 | ||||
-rw-r--r-- | sc/inc/document.hxx | 6 | ||||
-rw-r--r-- | sc/inc/table.hxx | 2 | ||||
-rw-r--r-- | sc/qa/unit/ucalc.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/data/attarray.cxx | 15 | ||||
-rw-r--r-- | sc/source/core/data/column.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/data/documen9.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/document.cxx | 12 | ||||
-rw-r--r-- | sc/source/core/data/table2.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/docshell/docfunc.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/undo/undoblk.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/printfun.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/viewdata.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun3.cxx | 2 |
15 files changed, 29 insertions, 42 deletions
diff --git a/sc/inc/attarray.hxx b/sc/inc/attarray.hxx index 291e182ac69c..b3fe1a5982a6 100644 --- a/sc/inc/attarray.hxx +++ b/sc/inc/attarray.hxx @@ -161,7 +161,7 @@ public: bool HasAttrib( SCROW nRow1, SCROW nRow2, sal_uInt16 nMask ) const; sal_Bool ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow, SCCOL& rPaintCol, SCROW& rPaintRow, - sal_Bool bRefresh, sal_Bool bAttrs ); + sal_Bool bRefresh ); sal_Bool RemoveAreaMerge( SCROW nStartRow, SCROW nEndRow ); void FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBoolRowSegments& rUsedRows, bool bReset ); diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 6ce3bed4639e..7e21ba884740 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -156,7 +156,7 @@ public: bool HasAttribSelection( const ScMarkData& rMark, sal_uInt16 nMask ) const; bool ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow, SCCOL& rPaintCol, SCROW& rPaintRow, - bool bRefresh, bool bAttrs ); + bool bRefresh ); bool IsEmptyVisData(bool bNotes) const; // without Broadcaster bool IsEmptyData() const; diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 97ed45e9a5e6..a73a39183699 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -821,11 +821,11 @@ public: sal_Bool ExtendMergeSel( SCCOL nStartCol, SCROW nStartRow, SCCOL& rEndCol, SCROW& rEndRow, const ScMarkData& rMark, - sal_Bool bRefresh = false, sal_Bool bAttrs = false ); + sal_Bool bRefresh = false ); sal_Bool ExtendMerge( SCCOL nStartCol, SCROW nStartRow, SCCOL& rEndCol, SCROW& rEndRow, SCTAB nTab, - sal_Bool bRefresh = false, sal_Bool bAttrs = false ); - sal_Bool ExtendMerge( ScRange& rRange, sal_Bool bRefresh = false, sal_Bool bAttrs = false ); + sal_Bool bRefresh = false ); + sal_Bool ExtendMerge( ScRange& rRange, sal_Bool bRefresh = false ); sal_Bool ExtendTotalMerge( ScRange& rRange ); SC_DLLPUBLIC sal_Bool ExtendOverlapped( SCCOL& rStartCol, SCROW& rStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab ); diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index f85852da3f26..efe483d4a5b0 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -512,7 +512,7 @@ public: bool HasAttribSelection( const ScMarkData& rMark, sal_uInt16 nMask ) const; bool ExtendMerge( SCCOL nStartCol, SCROW nStartRow, SCCOL& rEndCol, SCROW& rEndRow, - bool bRefresh, bool bAttrs ); + bool bRefresh ); const SfxPoolItem* GetAttr( SCCOL nCol, SCROW nRow, sal_uInt16 nWhich ) const; const ScPatternAttr* GetPattern( SCCOL nCol, SCROW nRow ) const; const ScPatternAttr* GetMostUsedPattern( SCCOL nCol, SCROW nStartRow, SCROW nEndRow ) const; diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 543c912a3512..e32c28b7906d 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -2284,14 +2284,14 @@ void Test::testMergedCells() m_pDoc->DoMerge(0, 1, 1, 3, 3, false); SCCOL nEndCol = 1; SCROW nEndRow = 1; - m_pDoc->ExtendMerge( 1, 1, nEndCol, nEndRow, 0, false, false); + m_pDoc->ExtendMerge( 1, 1, nEndCol, nEndRow, 0, false); CPPUNIT_ASSERT_MESSAGE("did not merge cells", nEndCol == 3 && nEndRow == 3); ScDocFunc aDocFunc(*m_xDocShRef); ScRange aRange(0,2,0,MAXCOL,2,0); ScMarkData aMark; aMark.SetMarkArea(aRange); aDocFunc.InsertCells(aRange, &aMark, INS_INSROWS, true, true); - m_pDoc->ExtendMerge( 1, 1, nEndCol, nEndRow, 0, false, false); + m_pDoc->ExtendMerge( 1, 1, nEndCol, nEndRow, 0, false); cout << nEndRow << nEndCol; //have a look why this does not work //CPPUNIT_ASSERT_MESSAGE("did not increase merge area", nEndCol == 3 && nEndRow == 4); diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index 4296beb707a0..d2a75b126b5a 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -1352,7 +1352,7 @@ bool ScAttrArray::HasAttrib( SCROW nRow1, SCROW nRow2, sal_uInt16 nMask ) const // Area around any given summaries expand and adapt any MergeFlag (bRefresh) sal_Bool ScAttrArray::ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow, SCCOL& rPaintCol, SCROW& rPaintRow, - sal_Bool bRefresh, sal_Bool bAttrs ) + sal_Bool bRefresh ) { const ScPatternAttr* pPattern; const ScMergeAttr* pItem; @@ -1379,19 +1379,6 @@ sal_Bool ScAttrArray::ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRo rPaintRow = nMergeEndRow; bFound = sal_True; - if (bAttrs) - { - const SvxShadowItem* pShadow = - (const SvxShadowItem*) &pPattern->GetItem( ATTR_SHADOW ); - SvxShadowLocation eLoc = pShadow->GetLocation(); - if ( eLoc == SVX_SHADOW_TOPRIGHT || eLoc == SVX_SHADOW_BOTTOMRIGHT ) - if ( nMergeEndCol+1 > rPaintCol && nMergeEndCol < MAXCOL ) - rPaintCol = nMergeEndCol+1; - if ( eLoc == SVX_SHADOW_BOTTOMLEFT || eLoc == SVX_SHADOW_BOTTOMRIGHT ) - if ( nMergeEndRow+1 > rPaintRow && nMergeEndRow < MAXROW ) - rPaintRow = nMergeEndRow+1; - } - if (bRefresh) { if ( nMergeEndCol > nThisCol ) diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 680861723040..055dec55b628 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -280,9 +280,9 @@ bool ScColumn::HasAttribSelection( const ScMarkData& rMark, sal_uInt16 nMask ) c bool ScColumn::ExtendMerge( SCCOL nThisCol, SCROW nStartRow, SCROW nEndRow, SCCOL& rPaintCol, SCROW& rPaintRow, - bool bRefresh, bool bAttrs ) + bool bRefresh ) { - return pAttrArray->ExtendMerge( nThisCol, nStartRow, nEndRow, rPaintCol, rPaintRow, bRefresh, bAttrs ); + return pAttrArray->ExtendMerge( nThisCol, nStartRow, nEndRow, rPaintCol, rPaintRow, bRefresh ); } diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx index 86bc7677f762..f7561608e50d 100644 --- a/sc/source/core/data/documen9.cxx +++ b/sc/source/core/data/documen9.cxx @@ -513,7 +513,7 @@ sal_Bool ScDocument::IsPrintEmpty( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCROW nTmpRow = nEndRow; pThis->ExtendMerge( 0,nStartRow, nExtendCol,nTmpRow, nTab, - false, sal_True ); // kein Refresh, incl. Attrs + false ); // kein Refresh, incl. Attrs OutputDevice* pDev = pThis->GetPrinter(); pDev->SetMapMode( MAP_PIXEL ); // wichtig fuer GetNeededSize diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index dcb95021d48c..5522ac169e67 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -4977,7 +4977,7 @@ sal_Bool ScDocument::ExtendOverlapped( SCCOL& rStartCol, SCROW& rStartRow, sal_Bool ScDocument::ExtendMergeSel( SCCOL nStartCol, SCROW nStartRow, SCCOL& rEndCol, SCROW& rEndRow, - const ScMarkData& rMark, sal_Bool bRefresh, sal_Bool bAttrs ) + const ScMarkData& rMark, sal_Bool bRefresh ) { // use all selected sheets from rMark @@ -4992,7 +4992,7 @@ sal_Bool ScDocument::ExtendMergeSel( SCCOL nStartCol, SCROW nStartRow, { SCCOL nThisEndCol = nOldEndCol; SCROW nThisEndRow = nOldEndRow; - if ( ExtendMerge( nStartCol, nStartRow, nThisEndCol, nThisEndRow, *itr, bRefresh, bAttrs ) ) + if ( ExtendMerge( nStartCol, nStartRow, nThisEndCol, nThisEndRow, *itr, bRefresh ) ) bFound = true; if ( nThisEndCol > rEndCol ) rEndCol = nThisEndCol; @@ -5006,13 +5006,13 @@ sal_Bool ScDocument::ExtendMergeSel( SCCOL nStartCol, SCROW nStartRow, sal_Bool ScDocument::ExtendMerge( SCCOL nStartCol, SCROW nStartRow, SCCOL& rEndCol, SCROW& rEndRow, - SCTAB nTab, sal_Bool bRefresh, sal_Bool bAttrs ) + SCTAB nTab, sal_Bool bRefresh ) { bool bFound = false; if ( ValidColRow(nStartCol,nStartRow) && ValidColRow(rEndCol,rEndRow) && ValidTab(nTab) ) { if (nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab]) - bFound = maTabs[nTab]->ExtendMerge( nStartCol, nStartRow, rEndCol, rEndRow, bRefresh, bAttrs ); + bFound = maTabs[nTab]->ExtendMerge( nStartCol, nStartRow, rEndCol, rEndRow, bRefresh ); if (bRefresh) RefreshAutoFilter( nStartCol, nStartRow, rEndCol, rEndRow, nTab ); @@ -5026,7 +5026,7 @@ sal_Bool ScDocument::ExtendMerge( SCCOL nStartCol, SCROW nStartRow, } -sal_Bool ScDocument::ExtendMerge( ScRange& rRange, sal_Bool bRefresh, sal_Bool bAttrs ) +sal_Bool ScDocument::ExtendMerge( ScRange& rRange, sal_Bool bRefresh ) { bool bFound = false; SCTAB nStartTab = rRange.aStart.Tab(); @@ -5041,7 +5041,7 @@ sal_Bool ScDocument::ExtendMerge( ScRange& rRange, sal_Bool bRefresh, sal_Bool b SCROW nExtendRow = rRange.aEnd.Row(); if (ExtendMerge( rRange.aStart.Col(), rRange.aStart.Row(), nExtendCol, nExtendRow, - nTab, bRefresh, bAttrs ) ) + nTab, bRefresh ) ) { bFound = true; if (nExtendCol > nEndCol) nEndCol = nExtendCol; diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 812b07f4ccce..6b1835970f14 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -1397,7 +1397,7 @@ bool ScTable::HasAttribSelection( const ScMarkData& rMark, sal_uInt16 nMask ) co bool ScTable::ExtendMerge( SCCOL nStartCol, SCROW nStartRow, SCCOL& rEndCol, SCROW& rEndRow, - bool bRefresh, bool bAttrs ) + bool bRefresh ) { if (!(ValidCol(nStartCol) && ValidCol(rEndCol))) { @@ -1408,7 +1408,7 @@ bool ScTable::ExtendMerge( SCCOL nStartCol, SCROW nStartRow, SCCOL nOldEndX = rEndCol; SCROW nOldEndY = rEndRow; for (SCCOL i=nStartCol; i<=nOldEndX; i++) - bFound |= aCol[i].ExtendMerge( i, nStartRow, nOldEndY, rEndCol, rEndRow, bRefresh, bAttrs ); + bFound |= aCol[i].ExtendMerge( i, nStartRow, nOldEndY, rEndCol, rEndRow, bRefresh ); return bFound; } diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 7d2774b47942..7410da8f224e 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -1537,7 +1537,7 @@ sal_Bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMa { ScRange aRange( nTestCol, nTestRow1, i ); pDoc->ExtendOverlapped(aRange); - pDoc->ExtendMerge(aRange, sal_True, sal_True); + pDoc->ExtendMerge(aRange, sal_True); if( nTestRow1 < nTestRow2 && nNewFlags == SC_MF_HOR ) { @@ -1545,7 +1545,7 @@ sal_Bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMa { ScRange aTestRange( nTestCol, nTestRow, i ); pDoc->ExtendOverlapped( aTestRange ); - pDoc->ExtendMerge( aTestRange, sal_True, sal_True); + pDoc->ExtendMerge( aTestRange, sal_True); ScRange aMergeRange( aTestRange.aStart.Col(),aTestRange.aStart.Row(), i ); if( !aExtendRange.In( aMergeRange ) ) { @@ -1940,7 +1940,7 @@ sal_Bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMa { ScRange aRange( nTestCol, nTestRow1, i ); pDoc->ExtendOverlapped( aRange ); - pDoc->ExtendMerge( aRange, sal_True, sal_True ); + pDoc->ExtendMerge( aRange, sal_True ); if( nTestRow1 < nTestRow2 && nNewFlags == SC_MF_HOR ) { @@ -1948,7 +1948,7 @@ sal_Bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMa { ScRange aTestRange( nTestCol, nTestRow, i ); pDoc->ExtendOverlapped( aTestRange ); - pDoc->ExtendMerge( aTestRange, sal_True, sal_True); + pDoc->ExtendMerge( aTestRange, sal_True ); ScRange aMergeRange( aTestRange.aStart.Col(),aTestRange.aStart.Row(), i ); if( !aExtendRange.In( aMergeRange ) ) { @@ -4446,7 +4446,7 @@ bool ScDocFunc::UnmergeCells( const ScCellMergeOption& rOption, sal_Bool bRecord aExtended.aEnd.Col(), aExtended.aEnd.Row(), nTab, SC_MF_HOR | SC_MF_VER ); - pDoc->ExtendMerge( aRefresh, sal_True, false ); + pDoc->ExtendMerge( aRefresh, sal_True ); if ( !AdjustRowHeight( aExtended ) ) rDocShell.PostPaint( aExtended, PAINT_GRID ); diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx index 6625dc08be77..79496b01ddd3 100644 --- a/sc/source/ui/undo/undoblk.cxx +++ b/sc/source/ui/undo/undoblk.cxx @@ -2136,7 +2136,7 @@ void ScUndoRemoveMerge::Redo() maOption.mnEndCol, maOption.mnEndRow, nTab, SC_MF_HOR | SC_MF_VER ); - pDoc->ExtendMerge(aRange, true, false); + pDoc->ExtendMerge(aRange, true); // Paint diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index a1ee4dfb457f..43d6a5d481b2 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -757,7 +757,7 @@ sal_Bool ScPrintFunc::AdjustPrintArea( sal_Bool bNew ) } pDoc->ExtendMerge( nStartCol,nStartRow, nEndCol,nEndRow, nPrintTab, - false, sal_True ); // kein Refresh, incl. Attrs + false ); // kein Refresh, incl. Attrs if ( bChangeCol ) { diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 37830ee3bf84..10b9e4160de5 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -1831,7 +1831,7 @@ sal_Bool ScViewData::GetPosFromPixel( long nClickX, long nClickY, ScSplitPos eWh pDoc->RemoveFlagsTab( 0,0, MAXCOL,MAXROW, nTabNo, SC_MF_HOR | SC_MF_VER ); SCCOL nEndCol = MAXCOL; SCROW nEndRow = MAXROW; - pDoc->ExtendMerge( 0,0, nEndCol,nEndRow, nTabNo, sal_True, false ); + pDoc->ExtendMerge( 0,0, nEndCol,nEndRow, nTabNo, sal_True ); if (pDocShell) pDocShell->PostPaint( ScRange(0,0,nTabNo,MAXCOL,MAXROW,nTabNo), PAINT_GRID ); } diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index a3c1ab317eb9..bc418f7b6352 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -1270,7 +1270,7 @@ sal_Bool ScViewFunc::PasteFromClip( sal_uInt16 nFlags, ScDocument* pClipDoc, { ScRange aRange(nCol, nRow1, nStartTab); pDoc->ExtendOverlapped(aRange); - pDoc->ExtendMerge(aRange, sal_True, sal_True); + pDoc->ExtendMerge(aRange, sal_True); rDocFunc.UnmergeCells(aRange, bRecord, sal_True); } } |