diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2019-05-15 13:13:31 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2019-05-16 12:34:51 +0200 |
commit | 6f810e3d7dafcd7d0101173a501786226f4d8886 (patch) | |
tree | 17b048023c746f719b754505b4cd0ff8bcccea10 /sc/inc/document.hxx | |
parent | ace16e500c92797bb47ad580cf535de0702137bd (diff) |
optimize ScHTMLExport::WriteTables() with large columns
Again, unless given a hint, mdds always starts a search from the beginning
of the container, so iterating over a column becomes quadratic.
Shows when selecting (the title of) a large column with different value types,
e.g. in tdf#120558, which triggers setting the selection from
VclQt5Clipboard::setContents(), which calls this.
Change-Id: Ida009c5ddf18ccdc8dff88c15530cc7e33ce80e7
Reviewed-on: https://gerrit.libreoffice.org/72366
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sc/inc/document.hxx')
-rw-r--r-- | sc/inc/document.hxx | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index dd59a74c44e4..af372c270675 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -1550,7 +1550,7 @@ public: void CopyTabToClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCTAB nTab, ScDocument* pClipDoc); - bool InitColumnBlockPosition( sc::ColumnBlockPosition& rBlockPos, SCTAB nTab, SCCOL nCol ); + SC_DLLPUBLIC bool InitColumnBlockPosition( sc::ColumnBlockPosition& rBlockPos, SCTAB nTab, SCCOL nCol ); void DeleteBeforeCopyFromClip( sc::CopyFromClipContext& rCxt, const ScMarkData& rMark, sc::ColumnSpanSet& rBroadcastSpans ); @@ -1692,7 +1692,9 @@ public: void RemoveCondFormatData( const ScRangeList& rRange, SCTAB nTab, sal_uInt32 nIndex ); SC_DLLPUBLIC ScConditionalFormat* GetCondFormat( SCCOL nCol, SCROW nRow, SCTAB nTab ) const; - SC_DLLPUBLIC const SfxItemSet* GetCondResult( SCCOL nCol, SCROW nRow, SCTAB nTab ) const; + // pCell is an optimization, must point to rPos + SC_DLLPUBLIC const SfxItemSet* GetCondResult( SCCOL nCol, SCROW nRow, SCTAB nTab, + ScRefCellValue* pCell = nullptr ) const; const SfxItemSet* GetCondResult( ScRefCellValue& rCell, const ScAddress& rPos, const ScConditionalFormatList& rList, const ScCondFormatIndexes& rIndex ) const; @@ -1705,8 +1707,12 @@ public: SC_DLLPUBLIC const css::uno::Reference< css::i18n::XBreakIterator >& GetBreakIterator(); bool HasStringWeakCharacters( const OUString& rString ); SC_DLLPUBLIC SvtScriptType GetStringScriptType( const OUString& rString ); - SC_DLLPUBLIC SvtScriptType GetCellScriptType( const ScAddress& rPos, sal_uInt32 nNumberFormat ); - SC_DLLPUBLIC SvtScriptType GetScriptType( SCCOL nCol, SCROW nRow, SCTAB nTab ); + // pCell is an optimization, must point to rPos + SC_DLLPUBLIC SvtScriptType GetCellScriptType( const ScAddress& rPos, sal_uInt32 nNumberFormat, + ScRefCellValue* pCell = nullptr ); + // pCell is an optimization, must point to nCol,nRow,nTab + SC_DLLPUBLIC SvtScriptType GetScriptType( SCCOL nCol, SCROW nRow, SCTAB nTab, + ScRefCellValue* pCell = nullptr ); SvtScriptType GetRangeScriptType( sc::ColumnBlockPosition& rBlockPos, const ScAddress& rPos, SCROW nLength ); SvtScriptType GetRangeScriptType( const ScRangeList& rRanges ); @@ -2527,6 +2533,7 @@ private: bool HasPartOfMerged( const ScRange& rRange ); ScRefCellValue GetRefCellValue( const ScAddress& rPos ); + ScRefCellValue GetRefCellValue( const ScAddress& rPos, sc::ColumnBlockPosition& rBlockPos ); std::map< SCTAB, ScSortParam > mSheetSortParams; |