dr77: #i113491# repaint in ScStyleSheet::SetParent

This commit is contained in:
Niklas Nebel 2010-11-03 12:37:26 +01:00
parent c0b1151e42
commit c7bb1a78a3
11 changed files with 40 additions and 16 deletions

View file

@ -1512,6 +1512,8 @@ public:
BOOL ContinueOnlineSpelling(); // TRUE = etwas gefunden
void RepaintRange( const ScRange& rRange );
BOOL IsIdleDisabled() const { return bIdleDisabled; }
void DisableIdle(BOOL bDo) { bIdleDisabled = bDo; }

View file

@ -134,6 +134,8 @@ public:
void AfterXMLLoading(sal_Bool bRet);
ScSheetSaveData* GetSheetSaveData();
void RepaintRange( const ScRange& rRange );
bool HasChangesListeners() const;
void NotifyChanges( const ::rtl::OUString& rOperation, const ScRangeList& rRanges,

View file

@ -1432,7 +1432,7 @@ void ScConditionalFormat::DoRepaint( const ScRange* pModified )
}
}
pSh->Broadcast( ScPaintHint( aRange, PAINT_GRID ) );
pDoc->RepaintRange( aRange );
}
}
}

View file

@ -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 );
}
}
}

View file

@ -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

View file

@ -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 ) );
}
}

View file

@ -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) );
}
}
}

View file

@ -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 );

View file

@ -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)
{

View file

@ -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();
}

View file

@ -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;
// -------------------------------------------------------------------