diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-09 17:07:54 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-11 07:14:34 +0000 |
commit | 63ba54a168dbc777cdcec2393be476bdd5f79bc1 (patch) | |
tree | 48de29007d02ba4a982a50a1bd0138460e215c23 /vcl/unx/generic | |
parent | 7b9ea3348ac08d775ae452132239853724c65a41 (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>
Diffstat (limited to 'vcl/unx/generic')
-rw-r--r-- | vcl/unx/generic/app/i18n_cb.cxx | 34 | ||||
-rw-r--r-- | vcl/unx/generic/window/salframe.cxx | 6 |
2 files changed, 20 insertions, 20 deletions
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) ); |