summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-09 17:07:54 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-05-11 07:14:34 +0000
commit63ba54a168dbc777cdcec2393be476bdd5f79bc1 (patch)
tree48de29007d02ba4a982a50a1bd0138460e215c23
parent7b9ea3348ac08d775ae452132239853724c65a41 (diff)
convert EXTTEXTINPUT_ATTR to scoped enum
Change-Id: I94706bdea91d367fc8c2bbd482f6b4d8f55449d7 Reviewed-on: https://gerrit.libreoffice.org/24821 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r--editeng/source/editeng/impedit.hxx8
-rw-r--r--editeng/source/editeng/impedit3.cxx20
-rw-r--r--editeng/source/editeng/impedit5.cxx6
-rw-r--r--include/vcl/commandevent.hxx39
-rw-r--r--include/vcl/textdata.hxx6
-rw-r--r--sw/inc/extinput.hxx4
-rw-r--r--sw/source/core/doc/extinput.cxx2
-rw-r--r--sw/source/core/text/redlnitr.cxx26
-rw-r--r--sw/source/core/text/redlnitr.hxx8
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx6
-rw-r--r--vcl/inc/salwtype.hxx4
-rw-r--r--vcl/inc/unx/gtk/gtkframe.hxx2
-rw-r--r--vcl/inc/unx/i18n_cb.hxx2
-rw-r--r--vcl/inc/window.h2
-rw-r--r--vcl/osx/salframeview.mm10
-rw-r--r--vcl/source/control/edit.cxx30
-rw-r--r--vcl/source/edit/textdata.cxx6
-rw-r--r--vcl/source/edit/texteng.cxx20
-rw-r--r--vcl/source/window/commandevent.cxx10
-rw-r--r--vcl/source/window/winproc.cxx6
-rw-r--r--vcl/unx/generic/app/i18n_cb.cxx34
-rw-r--r--vcl/unx/generic/window/salframe.cxx6
-rw-r--r--vcl/unx/gtk/gtksalframe.cxx14
-rw-r--r--vcl/unx/gtk3/gtk3gtkframe.cxx14
-rw-r--r--vcl/win/window/salframe.cxx16
25 files changed, 156 insertions, 145 deletions
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 5875ad7d1f02..52c4c0ac5ed2 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -137,16 +137,16 @@ struct DragAndDropInfo
struct ImplIMEInfos
{
OUString aOldTextAfterStartPos;
- sal_uInt16* pAttribs;
+ ExtTextInputAttr* pAttribs;
EditPaM aPos;
sal_Int32 nLen;
- bool bCursor;
- bool bWasCursorOverwrite;
+ bool bCursor;
+ bool bWasCursorOverwrite;
ImplIMEInfos( const EditPaM& rPos, const OUString& rOldTextAfterStartPos );
~ImplIMEInfos();
- void CopyAttribs( const sal_uInt16* pA, sal_uInt16 nL );
+ void CopyAttribs( const ExtTextInputAttr* pA, sal_uInt16 nL );
void DestroyAttribs();
};
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index aa131dbc6f16..4d8f67403d95 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -2342,7 +2342,7 @@ void ImpEditEngine::CreateTextPortions( ParaPortion* pParaPortion, sal_Int32& rS
if ( mpIMEInfos && mpIMEInfos->nLen && mpIMEInfos->pAttribs && ( mpIMEInfos->aPos.GetNode() == pNode ) )
{
- sal_uInt16 nLastAttr = 0xFFFF;
+ ExtTextInputAttr nLastAttr = (ExtTextInputAttr)0xFFFF;
for( sal_Int32 n = 0; n < mpIMEInfos->nLen; n++ )
{
if ( mpIMEInfos->pAttribs[n] != nLastAttr )
@@ -2769,27 +2769,27 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_Int32 nPos, SvxFont& rFo
if ( mpIMEInfos && mpIMEInfos->pAttribs && ( mpIMEInfos->aPos.GetNode() == pNode ) &&
( nPos > mpIMEInfos->aPos.GetIndex() ) && ( nPos <= ( mpIMEInfos->aPos.GetIndex() + mpIMEInfos->nLen ) ) )
{
- sal_uInt16 nAttr = mpIMEInfos->pAttribs[ nPos - mpIMEInfos->aPos.GetIndex() - 1 ];
- if ( nAttr & EXTTEXTINPUT_ATTR_UNDERLINE )
+ ExtTextInputAttr nAttr = mpIMEInfos->pAttribs[ nPos - mpIMEInfos->aPos.GetIndex() - 1 ];
+ if ( nAttr & ExtTextInputAttr::Underline )
rFont.SetUnderline( LINESTYLE_SINGLE );
- else if ( nAttr & EXTTEXTINPUT_ATTR_BOLDUNDERLINE )
+ else if ( nAttr & ExtTextInputAttr::BoldUnderline )
rFont.SetUnderline( LINESTYLE_BOLD );
- else if ( nAttr & EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE )
+ else if ( nAttr & ExtTextInputAttr::DottedUnderline )
rFont.SetUnderline( LINESTYLE_DOTTED );
- else if ( nAttr & EXTTEXTINPUT_ATTR_DASHDOTUNDERLINE )
+ else if ( nAttr & ExtTextInputAttr::DashDotUnderline )
rFont.SetUnderline( LINESTYLE_DOTTED );
- else if ( nAttr & EXTTEXTINPUT_ATTR_REDTEXT )
+ else if ( nAttr & ExtTextInputAttr::RedText )
rFont.SetColor( Color( COL_RED ) );
- else if ( nAttr & EXTTEXTINPUT_ATTR_HALFTONETEXT )
+ else if ( nAttr & ExtTextInputAttr::HalfToneText )
rFont.SetColor( Color( COL_LIGHTGRAY ) );
- if ( nAttr & EXTTEXTINPUT_ATTR_HIGHLIGHT )
+ if ( nAttr & ExtTextInputAttr::Highlight )
{
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
rFont.SetColor( rStyleSettings.GetHighlightTextColor() );
rFont.SetFillColor( rStyleSettings.GetHighlightColor() );
rFont.SetTransparent( false );
}
- else if ( nAttr & EXTTEXTINPUT_ATTR_GRAYWAVELINE )
+ else if ( nAttr & ExtTextInputAttr::GrayWaveline )
{
rFont.SetUnderline( LINESTYLE_WAVE );
if( pOut )
diff --git a/editeng/source/editeng/impedit5.cxx b/editeng/source/editeng/impedit5.cxx
index a20d2cb86551..224f5e1b5ba1 100644
--- a/editeng/source/editeng/impedit5.cxx
+++ b/editeng/source/editeng/impedit5.cxx
@@ -817,12 +817,12 @@ ImplIMEInfos::~ImplIMEInfos()
delete[] pAttribs;
}
-void ImplIMEInfos::CopyAttribs( const sal_uInt16* pA, sal_uInt16 nL )
+void ImplIMEInfos::CopyAttribs( const ExtTextInputAttr* pA, sal_uInt16 nL )
{
nLen = nL;
delete[] pAttribs;
- pAttribs = new sal_uInt16[ nL ];
- memcpy( pAttribs, pA, nL*sizeof(sal_uInt16) );
+ pAttribs = new ExtTextInputAttr[ nL ];
+ memcpy( pAttribs, pA, nL*sizeof(ExtTextInputAttr) );
}
void ImplIMEInfos::DestroyAttribs()
diff --git a/include/vcl/commandevent.hxx b/include/vcl/commandevent.hxx
index 9670aeae0ad3..ba0542a48bc4 100644
--- a/include/vcl/commandevent.hxx
+++ b/include/vcl/commandevent.hxx
@@ -25,18 +25,7 @@
#include <vcl/dllapi.h>
#include <vcl/keycod.hxx>
#include <vcl/font.hxx>
-
-#define EXTTEXTINPUT_ATTR_GRAYWAVELINE ((sal_uInt16)0x0100)
-#define EXTTEXTINPUT_ATTR_UNDERLINE ((sal_uInt16)0x0200)
-#define EXTTEXTINPUT_ATTR_BOLDUNDERLINE ((sal_uInt16)0x0400)
-#define EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE ((sal_uInt16)0x0800)
-#define EXTTEXTINPUT_ATTR_DASHDOTUNDERLINE ((sal_uInt16)0x1000)
-#define EXTTEXTINPUT_ATTR_HIGHLIGHT ((sal_uInt16)0x2000)
-#define EXTTEXTINPUT_ATTR_REDTEXT ((sal_uInt16)0x4000)
-#define EXTTEXTINPUT_ATTR_HALFTONETEXT ((sal_uInt16)0x8000)
-
-#define EXTTEXTINPUT_CURSOR_INVISIBLE ((sal_uInt16)0x0001)
-#define EXTTEXTINPUT_CURSOR_OVERWRITE ((sal_uInt16)0x0002)
+#include <o3tl/typed_flags_set.hxx>
class CommandExtTextInputData;
class CommandWheelData;
@@ -49,6 +38,26 @@ class CommandSwipeData;
class CommandLongPressData;
enum class CommandEventId;
+enum class ExtTextInputAttr {
+ NONE = 0x0000,
+ GrayWaveline = 0x0100,
+ Underline = 0x0200,
+ BoldUnderline = 0x0400,
+ DottedUnderline = 0x0800,
+ DashDotUnderline = 0x1000,
+ Highlight = 0x2000,
+ RedText = 0x4000,
+ HalfToneText = 0x8000
+};
+namespace o3tl
+{
+ template<> struct typed_flags<ExtTextInputAttr> : is_typed_flags<ExtTextInputAttr, 0xff00> {};
+}
+
+#define EXTTEXTINPUT_CURSOR_INVISIBLE ((sal_uInt16)0x0001)
+#define EXTTEXTINPUT_CURSOR_OVERWRITE ((sal_uInt16)0x0002)
+
+
class VCL_DLLPUBLIC CommandEvent
{
private:
@@ -82,14 +91,14 @@ class VCL_DLLPUBLIC CommandExtTextInputData
{
private:
OUString maText;
- sal_uInt16* mpTextAttr;
+ ExtTextInputAttr* mpTextAttr;
sal_Int32 mnCursorPos;
sal_uInt16 mnCursorFlags;
bool mbOnlyCursor;
public:
CommandExtTextInputData( const OUString& rText,
- const sal_uInt16* pTextAttr,
+ const ExtTextInputAttr* pTextAttr,
sal_Int32 nCursorPos,
sal_uInt16 nCursorFlags,
bool bOnlyCursor );
@@ -97,7 +106,7 @@ public:
~CommandExtTextInputData();
const OUString& GetText() const { return maText; }
- const sal_uInt16* GetTextAttr() const { return mpTextAttr; }
+ const ExtTextInputAttr* GetTextAttr() const { return mpTextAttr; }
sal_Int32 GetCursorPos() const { return mnCursorPos; }
bool IsCursorVisible() const { return (mnCursorFlags & EXTTEXTINPUT_CURSOR_INVISIBLE) == 0; }
diff --git a/include/vcl/textdata.hxx b/include/vcl/textdata.hxx
index b982b1ecf74e..7339f0f876b4 100644
--- a/include/vcl/textdata.hxx
+++ b/include/vcl/textdata.hxx
@@ -24,6 +24,8 @@
#include <svl/smplhint.hxx>
#include <vcl/dllapi.h>
+enum class ExtTextInputAttr;
+
// for Notify, if all paragraphs were deleted
#define TEXT_PARA_ALL SAL_MAX_UINT32
#define TEXT_INDEX_ALL SAL_MAX_INT32
@@ -138,7 +140,7 @@ public:
struct TEIMEInfos
{
OUString aOldTextAfterStartPos;
- sal_uInt16* pAttribs;
+ ExtTextInputAttr* pAttribs;
TextPaM aPos;
sal_Int32 nLen;
bool bCursor;
@@ -147,7 +149,7 @@ struct TEIMEInfos
TEIMEInfos(const TextPaM& rPos, const OUString& rOldTextAfterStartPos);
~TEIMEInfos();
- void CopyAttribs(const sal_uInt16* pA, sal_Int32 nL);
+ void CopyAttribs(const ExtTextInputAttr* pA, sal_Int32 nL);
void DestroyAttribs();
};
diff --git a/sw/inc/extinput.hxx b/sw/inc/extinput.hxx
index 6e41d9559c38..28c962ef42c1 100644
--- a/sw/inc/extinput.hxx
+++ b/sw/inc/extinput.hxx
@@ -27,7 +27,7 @@ class CommandExtTextInputData;
class SwExtTextInput : public SwPaM
{
- std::vector<sal_uInt16> aAttrs;
+ std::vector<ExtTextInputAttr> aAttrs;
OUString sOverwriteText;
bool bInsText : 1;
bool bIsOverwriteCursor : 1;
@@ -37,7 +37,7 @@ public:
virtual ~SwExtTextInput();
void SetInputData( const CommandExtTextInputData& rData );
- const std::vector<sal_uInt16>& GetAttrs() const { return aAttrs; }
+ const std::vector<ExtTextInputAttr>& GetAttrs() const { return aAttrs; }
void SetInsText( bool bFlag ) { bInsText = bFlag; }
bool IsOverwriteCursor() const { return bIsOverwriteCursor; }
void SetOverwriteCursor( bool bFlag );
diff --git a/sw/source/core/doc/extinput.cxx b/sw/source/core/doc/extinput.cxx
index a681747b11b3..8b9b880e5163 100644
--- a/sw/source/core/doc/extinput.cxx
+++ b/sw/source/core/doc/extinput.cxx
@@ -203,7 +203,7 @@ void SwExtTextInput::SetInputData( const CommandExtTextInputData& rData )
aAttrs.clear();
if( rData.GetTextAttr() )
{
- const sal_uInt16 *pAttrs = rData.GetTextAttr();
+ const ExtTextInputAttr *pAttrs = rData.GetTextAttr();
aAttrs.insert( aAttrs.begin(), pAttrs, pAttrs + rData.GetText().getLength() );
}
}
diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx
index cb4df81ba1b5..761e0d9cebd7 100644
--- a/sw/source/core/text/redlnitr.cxx
+++ b/sw/source/core/text/redlnitr.cxx
@@ -137,7 +137,7 @@ void SwAttrIter::CtorInitAttrIter( SwTextNode& rTextNode, SwScriptInfo& rScrInf,
const sal_uInt16 nRedlPos = rIDRA.GetRedlinePos( rTextNode, USHRT_MAX );
if( pExtInp || USHRT_MAX != nRedlPos )
{
- const std::vector<sal_uInt16> *pArr = nullptr;
+ const std::vector<ExtTextInputAttr> *pArr = nullptr;
sal_Int32 nInputStt = 0;
if( pExtInp )
{
@@ -169,7 +169,7 @@ void SwAttrIter::CtorInitAttrIter( SwTextNode& rTextNode, SwScriptInfo& rScrInf,
// Redline is active, nStart and nEnd are invalid.
SwRedlineItr::SwRedlineItr( const SwTextNode& rTextNd, SwFont& rFnt,
SwAttrHandler& rAH, sal_Int32 nRed, bool bShw,
- const std::vector<sal_uInt16> *pArr,
+ const std::vector<ExtTextInputAttr> *pArr,
sal_Int32 nExtStart )
: rDoc( *rTextNd.GetDoc() ), rAttrHandler( rAH ), pSet( nullptr ),
nNdIdx( rTextNd.GetIndex() ), nFirst( nRed ),
@@ -402,27 +402,27 @@ bool SwRedlineItr::CheckLine( sal_Int32 nChkStart, sal_Int32 nChkEnd )
return bRet;
}
-void SwExtend::ActualizeFont( SwFont &rFnt, sal_uInt16 nAttr )
+void SwExtend::ActualizeFont( SwFont &rFnt, ExtTextInputAttr nAttr )
{
- if ( nAttr & EXTTEXTINPUT_ATTR_UNDERLINE )
+ if ( nAttr & ExtTextInputAttr::Underline )
rFnt.SetUnderline( LINESTYLE_SINGLE );
- else if ( nAttr & EXTTEXTINPUT_ATTR_BOLDUNDERLINE )
+ else if ( nAttr & ExtTextInputAttr::BoldUnderline )
rFnt.SetUnderline( LINESTYLE_BOLD );
- else if ( nAttr & EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE )
+ else if ( nAttr & ExtTextInputAttr::DottedUnderline )
rFnt.SetUnderline( LINESTYLE_DOTTED );
- else if ( nAttr & EXTTEXTINPUT_ATTR_DASHDOTUNDERLINE )
+ else if ( nAttr & ExtTextInputAttr::DashDotUnderline )
rFnt.SetUnderline( LINESTYLE_DOTTED );
- if ( nAttr & EXTTEXTINPUT_ATTR_REDTEXT )
+ if ( nAttr & ExtTextInputAttr::RedText )
rFnt.SetColor( Color( COL_RED ) );
- if ( nAttr & EXTTEXTINPUT_ATTR_HIGHLIGHT )
+ if ( nAttr & ExtTextInputAttr::Highlight )
{
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
rFnt.SetColor( rStyleSettings.GetHighlightTextColor() );
rFnt.SetBackColor( new Color( rStyleSettings.GetHighlightColor() ) );
}
- if ( nAttr & EXTTEXTINPUT_ATTR_GRAYWAVELINE )
+ if ( nAttr & ExtTextInputAttr::GrayWaveline )
rFnt.SetGreyWave( true );
}
@@ -443,11 +443,11 @@ short SwExtend::Enter(SwFont& rFnt, sal_Int32 nNew)
bool SwExtend::Leave_(SwFont& rFnt, sal_Int32 nNew)
{
OSL_ENSURE( Inside(), "SwExtend: Leave without Enter" );
- const sal_uInt16 nOldAttr = rArr[ nPos - nStart ];
+ const ExtTextInputAttr nOldAttr = rArr[ nPos - nStart ];
nPos = nNew;
if( Inside() )
{ // We stayed within the ExtendText-section
- const sal_uInt16 nAttr = rArr[ nPos - nStart ];
+ const ExtTextInputAttr nAttr = rArr[ nPos - nStart ];
if( nOldAttr != nAttr ) // Is there an (inner) change of attributes?
{
rFnt = *pFnt;
@@ -474,7 +474,7 @@ sal_Int32 SwExtend::Next( sal_Int32 nNext )
else if( nPos < nEnd )
{
sal_Int32 nIdx = nPos - nStart;
- const sal_uInt16 nAttr = rArr[ nIdx ];
+ const ExtTextInputAttr nAttr = rArr[ nIdx ];
while( static_cast<size_t>(++nIdx) < rArr.size() && nAttr == rArr[ nIdx ] )
; //nothing
nIdx = nIdx + nStart;
diff --git a/sw/source/core/text/redlnitr.hxx b/sw/source/core/text/redlnitr.hxx
index f9eddf10c1c6..31c3cc69c7b3 100644
--- a/sw/source/core/text/redlnitr.hxx
+++ b/sw/source/core/text/redlnitr.hxx
@@ -34,15 +34,15 @@ class SwAttrHandler;
class SwExtend
{
SwFont *pFnt;
- const std::vector<sal_uInt16> &rArr; // XAMA: Array of sal_uInt16
+ const std::vector<ExtTextInputAttr> &rArr;
sal_Int32 nStart;
sal_Int32 nPos;
sal_Int32 nEnd;
bool Leave_( SwFont& rFnt, sal_Int32 nNew );
bool Inside() const { return ( nPos >= nStart && nPos < nEnd ); }
- static void ActualizeFont( SwFont &rFnt, sal_uInt16 nAttr );
+ static void ActualizeFont( SwFont &rFnt, ExtTextInputAttr nAttr );
public:
- SwExtend( const std::vector<sal_uInt16> &rA, sal_Int32 nSt ) : pFnt(nullptr), rArr( rA ),
+ SwExtend( const std::vector<ExtTextInputAttr> &rA, sal_Int32 nSt ) : pFnt(nullptr), rArr( rA ),
nStart( nSt ), nPos( COMPLETE_STRING ), nEnd( nStart + rA.size() ) {}
~SwExtend() { delete pFnt; }
bool IsOn() const { return pFnt != nullptr; }
@@ -85,7 +85,7 @@ class SwRedlineItr
}
public:
SwRedlineItr( const SwTextNode& rTextNd, SwFont& rFnt, SwAttrHandler& rAH,
- sal_Int32 nRedlPos, bool bShw, const std::vector<sal_uInt16> *pArr = nullptr,
+ sal_Int32 nRedlPos, bool bShw, const std::vector<ExtTextInputAttr> *pArr = nullptr,
sal_Int32 nExtStart = COMPLETE_STRING );
~SwRedlineItr();
inline bool IsOn() const { return bOn || ( pExt && pExt->IsOn() ); }
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 80571d231b28..762f4abd2baa 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -6006,9 +6006,9 @@ void QuickHelpData::Start( SwWrtShell& rSh, sal_uInt16 nWrdLen )
OUString sStr( m_aHelpStrings[ nCurArrPos ] );
sStr = sStr.copy( nLen );
sal_uInt16 nL = sStr.getLength();
- const sal_uInt16 nVal = EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE |
- EXTTEXTINPUT_ATTR_HIGHLIGHT;
- const std::vector<sal_uInt16> aAttrs( nL, nVal );
+ const ExtTextInputAttr nVal = ExtTextInputAttr::DottedUnderline |
+ ExtTextInputAttr::Highlight;
+ const std::vector<ExtTextInputAttr> aAttrs( nL, nVal );
CommandExtTextInputData aCETID( sStr, &aAttrs[0], nL,
0, false );
diff --git a/vcl/inc/salwtype.hxx b/vcl/inc/salwtype.hxx
index 4e5b6896d4ba..0403589320c5 100644
--- a/vcl/inc/salwtype.hxx
+++ b/vcl/inc/salwtype.hxx
@@ -28,11 +28,11 @@ class SalGraphics;
class SalFrame;
class SalObject;
namespace vcl { class Window; }
-
class FontSelectPattern;
enum class InputContextFlags;
enum class WindowStateMask;
enum class WindowStateState;
+enum class ExtTextInputAttr;
enum class SalEvent {
NONE,
@@ -163,7 +163,7 @@ struct SalExtTextInputEvent
{
sal_uInt64 mnTime; // Time in ms, when event is created
OUString maText; // Text
- const sal_uInt16* mpTextAttr; // Text-Attribute
+ const ExtTextInputAttr* mpTextAttr; // Text-Attribute
sal_Int32 mnCursorPos; // Cursor-Position
sal_uInt8 mnCursorFlags; // EXTTEXTINPUT_CURSOR_xxx
bool mbOnlyCursor; // true: Only Cursor-Position has been changed
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index 6cc42a49310c..6e08818d25fa 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -145,7 +145,7 @@ class GtkSalFrame : public SalFrame
bool m_bFocused;
bool m_bPreeditJustChanged;
SalExtTextInputEvent m_aInputEvent;
- std::vector< sal_uInt16 > m_aInputFlags;
+ std::vector< ExtTextInputAttr > m_aInputFlags;
IMHandler( GtkSalFrame* );
~IMHandler();
diff --git a/vcl/inc/unx/i18n_cb.hxx b/vcl/inc/unx/i18n_cb.hxx
index b81e91d91f4f..b9902624b8c8 100644
--- a/vcl/inc/unx/i18n_cb.hxx
+++ b/vcl/inc/unx/i18n_cb.hxx
@@ -72,7 +72,7 @@ typedef struct {
preedit_status_t eState;
preedit_text_t aText;
SalExtTextInputEvent aInputEv;
- std::vector< sal_uInt16 > aInputFlags;
+ std::vector< ExtTextInputAttr > aInputFlags;
} preedit_data_t;
#endif // INCLUDED_VCL_INC_UNX_I18N_CB_HXX
diff --git a/vcl/inc/window.h b/vcl/inc/window.h
index 3adb6fd3048b..a883f7cdf217 100644
--- a/vcl/inc/window.h
+++ b/vcl/inc/window.h
@@ -86,7 +86,7 @@ bool ImplWindowFrameProc( vcl::Window* pInst, SalEvent nEvent, const void* pEven
struct ImplWinData
{
OUString* mpExtOldText;
- sal_uInt16* mpExtOldAttrAry;
+ ExtTextInputAttr* mpExtOldAttrAry;
Rectangle* mpCursorRect;
long mnCursorExtWidth;
bool mbVertical;
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 6906f9be3eee..0da1737e7629 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -1610,7 +1610,7 @@ private:
if( len > 0 ) {
NSString *pString = [aString string];
OUString aInsertString( GetOUString( pString ) );
- std::vector<sal_uInt16> aInputFlags = std::vector<sal_uInt16>( std::max( 1, len ), 0 );
+ std::vector<ExtTextInputAttr> aInputFlags = std::vector<ExtTextInputAttr>( std::max( 1, len ), ExtTextInputAttr::NONE );
for ( int i = 0; i < len; i++ )
{
unsigned int nUnderlineValue;
@@ -1621,16 +1621,16 @@ private:
switch (nUnderlineValue & 0xff) {
case NSUnderlineStyleSingle:
- aInputFlags[i] = EXTTEXTINPUT_ATTR_UNDERLINE;
+ aInputFlags[i] = ExtTextInputAttr::Underline;
break;
case NSUnderlineStyleThick:
- aInputFlags[i] = EXTTEXTINPUT_ATTR_UNDERLINE | EXTTEXTINPUT_ATTR_HIGHLIGHT;
+ aInputFlags[i] = ExtTextInputAttr::Underline | ExtTextInputAttr::Highlight;
break;
case NSUnderlineStyleDouble:
- aInputFlags[i] = EXTTEXTINPUT_ATTR_BOLDUNDERLINE;
+ aInputFlags[i] = ExtTextInputAttr::BoldUnderline;
break;
default:
- aInputFlags[i] = EXTTEXTINPUT_ATTR_HIGHLIGHT;
+ aInputFlags[i] = ExtTextInputAttr::Highlight;
break;
}
}
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index f5724017048e..733193825573 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -112,7 +112,7 @@ struct DDInfo
struct Impl_IMEInfos
{
OUString aOldTextAfterStartPos;
- sal_uInt16* pAttribs;
+ ExtTextInputAttr* pAttribs;
sal_Int32 nPos;
sal_Int32 nLen;
bool bCursor;
@@ -121,7 +121,7 @@ struct Impl_IMEInfos
Impl_IMEInfos(sal_Int32 nPos, const OUString& rOldTextAfterStartPos);
~Impl_IMEInfos();
- void CopyAttribs(const sal_uInt16* pA, sal_Int32 nL);
+ void CopyAttribs(const ExtTextInputAttr* pA, sal_Int32 nL);
void DestroyAttribs();
};
@@ -140,12 +140,12 @@ Impl_IMEInfos::~Impl_IMEInfos()
delete[] pAttribs;
}
-void Impl_IMEInfos::CopyAttribs(const sal_uInt16* pA, sal_Int32 nL)
+void Impl_IMEInfos::CopyAttribs(const ExtTextInputAttr* pA, sal_Int32 nL)
{
nLen = nL;
delete[] pAttribs;
- pAttribs = new sal_uInt16[ nL ];
- memcpy( pAttribs, pA, nL*sizeof(sal_uInt16) );
+ pAttribs = new ExtTextInputAttr[ nL ];
+ memcpy( pAttribs, pA, nL*sizeof(ExtTextInputAttr) );
}
void Impl_IMEInfos::DestroyAttribs()
@@ -585,7 +585,7 @@ void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, const Rectangle& rRec
if (mpIMEInfos && mpIMEInfos->pAttribs &&
i >= mpIMEInfos->nPos && i < (mpIMEInfos->nPos+mpIMEInfos->nLen) &&
- (mpIMEInfos->pAttribs[i - mpIMEInfos->nPos] & EXTTEXTINPUT_ATTR_HIGHLIGHT))
+ (mpIMEInfos->pAttribs[i - mpIMEInfos->nPos] & ExtTextInputAttr::Highlight))
{
bHighlight = true;
}
@@ -648,7 +648,7 @@ void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, const Rectangle& rRec
for(int i = 0; i < mpIMEInfos->nLen; )
{
- sal_uInt16 nAttr = mpIMEInfos->pAttribs[i];
+ ExtTextInputAttr nAttr = mpIMEInfos->pAttribs[i];
vcl::Region aClip;
int nIndex = i;
while (nIndex < mpIMEInfos->nLen && mpIMEInfos->pAttribs[nIndex] == nAttr) // #112631# check nIndex before using it
@@ -662,27 +662,27 @@ void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, const Rectangle& rRec
}
i = nIndex;
aClip.Intersect(aRegion);
- if (!aClip.IsEmpty() && nAttr)
+ if (!aClip.IsEmpty() && nAttr != ExtTextInputAttr::NONE)
{
vcl::Font aFont = rRenderContext.GetFont();
- if (nAttr & EXTTEXTINPUT_ATTR_UNDERLINE)
+ if (nAttr & ExtTextInputAttr::Underline)
aFont.SetUnderline(LINESTYLE_SINGLE);
- else if (nAttr & EXTTEXTINPUT_ATTR_BOLDUNDERLINE)
+ else if (nAttr & ExtTextInputAttr::BoldUnderline)
aFont.SetUnderline( LINESTYLE_BOLD);
- else if (nAttr & EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE)
+ else if (nAttr & ExtTextInputAttr::DottedUnderline)
aFont.SetUnderline( LINESTYLE_DOTTED);
- else if (nAttr & EXTTEXTINPUT_ATTR_DASHDOTUNDERLINE)
+ else if (nAttr & ExtTextInputAttr::DashDotUnderline)
aFont.SetUnderline( LINESTYLE_DASHDOT);
- else if (nAttr & EXTTEXTINPUT_ATTR_GRAYWAVELINE)
+ else if (nAttr & ExtTextInputAttr::GrayWaveline)
{
aFont.SetUnderline(LINESTYLE_WAVE);
rRenderContext.SetTextLineColor(Color(COL_LIGHTGRAY));
}
rRenderContext.SetFont(aFont);
- if (nAttr & EXTTEXTINPUT_ATTR_REDTEXT)
+ if (nAttr & ExtTextInputAttr::RedText)
rRenderContext.SetTextColor(Color(COL_RED));
- else if (nAttr & EXTTEXTINPUT_ATTR_HALFTONETEXT)
+ else if (nAttr & ExtTextInputAttr::HalfToneText)
rRenderContext.SetTextColor(Color(COL_LIGHTGRAY));
rRenderContext.SetClipRegion(aClip);
diff --git a/vcl/source/edit/textdata.cxx b/vcl/source/edit/textdata.cxx
index 841e5cc78433..570d517b12d7 100644
--- a/vcl/source/edit/textdata.cxx
+++ b/vcl/source/edit/textdata.cxx
@@ -283,12 +283,12 @@ TEIMEInfos::~TEIMEInfos()
delete[] pAttribs;
}
-void TEIMEInfos::CopyAttribs(const sal_uInt16* pA, sal_Int32 nL)
+void TEIMEInfos::CopyAttribs(const ExtTextInputAttr* pA, sal_Int32 nL)
{
nLen = nL;
delete[] pAttribs;
- pAttribs = new sal_uInt16[ nL ];
- memcpy( pAttribs, pA, nL*sizeof(sal_uInt16) );
+ pAttribs = new ExtTextInputAttr[ nL ];
+ memcpy( pAttribs, pA, nL*sizeof(ExtTextInputAttr) );
}
void TEIMEInfos::DestroyAttribs()
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index 5455cc45483a..7ddea01bd00b 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -1403,27 +1403,27 @@ void TextEngine::SeekCursor( sal_uInt32 nPara, sal_Int32 nPos, vcl::Font& rFont,
if ( mpIMEInfos && mpIMEInfos->pAttribs && ( mpIMEInfos->aPos.GetPara() == nPara ) &&
( nPos > mpIMEInfos->aPos.GetIndex() ) && ( nPos <= ( mpIMEInfos->aPos.GetIndex() + mpIMEInfos->nLen ) ) )
{
- sal_uInt16 nAttr = mpIMEInfos->pAttribs[ nPos - mpIMEInfos->aPos.GetIndex() - 1 ];
- if ( nAttr & EXTTEXTINPUT_ATTR_UNDERLINE )
+ ExtTextInputAttr nAttr = mpIMEInfos->pAttribs[ nPos - mpIMEInfos->aPos.GetIndex() - 1 ];
+ if ( nAttr & ExtTextInputAttr::Underline )
rFont.SetUnderline( LINESTYLE_SINGLE );
- else if ( nAttr & EXTTEXTINPUT_ATTR_BOLDUNDERLINE )
+ else if ( nAttr & ExtTextInputAttr::BoldUnderline )
rFont.SetUnderline( LINESTYLE_BOLD );
- else if ( nAttr & EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE )
+ else if ( nAttr & ExtTextInputAttr::DottedUnderline )
rFont.SetUnderline( LINESTYLE_DOTTED );
- else if ( nAttr & EXTTEXTINPUT_ATTR_DASHDOTUNDERLINE )
+ else if ( nAttr & ExtTextInputAttr::DashDotUnderline )
rFont.SetUnderline( LINESTYLE_DOTTED );
- if ( nAttr & EXTTEXTINPUT_ATTR_REDTEXT )
+ if ( nAttr & ExtTextInputAttr::RedText )
rFont.SetColor( Color( COL_RED ) );
- else if ( nAttr & EXTTEXTINPUT_ATTR_HALFTONETEXT )
+ else if ( nAttr & ExtTextInputAttr::HalfToneText )
rFont.SetColor( Color( COL_LIGHTGRAY ) );
- if ( nAttr & EXTTEXTINPUT_ATTR_HIGHLIGHT )
+ if ( nAttr & ExtTextInputAttr::Highlight )
{
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
rFont.SetColor( rStyleSettings.GetHighlightTextColor() );
rFont.SetFillColor( rStyleSettings.GetHighlightColor() );
rFont.SetTransparent( false );
}
- else if ( nAttr & EXTTEXTINPUT_ATTR_GRAYWAVELINE )
+ else if ( nAttr & ExtTextInputAttr::GrayWaveline )
{
rFont.SetUnderline( LINESTYLE_WAVE );
// if( pOut )
@@ -1746,7 +1746,7 @@ void TextEngine::CreateTextPortions( sal_uInt32 nPara, sal_Int32 nStartPos )
if ( mpIMEInfos && mpIMEInfos->pAttribs && ( mpIMEInfos->aPos.GetPara() == nPara ) )
{
- sal_uInt16 nLastAttr = 0xFFFF;
+ ExtTextInputAttr nLastAttr = (ExtTextInputAttr)0xffff;
for( sal_Int32 n = 0; n < mpIMEInfos->nLen; n++ )
{
if ( mpIMEInfos->pAttribs[n] != nLastAttr )
diff --git a/vcl/source/window/commandevent.cxx b/vcl/source/window/commandevent.cxx
index 5fa8e4c26730..25b3f15873d4 100644
--- a/vcl/source/window/commandevent.cxx
+++ b/vcl/source/window/commandevent.cxx
@@ -22,14 +22,14 @@
#include <vcl/commandevent.hxx>
CommandExtTextInputData::CommandExtTextInputData( const OUString& rText,
- const sal_uInt16* pTextAttr, sal_Int32 nCursorPos, sal_uInt16 nCursorFlags,
+ const ExtTextInputAttr* pTextAttr, sal_Int32 nCursorPos, sal_uInt16 nCursorFlags,
bool bOnlyCursor)
: maText(rText)
{
if ( pTextAttr && !maText.isEmpty() )
{
- mpTextAttr = new sal_uInt16[maText.getLength()];
- memcpy( mpTextAttr, pTextAttr, maText.getLength()*sizeof(sal_uInt16) );
+ mpTextAttr = new ExtTextInputAttr[maText.getLength()];
+ memcpy( mpTextAttr, pTextAttr, maText.getLength()*sizeof(ExtTextInputAttr) );
}
else
{
@@ -46,8 +46,8 @@ CommandExtTextInputData::CommandExtTextInputData( const CommandExtTextInputData&
{
if ( rData.mpTextAttr && !maText.isEmpty() )
{
- mpTextAttr = new sal_uInt16[maText.getLength()];
- memcpy( mpTextAttr, rData.mpTextAttr, maText.getLength()*sizeof(sal_uInt16) );
+ mpTextAttr = new ExtTextInputAttr[maText.getLength()];
+ memcpy( mpTextAttr, rData.mpTextAttr, maText.getLength()*sizeof(ExtTextInputAttr) );
}
else
{
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index cde81f6163c6..3f3d0b2e1454 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -1115,7 +1115,7 @@ static bool ImplHandleKey( vcl::Window* pWindow, MouseNotifyEvent nSVEvent,
static bool ImplHandleExtTextInput( vcl::Window* pWindow,
const OUString& rText,
- const sal_uInt16* pTextAttr,
+ const ExtTextInputAttr* pTextAttr,
sal_Int32 nCursorPos, sal_uInt16 nCursorFlags )
{
ImplSVData* pSVData = ImplGetSVData();
@@ -1200,8 +1200,8 @@ static bool ImplHandleExtTextInput( vcl::Window* pWindow,
}
if ( pTextAttr )
{
- pWinData->mpExtOldAttrAry = new sal_uInt16[rText.getLength()];
- memcpy( pWinData->mpExtOldAttrAry, pTextAttr, rText.getLength()*sizeof( sal_uInt16 ) );
+ pWinData->mpExtOldAttrAry = new ExtTextInputAttr[rText.getLength()];
+ memcpy( pWinData->mpExtOldAttrAry, pTextAttr, rText.getLength()*sizeof( ExtTextInputAttr ) );
}
return !ImplCallCommand( pChild, CommandEventId::ExtTextInput, &aData );
}
diff --git a/vcl/unx/generic/app/i18n_cb.cxx b/vcl/unx/generic/app/i18n_cb.cxx
index 1fda95ef0814..a892c90b5065 100644
--- a/vcl/unx/generic/app/i18n_cb.cxx
+++ b/vcl/unx/generic/app/i18n_cb.cxx
@@ -246,48 +246,48 @@ Preedit_UpdateAttributes ( preedit_text_t* ptext, XIMFeedback* feedback,
// Convert the XIM feedback values into appropriate VCL
// EXTTEXTINPUT_ATTR values
// returns an allocate list of attributes, which must be freed by caller
-sal_uInt16*
-Preedit_FeedbackToSAL ( XIMFeedback* pfeedback, int nlength, std::vector<sal_uInt16>& rSalAttr )
+ExtTextInputAttr*
+Preedit_FeedbackToSAL ( XIMFeedback* pfeedback, int nlength, std::vector<ExtTextInputAttr>& rSalAttr )
{
- sal_uInt16 *psalattr;
- sal_uInt16 nval;
- sal_uInt16 noldval = 0;
- XIMFeedback nfeedback;
+ ExtTextInputAttr *psalattr;
+ ExtTextInputAttr nval;
+ ExtTextInputAttr noldval = ExtTextInputAttr::NONE;
+ XIMFeedback nfeedback;
// only work with reasonable length
- if (nlength > 0 && nlength > sal::static_int_cast<int>(rSalAttr.size()) )
+ if (nlength > 0 && nlength > sal::static_int_cast<int>(rSalAttr.size()) )
{
rSalAttr.reserve( nlength );
psalattr = &rSalAttr[0];
}
- else
+ else
return nullptr;
- for (int npos = 0; npos < nlength; npos++)
+ for (int npos = 0; npos < nlength; npos++)
{
- nval = 0;
+ nval = ExtTextInputAttr::NONE;
nfeedback = pfeedback[npos];
// means to use the feedback of the previous char
if (nfeedback == 0)
{
nval = noldval;
- }
+ }
// convert feedback to attributes
else
{
if (nfeedback & XIMReverse)
- nval |= EXTTEXTINPUT_ATTR_HIGHLIGHT;
+ nval |= ExtTextInputAttr::Highlight;
if (nfeedback & XIMUnderline)
- nval |= EXTTEXTINPUT_ATTR_UNDERLINE;
+ nval |= ExtTextInputAttr::Underline;
if (nfeedback & XIMHighlight)
- nval |= EXTTEXTINPUT_ATTR_HIGHLIGHT;
+ nval |= ExtTextInputAttr::Highlight;
if (nfeedback & XIMPrimary)
- nval |= EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE;
+ nval |= ExtTextInputAttr::DottedUnderline;
if (nfeedback & XIMSecondary)
- nval |= EXTTEXTINPUT_ATTR_DASHDOTUNDERLINE;
+ nval |= ExtTextInputAttr::DashDotUnderline;
if (nfeedback & XIMTertiary) // same as 2ery
- nval |= EXTTEXTINPUT_ATTR_DASHDOTUNDERLINE;
+ nval |= ExtTextInputAttr::DashDotUnderline;
}
// copy in list
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index afc09698ee21..947ca79cdd93 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -2862,7 +2862,7 @@ void X11SalFrame::beginUnicodeSequence()
if( ! aDeleteWatch.isDeleted() )
{
- sal_uInt16 nTextAttr = EXTTEXTINPUT_ATTR_UNDERLINE;
+ ExtTextInputAttr nTextAttr = ExtTextInputAttr::Underline;
SalExtTextInputEvent aEv;
aEv.mnTime = 0;
aEv.maText = rSeq;
@@ -2890,7 +2890,7 @@ bool X11SalFrame::appendUnicodeSequence( sal_Unicode c )
aBuf.append( rSeq );
aBuf.append( c );
rSeq = aBuf.makeStringAndClear();
- std::vector<sal_uInt16> attribs( rSeq.getLength(), EXTTEXTINPUT_ATTR_UNDERLINE );
+ std::vector<ExtTextInputAttr> attribs( rSeq.getLength(), ExtTextInputAttr::Underline );
SalExtTextInputEvent aEv;
aEv.mnTime = 0;
@@ -2923,7 +2923,7 @@ bool X11SalFrame::endUnicodeSequence()
sal_uInt32 nValue = aNumbers.toUInt32( 16 );
if( nValue >= 32 )
{
- sal_uInt16 nTextAttr = EXTTEXTINPUT_ATTR_UNDERLINE;
+ ExtTextInputAttr nTextAttr = ExtTextInputAttr::Underline;
SalExtTextInputEvent aEv;
aEv.mnTime = 0;
aEv.maText = OUString( sal_Unicode(nValue) );
diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx
index c2f3c7533c72..daf064d884e8 100644
--- a/vcl/unx/gtk/gtksalframe.cxx
+++ b/vcl/unx/gtk/gtksalframe.cxx
@@ -3722,7 +3722,7 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_
pThis->m_aInputEvent.mnCursorFlags = 0;
pThis->m_aInputEvent.mbOnlyCursor = False;
- pThis->m_aInputFlags = std::vector<sal_uInt16>( std::max( 1, (int)pThis->m_aInputEvent.maText.getLength() ), 0 );
+ pThis->m_aInputFlags = std::vector<ExtTextInputAttr>( std::max( 1, (int)pThis->m_aInputEvent.maText.getLength() ), ExtTextInputAttr::NONE );
PangoAttrIterator *iter = pango_attr_list_get_iterator(pAttrs);
do
@@ -3730,7 +3730,7 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_
GSList *attr_list = nullptr;
GSList *tmp_list = nullptr;
gint start, end;
- guint sal_attr = 0;
+ ExtTextInputAttr sal_attr = ExtTextInputAttr::NONE;
pango_attr_iterator_range (iter, &start, &end);
if (end == G_MAXINT)
@@ -3749,14 +3749,14 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_
switch (pango_attr->klass->type)
{
case PANGO_ATTR_BACKGROUND:
- sal_attr |= EXTTEXTINPUT_ATTR_HIGHLIGHT;
+ sal_attr |= ExtTextInputAttr::Highlight;
pThis->m_aInputEvent.mnCursorFlags |= EXTTEXTINPUT_CURSOR_INVISIBLE;
break;
case PANGO_ATTR_UNDERLINE:
- sal_attr |= EXTTEXTINPUT_ATTR_UNDERLINE;
+ sal_attr |= ExtTextInputAttr::Underline;
break;
case PANGO_ATTR_STRIKETHROUGH:
- sal_attr |= EXTTEXTINPUT_ATTR_REDTEXT;
+ sal_attr |= ExtTextInputAttr::RedText;
break;
default:
break;
@@ -3764,8 +3764,8 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_
pango_attribute_destroy (pango_attr);
tmp_list = tmp_list->next;
}
- if (sal_attr == 0)
- sal_attr |= EXTTEXTINPUT_ATTR_UNDERLINE;
+ if (sal_attr == ExtTextInputAttr::NONE)
+ sal_attr |= ExtTextInputAttr::Underline;
g_slist_free (attr_list);
// Set the sal attributes on our text
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index 2630aa19f2a2..b6352c694ca5 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -3794,7 +3794,7 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_
pThis->m_aInputEvent.mnCursorFlags = 0;
pThis->m_aInputEvent.mbOnlyCursor = False;
- pThis->m_aInputFlags = std::vector<sal_uInt16>( std::max( 1, (int)pThis->m_aInputEvent.maText.getLength() ), 0 );
+ pThis->m_aInputFlags = std::vector<ExtTextInputAttr>( std::max( 1, (int)pThis->m_aInputEvent.maText.getLength() ), ExtTextInputAttr::NONE );
PangoAttrIterator *iter = pango_attr_list_get_iterator(pAttrs);
do
@@ -3802,7 +3802,7 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_
GSList *attr_list = nullptr;
GSList *tmp_list = nullptr;
gint start, end;
- guint sal_attr = 0;
+ ExtTextInputAttr sal_attr = ExtTextInputAttr::NONE;
pango_attr_iterator_range (iter, &start, &end);
if (end == G_MAXINT)
@@ -3821,14 +3821,14 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_
switch (pango_attr->klass->type)
{
case PANGO_ATTR_BACKGROUND:
- sal_attr |= EXTTEXTINPUT_ATTR_HIGHLIGHT;
+ sal_attr |= ExtTextInputAttr::Highlight;
pThis->m_aInputEvent.mnCursorFlags |= EXTTEXTINPUT_CURSOR_INVISIBLE;
break;
case PANGO_ATTR_UNDERLINE:
- sal_attr |= EXTTEXTINPUT_ATTR_UNDERLINE;
+ sal_attr |= ExtTextInputAttr::Underline;
break;
case PANGO_ATTR_STRIKETHROUGH:
- sal_attr |= EXTTEXTINPUT_ATTR_REDTEXT;
+ sal_attr |= ExtTextInputAttr::RedText;
break;
default:
break;
@@ -3836,8 +3836,8 @@ void GtkSalFrame::IMHandler::signalIMPreeditChanged( GtkIMContext*, gpointer im_
pango_attribute_destroy (pango_attr);
tmp_list = tmp_list->next;
}
- if (sal_attr == 0)
- sal_attr |= EXTTEXTINPUT_ATTR_UNDERLINE;
+ if (sal_attr == ExtTextInputAttr::NONE)
+ sal_attr |= ExtTextInputAttr::Underline;
g_slist_free (attr_list);
// Set the sal attributes on our text
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index 2f057d3eba3e..5ac0cbd5bae6 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -5020,7 +5020,7 @@ static bool ImplHandleIMECompositionInput( WinSalFrame* pFrame,
{
bDef = FALSE;
- sal_uInt16* pSalAttrAry = NULL;
+ ExtTextInputAttr* pSalAttrAry = NULL;
LONG nTextLen = ImmGetCompositionStringW( hIMC, GCS_COMPSTR, 0, 0 ) / sizeof( WCHAR );
if ( nTextLen > 0 )
{
@@ -5040,25 +5040,25 @@ static bool ImplHandleIMECompositionInput( WinSalFrame* pFrame,
if ( pAttrBuf )
{
sal_Int32 nTextLen2 = aEvt.maText.getLength();
- pSalAttrAry = new sal_uInt16[nTextLen2];
+ pSalAttrAry = new ExtTextInputAttr[nTextLen2];
memset( pSalAttrAry, 0, nTextLen2*sizeof( sal_uInt16 ) );
for( sal_Int32 i = 0; (i < nTextLen2) && (i < nAttrLen); i++ )
{
BYTE nWinAttr = pAttrBuf[i];
- sal_uInt16 nSalAttr;
+ ExtTextInputAttr nSalAttr;
if ( nWinAttr == ATTR_TARGET_CONVERTED )
{
- nSalAttr = EXTTEXTINPUT_ATTR_BOLDUNDERLINE;
+ nSalAttr = ExtTextInputAttr::BoldUnderline;
aEvt.mnCursorFlags |= EXTTEXTINPUT_CURSOR_INVISIBLE;
}
else if ( nWinAttr == ATTR_CONVERTED )
- nSalAttr = EXTTEXTINPUT_ATTR_DASHDOTUNDERLINE;
+ nSalAttr = ExtTextInputAttr::DashDotUnderline;
else if ( nWinAttr == ATTR_TARGET_NOTCONVERTED )
- nSalAttr = EXTTEXTINPUT_ATTR_HIGHLIGHT;
+ nSalAttr = ExtTextInputAttr::Highlight;
else if ( nWinAttr == ATTR_INPUT_ERROR )
- nSalAttr = EXTTEXTINPUT_ATTR_REDTEXT | EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE;
+ nSalAttr = ExtTextInputAttr::RedText | ExtTextInputAttr::DottedUnderline;
else /* ( nWinAttr == ATTR_INPUT ) */
- nSalAttr = EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE;
+ nSalAttr = ExtTextInputAttr::DottedUnderline;
pSalAttrAry[i] = nSalAttr;
}