summaryrefslogtreecommitdiff
path: root/sw
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 /sw
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>
Diffstat (limited to 'sw')
-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
5 files changed, 23 insertions, 23 deletions
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 );