summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/svl/srchitem.hxx18
-rw-r--r--sc/source/core/data/global.cxx4
-rw-r--r--sd/source/ui/app/sdmod.cxx2
-rw-r--r--svl/source/items/srchitem.cxx10
-rw-r--r--svx/source/dialog/srchdlg.cxx8
5 files changed, 25 insertions, 17 deletions
diff --git a/include/svl/srchitem.hxx b/include/svl/srchitem.hxx
index 33d101a0596d..531d95e679d3 100644
--- a/include/svl/srchitem.hxx
+++ b/include/svl/srchitem.hxx
@@ -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 );
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index a9a2ae819084..6a0aaf0ca61b 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -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()
diff --git a/sd/source/ui/app/sdmod.cxx b/sd/source/ui/app/sdmod.cxx
index 6ab2cc2f605c..f7fb1c270938 100644
--- a/sd/source/ui/app/sdmod.cxx
+++ b/sd/source/ui/app/sdmod.cxx
@@ -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,
diff --git a/svl/source/items/srchitem.cxx b/svl/source/items/srchitem.cxx
index 9e9a045d851e..87a55d7575fb 100644
--- a/svl/source/items/srchitem.cxx
+++ b/svl/source/items/srchitem.cxx
@@ -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 )
{
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index 943ac9b66c86..a493b6b13f87 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -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 )
{