summaryrefslogtreecommitdiff
path: root/sw/source/core/inc/wrong.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/inc/wrong.hxx')
-rw-r--r--sw/source/core/inc/wrong.hxx27
1 files changed, 12 insertions, 15 deletions
diff --git a/sw/source/core/inc/wrong.hxx b/sw/source/core/inc/wrong.hxx
index dcd8503ef6aa..993677270ea8 100644
--- a/sw/source/core/inc/wrong.hxx
+++ b/sw/source/core/inc/wrong.hxx
@@ -17,18 +17,16 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_SW_SOURCE_CORE_INC_WRONG_HXX
-#define INCLUDED_SW_SOURCE_CORE_INC_WRONG_HXX
+#pragma once
#include <com/sun/star/container/NoSuchElementException.hpp>
#include <com/sun/star/container/XStringKeyMap.hpp>
-#include <com/sun/star/util/Color.hpp>
#include <com/sun/star/awt/FontUnderline.hpp>
#include <com/sun/star/uno/Any.hxx>
#include <vector>
-
+#include <memory>
#include <optional>
#include <tools/color.hxx>
@@ -67,6 +65,7 @@ class SwWrongArea
{
public:
OUString maType;
+ css::uno::Reference< css::container::XStringKeyMap > mxPropertyBag;
sal_Int32 mnPos;
sal_Int32 mnLen;
SwWrongList* mpSubList;
@@ -74,13 +73,13 @@ public:
Color mColor;
WrongAreaLineType mLineType;
- SwWrongArea( const OUString& rType,
+ SwWrongArea( OUString aType,
WrongListType listType,
css::uno::Reference< css::container::XStringKeyMap > const & xPropertyBag,
sal_Int32 nPos,
sal_Int32 nLen);
- SwWrongArea( const OUString& rType,
+ SwWrongArea( OUString aType,
css::uno::Reference< css::container::XStringKeyMap > const & xPropertyBag,
sal_Int32 nPos,
sal_Int32 nLen,
@@ -109,7 +108,7 @@ private:
{
}
- return COL_LIGHTBLUE;
+ return SwViewOption::GetCurrentViewOptions().GetGrammarColor();
}
static WrongAreaLineType getGrammarLineType( css::uno::Reference< css::container::XStringKeyMap > const & xPropertyBag )
@@ -175,7 +174,7 @@ private:
{
}
- return SwViewOption::GetSmarttagColor( );
+ return SwViewOption::GetCurrentViewOptions().GetSmarttagColor();
}
static WrongAreaLineType getSmartLineType( css::uno::Reference< css::container::XStringKeyMap > const & xPropertyBag )
@@ -224,7 +223,7 @@ private:
{
if (WRONGLIST_SPELL == listType)
{
- return SwViewOption::GetSpellColor();
+ return SwViewOption::GetCurrentViewOptions().GetSpellColor();
}
else if (WRONGLIST_GRAMMAR == listType)
{
@@ -235,7 +234,7 @@ private:
return getSmartColor(xPropertyBag);
}
- return SwViewOption::GetSpellColor();
+ return SwViewOption::GetCurrentViewOptions().GetSpellColor();
}
static WrongAreaLineType getWrongAreaLineType(WrongListType listType,
@@ -259,7 +258,7 @@ private:
};
-class SwWrongList
+class SAL_DLLPUBLIC_RTTI SwWrongList
{
std::vector<SwWrongArea> maList;
WrongListType meType;
@@ -305,7 +304,7 @@ public:
// Divide the list into two part, the wrong words until nSplitPos will be
// removed and transferred to a new SwWrongList.
- SwWrongList* SplitList( sal_Int32 nSplitPos );
+ std::unique_ptr<SwWrongList> SplitList( sal_Int32 nSplitPos );
// Join the next SwWrongList, nInsertPos is my own text length, where
// the other wrong list has to be inserted.
void JoinList( SwWrongList* pNext, sal_Int32 nInsertPos );
@@ -320,7 +319,7 @@ public:
return nIdx < maList.size() ? maList[nIdx].mnPos : 0;
}
- sal_uInt16 Count() const { return static_cast<sal_uInt16>(maList.size()); }
+ sal_uInt16 Count() const { return o3tl::narrowing<sal_uInt16>(maList.size()); }
void Insert( const OUString& rType,
css::uno::Reference< css::container::XStringKeyMap > const & xPropertyBag,
@@ -408,6 +407,4 @@ public:
} // namespace sw
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */