tdf#130428 remove unnecessary usage of SfxItemState::UNKNOWN

See task, slowly trying to reduce usages of that flag

Change-Id: I50dc8e21e2f5e82e21bf335d63d07cee1ee18d01
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116913
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Tested-by: Jenkins
This commit is contained in:
Armin Le Grand (Allotropia) 2021-06-09 13:33:26 +02:00 committed by Armin Le Grand
parent 33b4198735
commit bcc28948d0

View File

@ -77,14 +77,14 @@ namespace {
struct PathUserData_Impl struct PathUserData_Impl
{ {
SvtPathOptions::Paths nRealId; SvtPathOptions::Paths nRealId;
SfxItemState eState; bool bItemStateSet;
OUString sUserPath; OUString sUserPath;
OUString sWritablePath; OUString sWritablePath;
bool bReadOnly; bool bReadOnly;
explicit PathUserData_Impl(SvtPathOptions::Paths nId) explicit PathUserData_Impl(SvtPathOptions::Paths nId)
: nRealId(nId) : nRealId(nId)
, eState(SfxItemState::UNKNOWN) , bItemStateSet(false)
, bReadOnly(false) , bReadOnly(false)
{ {
} }
@ -227,7 +227,7 @@ bool SvxPathTabPage::FillItemSet( SfxItemSet* )
{ {
PathUserData_Impl* pPathImpl = reinterpret_cast<PathUserData_Impl*>(m_xPathBox->get_id(i).toInt64()); PathUserData_Impl* pPathImpl = reinterpret_cast<PathUserData_Impl*>(m_xPathBox->get_id(i).toInt64());
SvtPathOptions::Paths nRealId = pPathImpl->nRealId; SvtPathOptions::Paths nRealId = pPathImpl->nRealId;
if (pPathImpl->eState == SfxItemState::SET) if (pPathImpl->bItemStateSet )
SetPathList( nRealId, pPathImpl->sUserPath, pPathImpl->sWritablePath ); SetPathList( nRealId, pPathImpl->sUserPath, pPathImpl->sWritablePath );
} }
return true; return true;
@ -403,7 +403,7 @@ IMPL_LINK_NOARG(SvxPathTabPage, StandardHdl_Impl, weld::Button&, void)
} }
} }
m_xPathBox->set_text(rEntry, Convert_Impl(sTemp), 1); m_xPathBox->set_text(rEntry, Convert_Impl(sTemp), 1);
pPathImpl->eState = SfxItemState::SET; pPathImpl->bItemStateSet = true;
pPathImpl->sUserPath = sUserPath.makeStringAndClear(); pPathImpl->sUserPath = sUserPath.makeStringAndClear();
pPathImpl->sWritablePath = sWritablePath; pPathImpl->sWritablePath = sWritablePath;
} }
@ -448,7 +448,7 @@ void SvxPathTabPage::ChangeCurrentEntry( const OUString& _rFolder )
return; return;
m_xPathBox->set_text(nEntry, Convert_Impl(sNewPathStr), 1); m_xPathBox->set_text(nEntry, Convert_Impl(sNewPathStr), 1);
pPathImpl->eState = SfxItemState::SET; pPathImpl->bItemStateSet = true;
pPathImpl->sWritablePath = sNewPathStr; pPathImpl->sWritablePath = sNewPathStr;
if ( SvtPathOptions::Paths::Work == pPathImpl->nRealId ) if ( SvtPathOptions::Paths::Work == pPathImpl->nRealId )
{ {
@ -530,7 +530,7 @@ IMPL_LINK_NOARG(SvxPathTabPage, PathHdl_Impl, weld::Button&, void)
m_xPathBox->set_text(nEntry, Convert_Impl(sFullPath), 1); m_xPathBox->set_text(nEntry, Convert_Impl(sFullPath), 1);
// save modified flag // save modified flag
pPathImpl->eState = SfxItemState::SET; pPathImpl->bItemStateSet = true;
pPathImpl->sUserPath = sUser; pPathImpl->sUserPath = sUser;
pPathImpl->sWritablePath = sWritable; pPathImpl->sWritablePath = sWritable;
} }