summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2022-12-31 08:52:53 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2023-01-10 20:10:58 +0000
commit95fa081bc55c1791474ebd81d67db0199992870d (patch)
treee993c5fdb84bcd07ad6a4671575d44bc98744550
parentResolves: tdf#152948 Do not use GetExcelName() to obtain English function name (diff)
downloadcore-95fa081bc55c1791474ebd81d67db0199992870d.tar.gz
core-95fa081bc55c1791474ebd81d67db0199992870d.zip
tdf#152676 Writer: Compatibility options no longer saved as default
regression from commit 78adf246d5e99d0f5d91d2e03c1379b154289d8d Date: Mon Jul 26 10:54:36 2021 +0200 return SvtCompatibilityEntry from SvtCompatibilityOptions::GetList where I mistakenly assumed that the bIsDefault flag in SvtCompatibilityEntry was being set by the SvtCompatibilityOptions code. Rather remove this field if it is not going to be maintained properly. Change-Id: I23963ae885563d5abc8a99cfd144d7fe00c6f192 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144882 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit c6f756e968bbb72522bd01dea283288a61a286a7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145216 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--include/unotools/compatibility.hxx11
-rw-r--r--sw/source/ui/config/optcomp.cxx10
-rw-r--r--unotools/source/config/compatibility.cxx2
3 files changed, 8 insertions, 15 deletions
diff --git a/include/unotools/compatibility.hxx b/include/unotools/compatibility.hxx
index 73e77a598ec9..72017812ab8b 100644
--- a/include/unotools/compatibility.hxx
+++ b/include/unotools/compatibility.hxx
@@ -129,19 +129,8 @@ class SvtCompatibilityEntry
setValue(rIdx, css::uno::Any(rValue));
}
- bool isDefaultEntry() const
- {
- return m_bDefaultEntry;
- }
-
- void setDefaultEntry( bool rValue )
- {
- m_bDefaultEntry = rValue;
- }
-
private:
std::vector<css::uno::Any> m_aPropertyValue;
- bool m_bDefaultEntry;
};
/*-************************************************************************************************************
diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx
index 0ba1b147614c..d760e885a66e 100644
--- a/sw/source/ui/config/optcomp.cxx
+++ b/sw/source/ui/config/optcomp.cxx
@@ -205,10 +205,11 @@ void SwCompatibilityOptPage::InitControls( const SfxItemSet& rSet )
{
const OUString sEntryName = rEntry.getValue<OUString>( SvtCompatibilityEntry::Index::Name );
const bool bIsUserEntry = ( sEntryName == SvtCompatibilityEntry::USER_ENTRY_NAME );
+ const bool bIsDefaultEntry = ( sEntryName == SvtCompatibilityEntry::DEFAULT_ENTRY_NAME );
m_pImpl->m_aList.push_back( rEntry );
- if ( rEntry.isDefaultEntry() )
+ if ( bIsDefaultEntry )
continue;
OUString sNewEntry;
@@ -260,7 +261,12 @@ IMPL_LINK_NOARG(SwCompatibilityOptPage, UseAsDefaultHdl, weld::Button&, void)
return;
auto pItem = std::find_if(m_pImpl->m_aList.begin(), m_pImpl->m_aList.end(),
- [](const SvtCompatibilityEntry& rItem) { return rItem.isDefaultEntry(); });
+ [](const SvtCompatibilityEntry& rItem)
+ {
+ const OUString sEntryName = rItem.getValue<OUString>( SvtCompatibilityEntry::Index::Name );
+ const bool bIsDefaultEntry = ( sEntryName == SvtCompatibilityEntry::DEFAULT_ENTRY_NAME );
+ return bIsDefaultEntry;
+ });
if (pItem != m_pImpl->m_aList.end())
{
const sal_Int32 nCount = m_xOptionsLB->n_children();
diff --git a/unotools/source/config/compatibility.cxx b/unotools/source/config/compatibility.cxx
index 4f0e1d2ac20c..eed01cce1c8b 100644
--- a/unotools/source/config/compatibility.cxx
+++ b/unotools/source/config/compatibility.cxx
@@ -65,8 +65,6 @@ SvtCompatibilityEntry::SvtCompatibilityEntry()
setValue<bool>( Index::SubtractFlysAnchoredAtFlys, false );
setValue<bool>( Index::EmptyDbFieldHidesPara, true );
setValue<bool>( Index::AddTableLineSpacing, false );
-
- setDefaultEntry( false );
}
OUString SvtCompatibilityEntry::getName( const Index rIdx )