diff options
author | Eike Rathke <erack@redhat.com> | 2012-07-17 12:47:29 +0200 |
---|---|---|
committer | Matúš Kukan <matus.kukan@gmail.com> | 2012-07-17 16:40:32 +0200 |
commit | 864c1402e2ef9964ed69f7cad937400487bab889 (patch) | |
tree | 4b3f2418bbba744bfab780c6396512326b5bd2bd | |
parent | ce9bc65e125cff96e53e37116a5475260f773535 (diff) |
tubes: rearranged some lines for readability of code
Change-Id: Ifd5b086e687842721247ba893d22a2514710625d
-rw-r--r-- | sc/source/ui/view/viewfunc.cxx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 1ac9b21446af..4f0b3048a647 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -212,18 +212,16 @@ void ScViewFunc::DoAutoAttributes( SCCOL nCol, SCROW nRow, SCTAB nTab, aFormatSource.Col(), aFormatSource.Row(), nTab ); if ( !((const ScMergeAttr&)pSource->GetItem(ATTR_MERGE)).IsMerged() ) { - const ScPatternAttr* pDocOld = pDoc->GetPattern( nCol, nRow, nTab ); - // pDocOld is only valid till call ApplyPattern! - - const ScStyleSheet* pSrcStyle = pSource->GetStyleSheet(); - - // Ho hum ... - totally untested but looks fun ! :-) ScRange aRange( nCol, nRow, nTab, nCol, nRow, nTab ); ScMarkData aMark; aMark.SetMarkArea( aRange ); ScDocFunc &rFunc = GetViewData()->GetDocFunc(); - if ( pSrcStyle && pSrcStyle != pDocOld->GetStyleSheet() ) + + // pOldPattern is only valid until call to ApplyAttributes! + const ScPatternAttr* pOldPattern = pDoc->GetPattern( nCol, nRow, nTab ); + const ScStyleSheet* pSrcStyle = pSource->GetStyleSheet(); + if ( pSrcStyle && pSrcStyle != pOldPattern->GetStyleSheet() ) rFunc.ApplyStyle( aMark, pSrcStyle->GetName(), sal_True, sal_False ); rFunc.ApplyAttributes( aMark, *pSource, sal_True, sal_False ); |