summaryrefslogtreecommitdiff
path: root/sc/source/core
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core')
-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--[-rwxr-xr-x]sc/source/core/data/drwlayer.cxx0
-rw-r--r--[-rwxr-xr-x]sc/source/core/data/makefile.mk1
-rw-r--r--sc/source/core/data/postit.cxx7
-rw-r--r--sc/source/core/data/stlsheet.cxx7
-rw-r--r--sc/source/core/data/table1.cxx6
-rw-r--r--sc/source/core/inc/core_pch.hxx2
-rw-r--r--sc/source/core/tool/formulaparserpool.cxx21
10 files changed, 34 insertions, 26 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 f3b3f1ab32c6..b64babdf2dd7 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/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 4df709768279..4df709768279 100755..100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
diff --git a/sc/source/core/data/makefile.mk b/sc/source/core/data/makefile.mk
index 95ce6bcec179..51c01febcd36 100755..100644
--- a/sc/source/core/data/makefile.mk
+++ b/sc/source/core/data/makefile.mk
@@ -140,6 +140,7 @@ EXCEPTIONSFILES= \
$(SLO)$/documen3.obj \
$(SLO)$/documen5.obj \
$(SLO)$/documen6.obj \
+ $(SLO)$/documen8.obj \
$(SLO)$/documen9.obj \
$(SLO)$/dpcachetable.obj \
$(SLO)$/dptablecache.obj \
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index a4bc9a473768..999a3194eaa6 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -762,10 +762,13 @@ void ScPostIt::RemoveCaption()
{
pDrawPage->RecalcObjOrdNums();
// create drawing undo action (before removing the object to have valid draw page in undo action)
- if( pDrawLayer && pDrawLayer->IsRecording() )
+ bool bRecording = ( pDrawLayer && pDrawLayer->IsRecording() );
+ if( bRecording )
pDrawLayer->AddCalcUndo( pDrawLayer->GetSdrUndoFactory().CreateUndoDeleteObject( *maNoteData.mpCaption ) );
// remove the object from the drawing page, delete if undo is disabled
- pDrawPage->RemoveObject( maNoteData.mpCaption->GetOrdNum() );
+ SdrObject* pObj = pDrawPage->RemoveObject( maNoteData.mpCaption->GetOrdNum() );
+ if( !bRecording )
+ SdrObject::Free( pObj );
}
}
maNoteData.mpCaption = 0;
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/core/inc/core_pch.hxx b/sc/source/core/inc/core_pch.hxx
index 899169154d8d..36595fe4c956 100644
--- a/sc/source/core/inc/core_pch.hxx
+++ b/sc/source/core/inc/core_pch.hxx
@@ -125,7 +125,7 @@
#include <vcl/outdev.hxx>
#include <vcl/pointr.hxx>
#include <vcl/ptrstyle.hxx>
-#include <vcl/wintypes.hxx>
+#include <tools/wintypes.hxx>
#include <vcl/event.hxx>
#include <tools/ownlist.hxx>
#include <svl/itempool.hxx>
diff --git a/sc/source/core/tool/formulaparserpool.cxx b/sc/source/core/tool/formulaparserpool.cxx
index 75d1c874eba8..c4c2f3b5a4ab 100644
--- a/sc/source/core/tool/formulaparserpool.cxx
+++ b/sc/source/core/tool/formulaparserpool.cxx
@@ -33,7 +33,6 @@
#include <com/sun/star/container/XContentEnumerationAccess.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/lang/XSingleComponentFactory.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/sheet/XFilterFormulaParser.hpp>
#include <rtl/instance.hxx>
#include <comphelper/processfactory.hxx>
@@ -62,27 +61,19 @@ public:
const OUString& rNamespace );
private:
- typedef ::std::hash_map<
- OUString,
- Reference< XSingleComponentFactory >,
- OUStringHash,
- ::std::equal_to< OUString > > FactoryMap;
+ typedef ::std::hash_map< OUString, Reference< XSingleComponentFactory >, OUStringHash > FactoryMap;
- Reference< XComponentContext > mxContext; /// Default context of global process factory.
+ Reference< XComponentContext > mxContext; /// Global component context.
FactoryMap maFactories; /// All parser factories, mapped by formula namespace.
};
-ScParserFactoryMap::ScParserFactoryMap()
+ScParserFactoryMap::ScParserFactoryMap() :
+ mxContext( ::comphelper::getProcessComponentContext() )
{
- try
+ if( mxContext.is() ) try
{
- // get process factory and default component context
- Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), UNO_SET_THROW );
- Reference< XPropertySet > xPropSet( xFactory, UNO_QUERY_THROW );
- mxContext.set( xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ), UNO_QUERY_THROW );
-
// enumerate all implementations of the FormulaParser service
- Reference< XContentEnumerationAccess > xFactoryEA( xFactory, UNO_QUERY_THROW );
+ Reference< XContentEnumerationAccess > xFactoryEA( mxContext->getServiceManager(), UNO_QUERY_THROW );
Reference< XEnumeration > xEnum( xFactoryEA->createContentEnumeration( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.FilterFormulaParser" ) ) ), UNO_SET_THROW );
while( xEnum->hasMoreElements() ) try // single try/catch for every element
{