Kaydet (Commit) c9c1caa4 authored tarafından Noel Grandin's avatar Noel Grandin

convert SVX_SEARCHAPP_ constants to enum class

Change-Id: I2b9d379e56e0af655aa06afb5391140de952b9d6
üst 10bc10dd
......@@ -45,10 +45,14 @@ enum class SvxSearchCmd
#define SVX_SEARCHIN_FORMULA ((sal_uInt16)0)
#define SVX_SEARCHIN_VALUE ((sal_uInt16)1)
#define SVX_SEARCHIN_NOTE ((sal_uInt16)2)
#define SVX_SEARCHAPP_WRITER ((sal_uInt16)0)
#define SVX_SEARCHAPP_CALC ((sal_uInt16)1)
#define SVX_SEARCHAPP_DRAW ((sal_uInt16)2)
#define SVX_SEARCHAPP_BASE ((sal_uInt16)3)
enum class SvxSearchApp
{
WRITER = 0,
CALC = 1,
DRAW = 2,
BASE = 3,
};
// class SvxSearchItem ---------------------------------------------------
......@@ -64,7 +68,7 @@ class SVL_DLLPUBLIC SvxSearchItem :
// Calc-specific
sal_uInt16 nCellType; // Search in Formulas/Values/Notes
sal_uInt16 nAppFlag; // application which the dialog is for
SvxSearchApp nAppFlag; // application which the dialog is for
bool bRowDirection; // search direction: row-wise/column-wise
bool bAllTables; // search in all sheets
bool bSearchFiltered; // search filtered cells.
......@@ -146,8 +150,8 @@ public:
bool GetNotes() const { return bNotes; }
void SetNotes(bool bNew) { bNotes = bNew; }
sal_uInt16 GetAppFlag() const { return nAppFlag; }
void SetAppFlag(sal_uInt16 nNewAppFlag) { nAppFlag = nNewAppFlag; }
SvxSearchApp GetAppFlag() const { return nAppFlag; }
void SetAppFlag(SvxSearchApp nNewAppFlag) { nAppFlag = nNewAppFlag; }
inline bool IsLevenshtein() const;
void SetLevenshtein( bool bVal );
......
......@@ -232,7 +232,7 @@ const SvxSearchItem& ScGlobal::GetSearchItem()
if (!pSearchItem)
{
pSearchItem = new SvxSearchItem( SID_SEARCH_ITEM );
pSearchItem->SetAppFlag( SVX_SEARCHAPP_CALC );
pSearchItem->SetAppFlag( SvxSearchApp::CALC );
}
return *pSearchItem;
}
......@@ -244,7 +244,7 @@ void ScGlobal::SetSearchItem( const SvxSearchItem& rNew )
pSearchItem = static_cast<SvxSearchItem*>(rNew.Clone());
pSearchItem->SetWhich( SID_SEARCH_ITEM );
pSearchItem->SetAppFlag( SVX_SEARCHAPP_CALC );
pSearchItem->SetAppFlag( SvxSearchApp::CALC );
}
void ScGlobal::ClearAutoFormat()
......
......@@ -83,7 +83,7 @@ SdModule::SdModule(SfxObjectFactory* pFact1, SfxObjectFactory* pFact2 )
{
SetName( OUString( "StarDraw" ) ); // Do not translate!
pSearchItem = new SvxSearchItem(SID_SEARCH_ITEM);
pSearchItem->SetAppFlag(SVX_SEARCHAPP_DRAW);
pSearchItem->SetAppFlag(SvxSearchApp::DRAW);
StartListening( *SfxGetpApp() );
SvxErrorHandler::ensure();
mpErrorHdl = new SfxErrorHandler( RID_SD_ERRHDL,
......
......@@ -114,7 +114,7 @@ SvxSearchItem::SvxSearchItem( const sal_uInt16 nId ) :
eFamily ( SFX_STYLE_FAMILY_PARA ),
nCommand ( SvxSearchCmd::FIND ),
nCellType ( SVX_SEARCHIN_FORMULA ),
nAppFlag ( SVX_SEARCHAPP_WRITER ),
nAppFlag ( SvxSearchApp::WRITER ),
bRowDirection ( true ),
bAllTables ( false ),
bSearchFiltered ( false ),
......@@ -377,7 +377,7 @@ bool SvxSearchItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMembe
aSeq[3].Name = SRCH_PARA_CELLTYPE;
aSeq[3].Value <<= nCellType;
aSeq[4].Name = SRCH_PARA_APPFLAG;
aSeq[4].Value <<= nAppFlag;
aSeq[4].Value <<= static_cast<sal_uInt16>(nAppFlag);
aSeq[5].Name = SRCH_PARA_ROWDIR;
aSeq[5].Value <<= bRowDirection;
aSeq[6].Name = SRCH_PARA_ALLTABLES;
......@@ -497,8 +497,12 @@ bool SvxSearchItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nM
}
else if ( aSeq[i].Name == SRCH_PARA_APPFLAG )
{
if ( aSeq[i].Value >>= nAppFlag )
sal_uInt16 nTmp;
if ( aSeq[i].Value >>= nTmp )
{
nAppFlag = static_cast<SvxSearchApp>(nTmp);
++nConvertedCount;
}
}
else if ( aSeq[i].Name == SRCH_PARA_ROWDIR )
{
......
......@@ -725,7 +725,7 @@ void SvxSearchDialog::Init_Impl( bool bSearchPattern )
ToggleSaveToModule aNoModuleSave(*this, false);
SvtSearchOptions aOpt;
bWriter = ( pSearchItem->GetAppFlag() == SVX_SEARCHAPP_WRITER );
bWriter = ( pSearchItem->GetAppFlag() == SvxSearchApp::WRITER );
if ( ( nModifyFlag & MODIFY_WORD ) == 0 )
m_pWordBtn->Check( pSearchItem->GetWordOnly() );
......@@ -755,7 +755,7 @@ void SvxSearchDialog::Init_Impl( bool bSearchPattern )
ShowOptionalControls_Impl();
bool bDraw = false;
if ( pSearchItem->GetAppFlag() == SVX_SEARCHAPP_CALC )
if ( pSearchItem->GetAppFlag() == SvxSearchApp::CALC )
{
m_pCalcGrid->Show();
Link aLink = LINK( this, SvxSearchDialog, FlagHdl_Impl );
......@@ -802,7 +802,7 @@ void SvxSearchDialog::Init_Impl( bool bSearchPattern )
{
m_pWordBtn->SetText( aCalcStr.getToken( 1, '#' ) );
if ( pSearchItem->GetAppFlag() == SVX_SEARCHAPP_DRAW )
if ( pSearchItem->GetAppFlag() == SvxSearchApp::DRAW )
{
m_pSearchAllBtn->Hide();
......@@ -1351,7 +1351,7 @@ IMPL_LINK( SvxSearchDialog, ModifyHdl_Impl, ComboBox *, pEd )
bSet = false;
// Calc allows searching for empty cells.
bool bAllowEmptySearch = (pSearchItem->GetAppFlag() == SVX_SEARCHAPP_CALC);
bool bAllowEmptySearch = (pSearchItem->GetAppFlag() == SvxSearchApp::CALC);
if ( pEd == m_pSearchLB || pEd == m_pReplaceLB )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment