summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2012-07-17 12:47:29 +0200
committerMatúš Kukan <matus.kukan@gmail.com>2012-07-17 16:40:32 +0200
commit864c1402e2ef9964ed69f7cad937400487bab889 (patch)
tree4b3f2418bbba744bfab780c6396512326b5bd2bd
parenttubes: do not freeze when preparing Account Manager (diff)
downloadcore-864c1402e2ef9964ed69f7cad937400487bab889.tar.gz
core-864c1402e2ef9964ed69f7cad937400487bab889.zip
tubes: rearranged some lines for readability of code
Change-Id: Ifd5b086e687842721247ba893d22a2514710625d
-rw-r--r--sc/source/ui/view/viewfunc.cxx12
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 );