summaryrefslogtreecommitdiffstats
path: root/sc/inc/nameuno.hxx
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2010-11-10 15:51:56 -0500
committerKohei Yoshida <kyoshida@novell.com>2010-11-10 15:51:56 -0500
commit75b796a60d0e224b4df985bb7799df5fb3480a52 (patch)
tree167881696ebc054424526219786239e5f4bf6e6b /sc/inc/nameuno.hxx
parentReplace ScfNoCopy in calc with boost::noncopyable. (diff)
downloadcore-75b796a60d0e224b4df985bb7799df5fb3480a52.tar.gz
core-75b796a60d0e224b4df985bb7799df5fb3480a52.zip
Disable document modify and broadcasting of changes on range names.
We don't need to set document status modified & broadcast changes on every single addition of range names during document import. Doing so would make the document import painfully slow esp with docs with lots of range names defined. (n#634257)
Diffstat (limited to 'sc/inc/nameuno.hxx')
-rw-r--r--sc/inc/nameuno.hxx56
1 files changed, 53 insertions, 3 deletions
diff --git a/sc/inc/nameuno.hxx b/sc/inc/nameuno.hxx
index 27d149b3d816..2583546e463e 100644
--- a/sc/inc/nameuno.hxx
+++ b/sc/inc/nameuno.hxx
@@ -52,7 +52,7 @@
class ScDocShell;
class ScRangeData;
class ScTokenArray;
-
+class ScNamedRangesObj;
class ScNamedRangeObj : public ::cppu::WeakImplHelper6<
::com::sun::star::sheet::XNamedRange,
@@ -64,6 +64,7 @@ class ScNamedRangeObj : public ::cppu::WeakImplHelper6<
public SfxListener
{
private:
+ ScNamedRangesObj* mpParent;
ScDocShell* pDocShell;
String aName;
@@ -75,7 +76,7 @@ private:
const formula::FormulaGrammar::Grammar eGrammar );
public:
- ScNamedRangeObj(ScDocShell* pDocSh, const String& rNm);
+ ScNamedRangeObj(ScNamedRangesObj* pParent, ScDocShell* pDocSh, const String& rNm);
virtual ~ScNamedRangeObj();
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
@@ -173,10 +174,11 @@ public:
};
-class ScNamedRangesObj : public ::cppu::WeakImplHelper5<
+class ScNamedRangesObj : public ::cppu::WeakImplHelper6<
::com::sun::star::sheet::XNamedRanges,
::com::sun::star::container::XEnumerationAccess,
::com::sun::star::container::XIndexAccess,
+ ::com::sun::star::beans::XPropertySet,
::com::sun::star::document::XActionLockable,
::com::sun::star::lang::XServiceInfo >,
public SfxListener
@@ -184,6 +186,11 @@ class ScNamedRangesObj : public ::cppu::WeakImplHelper5<
private:
ScDocShell* pDocShell;
+ // if true, adding new name or modifying existing one will set the
+ // document 'modified' and broadcast the change. We turn this off during
+ // import.
+ sal_Bool mbModifyAndBroadcast;
+
ScNamedRangeObj* GetObjectByIndex_Impl(sal_uInt16 nIndex);
ScNamedRangeObj* GetObjectByName_Impl(const ::rtl::OUString& aName);
@@ -200,6 +207,8 @@ public:
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+ bool IsModifyAndBroadcast() const;
+
// XNamedRanges
virtual void SAL_CALL addNewByName( const ::rtl::OUString& aName, const ::rtl::OUString& aContent,
const ::com::sun::star::table::CellAddress& aPosition, sal_Int32 nType )
@@ -238,6 +247,47 @@ public:
throw(::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
+ // XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
+ SAL_CALL getPropertySetInfo()
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName,
+ const ::com::sun::star::uno::Any& aValue )
+ throw(::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::beans::PropertyVetoException,
+ ::com::sun::star::lang::IllegalArgumentException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
+ const ::rtl::OUString& PropertyName )
+ throw(::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertyChangeListener >& xListener )
+ throw(::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertyChangeListener >& aListener )
+ throw(::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XVetoableChangeListener >& aListener )
+ throw(::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XVetoableChangeListener >& aListener )
+ throw(::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+
// XActionLockable
virtual sal_Bool SAL_CALL isActionLocked() throw(::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL addActionLock() throw(::com::sun::star::uno::RuntimeException);