diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2024-06-21 19:42:48 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-06-22 14:00:49 +0200 |
commit | 40e08851304e5c179842dcf2e1e3b352f1baee21 (patch) | |
tree | b2e456bc398b8d45c507fcdca83f654f36908fe4 /include | |
parent | 858bc4d76bb49ff1766e5d4bd404b04d61201c37 (diff) |
fix O(n^2) behaviour when fetching field info from EditEngine
Change-Id: I324a1814fc1b3321eed5b29922790600e7092c17
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169344
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Diffstat (limited to 'include')
-rw-r--r-- | include/editeng/editeng.hxx | 3 | ||||
-rw-r--r-- | include/editeng/unoedprx.hxx | 3 | ||||
-rw-r--r-- | include/editeng/unoedsrc.hxx | 14 | ||||
-rw-r--r-- | include/editeng/unofored.hxx | 3 | ||||
-rw-r--r-- | include/editeng/unoforou.hxx | 3 | ||||
-rw-r--r-- | include/editeng/unotext.hxx | 3 |
6 files changed, 7 insertions, 22 deletions
diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx index e2b40613b0f2..af62e525e98a 100644 --- a/include/editeng/editeng.hxx +++ b/include/editeng/editeng.hxx @@ -476,8 +476,7 @@ public: SAL_DLLPRIVATE bool UpdateFieldsOnly(); void RemoveFields( const std::function<bool ( const SvxFieldData* )>& isFieldData = [] (const SvxFieldData* ){return true;} ); - sal_uInt16 GetFieldCount( sal_Int32 nPara ) const; - EFieldInfo GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const; + std::vector<EFieldInfo> GetFieldInfo( sal_Int32 nPara ) const; bool IsRightToLeft( sal_Int32 nPara ) const; diff --git a/include/editeng/unoedprx.hxx b/include/editeng/unoedprx.hxx index 22b6be0c91e3..b3cf3f89309c 100644 --- a/include/editeng/unoedprx.hxx +++ b/include/editeng/unoedprx.hxx @@ -65,8 +65,7 @@ public: virtual bool IsValid() const override; virtual LanguageType GetLanguage( sal_Int32, sal_Int32 ) const override; - virtual sal_Int32 GetFieldCount( sal_Int32 nPara ) const override; - virtual EFieldInfo GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const override; + virtual std::vector<EFieldInfo> GetFieldInfo( sal_Int32 nPara ) const override; virtual EBulletInfo GetBulletInfo( sal_Int32 nPara ) const override; virtual tools::Rectangle GetCharBounds( sal_Int32 nPara, sal_Int32 nIndex ) const override; virtual tools::Rectangle GetParaBounds( sal_Int32 nPara ) const override; diff --git a/include/editeng/unoedsrc.hxx b/include/editeng/unoedsrc.hxx index 1537f00a743c..45824a4e390e 100644 --- a/include/editeng/unoedsrc.hxx +++ b/include/editeng/unoedsrc.hxx @@ -193,22 +193,12 @@ public: */ virtual LanguageType GetLanguage( sal_Int32 nPara, sal_Int32 nIndex ) const = 0; - /** Query number of fields in the underlying edit engine - - @param nPara[0 .. n-1] - Index of paragraph to query field number in - */ - virtual sal_Int32 GetFieldCount( sal_Int32 nPara ) const = 0; - - /** Query information for given field number in the underlying edit engine + /** Query information for fields in the underlying edit engine @param nPara[0 .. n-1] Index of paragraph to query field info in - - @param nField[0 .. m-1] - Index of field to query information of */ - virtual EFieldInfo GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const = 0; + virtual std::vector<EFieldInfo> GetFieldInfo( sal_Int32 nPara ) const = 0; /** Query information regarding bullets for given paragraph on the underlying edit engine diff --git a/include/editeng/unofored.hxx b/include/editeng/unofored.hxx index 323095f85f0b..ca64ca8c891a 100644 --- a/include/editeng/unofored.hxx +++ b/include/editeng/unofored.hxx @@ -62,8 +62,7 @@ public: virtual bool IsValid() const override; virtual LanguageType GetLanguage( sal_Int32, sal_Int32 ) const override; - virtual sal_Int32 GetFieldCount( sal_Int32 nPara ) const override; - virtual EFieldInfo GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const override; + virtual std::vector<EFieldInfo> GetFieldInfo( sal_Int32 nPara ) const override; virtual EBulletInfo GetBulletInfo( sal_Int32 nPara ) const override; virtual tools::Rectangle GetCharBounds( sal_Int32 nPara, sal_Int32 nIndex ) const override; virtual tools::Rectangle GetParaBounds( sal_Int32 nPara ) const override; diff --git a/include/editeng/unoforou.hxx b/include/editeng/unoforou.hxx index 0abb982cf62d..1909eb3f2f85 100644 --- a/include/editeng/unoforou.hxx +++ b/include/editeng/unoforou.hxx @@ -82,8 +82,7 @@ public: virtual bool IsValid() const override final; virtual LanguageType GetLanguage( sal_Int32, sal_Int32 ) const override final; - virtual sal_Int32 GetFieldCount( sal_Int32 nPara ) const override final; - virtual EFieldInfo GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const override final; + virtual std::vector<EFieldInfo> GetFieldInfo( sal_Int32 nPara ) const override final; virtual EBulletInfo GetBulletInfo( sal_Int32 nPara ) const override final; virtual tools::Rectangle GetCharBounds( sal_Int32 nPara, sal_Int32 nIndex ) const override final; virtual tools::Rectangle GetParaBounds( sal_Int32 nPara ) const override final; diff --git a/include/editeng/unotext.hxx b/include/editeng/unotext.hxx index bb3d8c708606..38efd32e0aaf 100644 --- a/include/editeng/unotext.hxx +++ b/include/editeng/unotext.hxx @@ -208,8 +208,7 @@ public: virtual bool IsValid() const override; virtual LanguageType GetLanguage( sal_Int32, sal_Int32 ) const override; - virtual sal_Int32 GetFieldCount( sal_Int32 nPara ) const override; - virtual EFieldInfo GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const override; + virtual std::vector<EFieldInfo> GetFieldInfo( sal_Int32 nPara ) const override; virtual EBulletInfo GetBulletInfo( sal_Int32 nPara ) const override; virtual tools::Rectangle GetCharBounds( sal_Int32 nPara, sal_Int32 nIndex ) const override; virtual tools::Rectangle GetParaBounds( sal_Int32 nPara ) const override; |