summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorNiklas Nebel <nn@openoffice.org>2010-11-03 12:37:26 +0100
committerNiklas Nebel <nn@openoffice.org>2010-11-03 12:37:26 +0100
commitc7bb1a78a3db5a521d9ff225eb134377b1e9f5b2 (patch)
treeaf10397f19dbe1dde7593756706363808aa6d2dc /sc/source
parentc0b1151e425c4467ee8a9defae042497265523c3 (diff)
dr77: #i113491# repaint in ScStyleSheet::SetParent
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/conditio.cxx2
-rw-r--r--sc/source/core/data/documen3.cxx3
-rw-r--r--sc/source/core/data/documen8.cxx11
-rw-r--r--sc/source/core/data/stlsheet.cxx7
-rw-r--r--sc/source/core/data/table1.cxx6
-rw-r--r--sc/source/ui/inc/viewfunc.hxx5
-rw-r--r--sc/source/ui/unoobj/docuno.cxx6
-rw-r--r--sc/source/ui/view/formatsh.cxx8
-rw-r--r--sc/source/ui/view/viewfunc.cxx4
9 files changed, 36 insertions, 16 deletions
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index b08838198477..3fff9faf2105 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1432,7 +1432,7 @@ void ScConditionalFormat::DoRepaint( const ScRange* pModified )
}
}
- pSh->Broadcast( ScPaintHint( aRange, PAINT_GRID ) );
+ pDoc->RepaintRange( aRange );
}
}
}
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 8fea4b8af2b9..7dbdee417165 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -169,8 +169,7 @@ void ScDocument::SetDBCollection( ScDBCollection* pNewDBCollection, BOOL bRemove
RemoveFlagsTab( aOldRange.aStart.Col(), aOldRange.aStart.Row(),
aOldRange.aEnd.Col(), aOldRange.aEnd.Row(),
aOldRange.aStart.Tab(), SC_MF_AUTO );
- if (pShell)
- pShell->Broadcast( ScPaintHint( aOldRange, PAINT_GRID ) );
+ RepaintRange( aOldRange );
}
}
}
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index e3c9d251fab7..9eb4bad7466d 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -94,6 +94,7 @@
#include "sc.hrc"
#include "charthelper.hxx"
#include "dpobject.hxx"
+#include "docuno.hxx"
#define GET_SCALEVALUE(set,id) ((const SfxUInt16Item&)(set.Get( id ))).GetValue()
@@ -902,6 +903,16 @@ void ScDocument::RemoveAutoSpellObj()
pTab[nTab]->RemoveAutoSpellObj();
}
+void ScDocument::RepaintRange( const ScRange& rRange )
+{
+ if ( bIsVisible && pShell )
+ {
+ ScModelObj* pModel = ScModelObj::getImplementation( pShell->GetModel() );
+ if ( pModel )
+ pModel->RepaintRange( rRange ); // locked repaints are checked there
+ }
+}
+
//------------------------------------------------------------------------
BOOL ScDocument::IdleCheckLinks() // TRUE = demnaechst wieder versuchen
diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx
index a3319eafd3fd..bfe3fa04a398 100644
--- a/sc/source/core/data/stlsheet.cxx
+++ b/sc/source/core/data/stlsheet.cxx
@@ -136,6 +136,13 @@ BOOL __EXPORT ScStyleSheet::SetParent( const String& rParentName )
{
SfxItemSet& rParentSet = pStyle->GetItemSet();
GetItemSet().SetParent( &rParentSet );
+
+ // #i113491# Drag&Drop in the stylist's hierarchical view doesn't execute a slot,
+ // so the repaint has to come from here (after modifying the ItemSet).
+ // RepaintRange checks the document's IsVisible flag and locked repaints.
+ ScDocument* pDoc = static_cast<ScStyleSheetPool&>(GetPool()).GetDocument();
+ if (pDoc)
+ pDoc->RepaintRange( ScRange( 0,0,0, MAXCOL,MAXROW,MAXTAB ) );
}
}
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index e534bb9dfb78..151478324ef7 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -1267,11 +1267,7 @@ void ScTable::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW
{
UpdatePageBreaks(NULL);
- SfxObjectShell* pDocSh = pDocument->GetDocumentShell();
- if (pDocSh)
- pDocSh->Broadcast( ScPaintHint(
- ScRange(0,0,nTab,MAXCOL,MAXROW,nTab),
- PAINT_GRID ) );
+ pDocument->RepaintRange( ScRange(0,0,nTab,MAXCOL,MAXROW,nTab) );
}
}
}
diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx
index 59da2966cc60..60dc1bc7b115 100644
--- a/sc/source/ui/inc/viewfunc.hxx
+++ b/sc/source/ui/inc/viewfunc.hxx
@@ -53,6 +53,7 @@ class SfxItemSet;
class SvxBorderLine;
class SvxBoxItem;
class SvxBoxInfoItem;
+class SfxStyleSheetBase;
class SfxStyleSheet;
class SfxPoolItem;
class EditTextObject;
@@ -187,8 +188,8 @@ public:
const SfxStyleSheet* GetStyleSheetFromMarked();
void SetStyleSheetToMarked( SfxStyleSheet* pStyleSheet,
BOOL bRecord = TRUE );
- void RemoveStyleSheetInUse( SfxStyleSheet* pStyleSheet );
- void UpdateStyleSheetInUse( SfxStyleSheet* pStyleSheet );
+ void RemoveStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet );
+ void UpdateStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet );
void SetNumberFormat( short nFormatType, ULONG nAdd = 0 );
void SetNumFmtByStr( const String& rCode );
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 3d3f0f479601..d08e2cdc4bf5 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -449,6 +449,12 @@ ScSheetSaveData* ScModelObj::GetSheetSaveData()
return NULL;
}
+void ScModelObj::RepaintRange( const ScRange& rRange )
+{
+ if (pDocShell)
+ pDocShell->PostPaint( rRange, PAINT_GRID );
+}
+
uno::Any SAL_CALL ScModelObj::queryInterface( const uno::Type& rType )
throw(uno::RuntimeException)
{
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 12a1bb87211b..3ff7222178f3 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -453,7 +453,7 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
{
if ( pStyleSheet )
{
- pTabViewShell->RemoveStyleSheetInUse( (SfxStyleSheet*)pStyleSheet );
+ pTabViewShell->RemoveStyleSheetInUse( pStyleSheet );
pStylePool->Remove( pStyleSheet );
pTabViewShell->InvalidateAttribs();
nRetMask = TRUE;
@@ -556,7 +556,7 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
// Attribute uebernehmen und Style anwenden
pStyleSheet->GetItemSet().Put( aAttrSet );
- pTabViewShell->UpdateStyleSheetInUse( (SfxStyleSheet*)pStyleSheet );
+ pTabViewShell->UpdateStyleSheetInUse( pStyleSheet );
// call SetStyleSheetToMarked after adding the ScUndoModifyStyle
// (pStyleSheet pointer is used!)
@@ -578,7 +578,7 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
}
pStyleSheet->GetItemSet().Put( aAttrSet );
- pTabViewShell->UpdateStyleSheetInUse( (SfxStyleSheet*)pStyleSheet );
+ pTabViewShell->UpdateStyleSheetInUse( pStyleSheet );
// call SetStyleSheetToMarked after adding the ScUndoModifyStyle
// (pStyleSheet pointer is used!)
@@ -868,7 +868,7 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq )
(const SvxNumberInfoItem&)
*(pDocSh->GetItem(SID_ATTR_NUMBERFORMAT_INFO)) );
- pTabViewShell->UpdateStyleSheetInUse( (SfxStyleSheet*)pStyleSheet );
+ pTabViewShell->UpdateStyleSheetInUse( pStyleSheet );
pTabViewShell->InvalidateAttribs();
}
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index 231eb4e67562..e0ebb8f3024f 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -1545,7 +1545,7 @@ void ScViewFunc::SetStyleSheetToMarked( SfxStyleSheet* pStyleSheet, BOOL bRecord
}
-void ScViewFunc::RemoveStyleSheetInUse( SfxStyleSheet* pStyleSheet )
+void ScViewFunc::RemoveStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet )
{
if ( !pStyleSheet) return;
// -------------------------------------------------------------------
@@ -1572,7 +1572,7 @@ void ScViewFunc::RemoveStyleSheetInUse( SfxStyleSheet* pStyleSheet )
pHdl->ForgetLastPattern();
}
-void ScViewFunc::UpdateStyleSheetInUse( SfxStyleSheet* pStyleSheet )
+void ScViewFunc::UpdateStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet )
{
if ( !pStyleSheet) return;
// -------------------------------------------------------------------