summaryrefslogtreecommitdiff
path: root/editeng/inc/editeng
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-07-25 12:07:33 +0200
committerMichael Stahl <mstahl@redhat.com>2012-07-25 14:13:46 +0200
commit0031210b26bfae38be4243f9c92d90fa213b9eb0 (patch)
tree13fd775310b614741146d0ad9673044ac947f8d1 /editeng/inc/editeng
parent70d9e9bfcdad5f3b18487a87d0bfe2a2a6213b19 (diff)
autocomplete: replace horrible use of SvStringsISortDtor...
... to store not Strings but derived SwAutoCompleteStrings with something far saner: an abstract base class with virtual dtor. Change-Id: I7d966f385dd41154ee1c4cdb43b56ff1aace9b5e
Diffstat (limited to 'editeng/inc/editeng')
-rw-r--r--editeng/inc/editeng/swafopt.hxx44
1 files changed, 40 insertions, 4 deletions
diff --git a/editeng/inc/editeng/swafopt.hxx b/editeng/inc/editeng/swafopt.hxx
index 38072e699d9e..684a1838c731 100644
--- a/editeng/inc/editeng/swafopt.hxx
+++ b/editeng/inc/editeng/swafopt.hxx
@@ -16,21 +16,57 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef _SVXSWAFOPT_HXX
-#define _SVXSWAFOPT_HXX
+
+#ifndef EE_SVXSWAFOPT_HXX
+#define EE_SVXSWAFOPT_HXX
+
+#include <o3tl/sorted_vector.hxx>
+
+#include <tools/string.hxx>
#include <vcl/font.hxx>
#include "editeng/editengdllapi.h"
-class SvStringsISortDtor;
class SmartTagMgr;
+namespace editeng {
+
+class EDITENG_DLLPUBLIC IAutoCompleteString
+{
+private:
+ String m_String;
+public:
+ explicit IAutoCompleteString(String const& rString) : m_String(rString) {}
+ virtual ~IAutoCompleteString() {}
+ String const& GetAutoCompleteString() const { return m_String; }
+};
+
+struct CompareAutoCompleteString
+{
+ bool operator()(IAutoCompleteString *const& lhs,
+ IAutoCompleteString *const& rhs) const
+ {
+ return lhs->GetAutoCompleteString().CompareIgnoreCaseToAscii(
+ rhs->GetAutoCompleteString()) == COMPARE_LESS;
+ }
+};
+
+class SortedAutoCompleteStrings
+ : public o3tl::sorted_vector<IAutoCompleteString*, CompareAutoCompleteString>
+{
+public:
+ ~SortedAutoCompleteStrings() { DeleteAndDestroyAll(); }
+};
+
+} // namespace editeng
+
// Class of options for AutoFormat
struct EDITENG_DLLPUBLIC SvxSwAutoFmtFlags
{
Font aBulletFont;
Font aByInputBulletFont;
- const SvStringsISortDtor* pAutoCmpltList; // only valid inside the Dialog!!!
+ /// only valid inside the Dialog!!!
+ const editeng::SortedAutoCompleteStrings * m_pAutoCompleteList;
SmartTagMgr* pSmartTagMgr;
sal_Unicode cBullet;