diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-05-16 18:37:12 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-05-20 20:13:08 -0400 |
commit | 8eed8f8c3d6a58d28f8af5e5688d8fe8756d7dc8 (patch) | |
tree | c48bde79961d86efab1e97355e2d000225342b96 /sc/inc | |
parent | 4da9bf8086c90f0b0b4394cd6578da1405ca3e8d (diff) |
Optimize ScViewFunc::GetSelectionScriptType().
This change reduces the duration of this method from somewhere in the
ballpark of 10 seconds down to a tiny fraction of a second.
Change-Id: I0278dc06a4f134b43cd08bd94693b6dec4893f1f
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/column.hxx | 4 | ||||
-rw-r--r-- | sc/inc/columnspanset.hxx | 6 | ||||
-rw-r--r-- | sc/inc/document.hxx | 3 | ||||
-rw-r--r-- | sc/inc/listenercontext.hxx | 2 | ||||
-rw-r--r-- | sc/inc/table.hxx | 2 |
5 files changed, 15 insertions, 2 deletions
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index a697bede5b00..f1584b11f837 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -446,6 +446,8 @@ public: void SetTextWidth(SCROW nRow, sal_uInt16 nWidth); sal_uInt8 GetScriptType( SCROW nRow ) const; + sal_uInt8 GetRangeScriptType( sc::CellTextAttrStoreType::iterator& itPos, SCROW nRow1, SCROW nRow2 ); + void SetScriptType( SCROW nRow, sal_uInt8 nType ); size_t GetFormulaHash( SCROW nRow ) const; @@ -464,6 +466,8 @@ public: void DeleteBroadcasters( SCROW nRow1, SCROW nRow2 ); private: + void UpdateScriptType( sc::CellTextAttr& rAttr, SCROW nRow ); + void DeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex, sal_uInt16 nDelFlag, std::vector<SCROW>& rDeletedRows ); diff --git a/sc/inc/columnspanset.hxx b/sc/inc/columnspanset.hxx index afd17977add9..35d94bf8e789 100644 --- a/sc/inc/columnspanset.hxx +++ b/sc/inc/columnspanset.hxx @@ -30,17 +30,21 @@ class ColumnSpanSet : boost::noncopyable DocType maDoc; + ColumnSpansType& getColumnSpans(SCTAB nTab, SCCOL nCol); + public: class Action { public: virtual ~Action() = 0; + virtual void startColumn(SCTAB nTab, SCCOL nCol); virtual void execute(const ScAddress& rPos, SCROW nLength, bool bVal) = 0; }; ~ColumnSpanSet(); - void set(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bVal); + void set(SCTAB nTab, SCCOL nCol, SCROW nRow, bool bVal); + void set(SCTAB nTab, SCCOL nCol, SCROW nRow1, SCROW nRow2, bool bVal); void executeFromTop(Action& ac) const; void executeFromBottom(Action& ac) const; diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index e2ea7e3c5cfe..5f63d85a5586 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -1277,6 +1277,9 @@ public: SC_DLLPUBLIC sal_uInt8 GetStringScriptType( const OUString& rString ); SC_DLLPUBLIC sal_uInt8 GetCellScriptType( const ScAddress& rPos, sal_uLong nNumberFormat ); SC_DLLPUBLIC sal_uInt8 GetScriptType( SCCOL nCol, SCROW nRow, SCTAB nTab ); + sal_uInt8 GetRangeScriptType( + sc::ColumnBlockPosition& rBlockPos, const ScAddress& rPos, SCROW nLength ); + sal_uInt8 GetRangeScriptType( const ScRangeList& rRanges ); bool HasDetectiveOperations() const; void AddDetectiveOperation( const ScDetOpData& rData ); diff --git a/sc/inc/listenercontext.hxx b/sc/inc/listenercontext.hxx index 2fc55a769821..36f26d82871e 100644 --- a/sc/inc/listenercontext.hxx +++ b/sc/inc/listenercontext.hxx @@ -27,7 +27,7 @@ public: EndListeningContext(ScDocument& rDoc); ScDocument& getDoc(); - void addEmptyBroadcasterPosition(SCCOL nCol, SCROW nRow, SCTAB nTab); + void addEmptyBroadcasterPosition(SCTAB nTab, SCCOL nCol, SCROW nRow); void purgeEmptyBroadcasters(); }; diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 00255fe2c248..333eb9ae7e87 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -829,6 +829,8 @@ public: sal_uInt8 GetScriptType( SCCOL nCol, SCROW nRow ) const; void SetScriptType( SCCOL nCol, SCROW nRow, sal_uInt8 nType ); + sal_uInt8 GetRangeScriptType( sc::ColumnBlockPosition& rBlockPos, SCCOL nCol, SCROW nRow1, SCROW nRow2 ); + size_t GetFormulaHash( SCCOL nCol, SCROW nRow ) const; ScFormulaVectorState GetFormulaVectorState( SCCOL nCol, SCROW nRow ) const; |