From 3c866bb8e42554ac96d3588208e167e7786e2d00 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 27 Feb 2015 10:08:03 +0200 Subject: replace SVX_SEARCHCMD_ constants with enum class Change-Id: I675c488742219cc19624a21d1fc8e5033e7cbefa --- svl/source/items/srchitem.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'svl') diff --git a/svl/source/items/srchitem.cxx b/svl/source/items/srchitem.cxx index 0c69751c66cf..9e9a045d851e 100644 --- a/svl/source/items/srchitem.cxx +++ b/svl/source/items/srchitem.cxx @@ -112,7 +112,7 @@ SvxSearchItem::SvxSearchItem( const sal_uInt16 nId ) : 2, 2, 2, TransliterationModules_IGNORE_CASE ), eFamily ( SFX_STYLE_FAMILY_PARA ), - nCommand ( 0 ), + nCommand ( SvxSearchCmd::FIND ), nCellType ( SVX_SEARCHIN_FORMULA ), nAppFlag ( SVX_SEARCHAPP_WRITER ), bRowDirection ( true ), @@ -373,7 +373,7 @@ bool SvxSearchItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMembe aSeq[1].Name = SRCH_PARA_FAMILY; aSeq[1].Value <<= sal_Int16( eFamily ); aSeq[2].Name = SRCH_PARA_COMMAND; - aSeq[2].Value <<= nCommand; + aSeq[2].Value <<= static_cast(nCommand); aSeq[3].Name = SRCH_PARA_CELLTYPE; aSeq[3].Value <<= nCellType; aSeq[4].Name = SRCH_PARA_APPFLAG; @@ -483,8 +483,12 @@ bool SvxSearchItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nM } else if ( aSeq[i].Name == SRCH_PARA_COMMAND ) { - if ( aSeq[i].Value >>= nCommand ) + sal_uInt16 nTmp; + if ( aSeq[i].Value >>= nTmp ) + { + nCommand = static_cast(nTmp); ++nConvertedCount; + } } else if ( aSeq[i].Name == SRCH_PARA_CELLTYPE ) { @@ -538,7 +542,7 @@ bool SvxSearchItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nM break; } case MID_SEARCH_COMMAND: - bRet = (rVal >>= nInt); nCommand = (sal_uInt16) nInt; break; + bRet = (rVal >>= nInt); nCommand = static_cast(nInt); break; case MID_SEARCH_STYLEFAMILY: bRet = (rVal >>= nInt); eFamily = (SfxStyleFamily) (sal_Int16) nInt; break; case MID_SEARCH_CELLTYPE: -- cgit v1.2.3