summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2024-01-15 08:15:46 +0100
committerGabor Kelemen <gabor.kelemen.extern@allotropia.de>2024-01-16 15:42:11 +0100
commit395c8cfb770e7424fd99b884f568a32fcc7a728f (patch)
treebf0935bb645ad8b3fba2a4d0ce64ee35f96edd0f /cui
parent18f4c113329855f71b7084c3ad9983e04f54b2de (diff)
tdf#159186 Use changed value when editing string-list a second time
Change-Id: I0e26a053b3b5fb04abf87894bcfebccea8bdd26f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162074 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> (cherry picked from commit 76ce6466b814bb9ff119f4f83795a2aeefc28793) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162097 Tested-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de> Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/options/optaboutconfig.cxx28
-rw-r--r--cui/source/options/optaboutconfig.hxx5
2 files changed, 19 insertions, 14 deletions
diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx
index 1b02642e6d00..f927363f8650 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -70,15 +70,18 @@ struct UserData
bool bIsReadOnly;
bool bWasModified;
OUString sPropertyPath;
+ Any aPropertyValue;
OUString sTooltip;
int aLineage;
Reference<XNameAccess> aXNameAccess;
- explicit UserData(OUString aPropertyPath, OUString aTooltip, bool isReadOnly, bool wasModified)
+ explicit UserData(OUString aPropertyPath, Any aPropValue, OUString aTooltip, bool isReadOnly,
+ bool wasModified)
: bIsPropertyPath(true)
, bIsReadOnly(isReadOnly)
, bWasModified(wasModified)
, sPropertyPath(std::move(aPropertyPath))
+ , aPropertyValue(aPropValue)
, sTooltip(std::move(aTooltip))
, aLineage(0)
{
@@ -187,9 +190,10 @@ IMPL_STATIC_LINK_NOARG(CuiAboutConfigTabPage, ValidNameHdl, SvxNameDialog&, bool
CuiAboutConfigTabPage::~CuiAboutConfigTabPage() {}
-void CuiAboutConfigTabPage::InsertEntry(const OUString& rPropertyPath, const OUString& rProp,
- const OUString& rStatus, const OUString& rType,
- const OUString& rValue, const OUString& rTooltip,
+void CuiAboutConfigTabPage::InsertEntry(const OUString& rPropertyPath, Any aPropertyValue,
+ const OUString& rProp, const OUString& rStatus,
+ const OUString& rType, const OUString& rValue,
+ const OUString& rTooltip,
const weld::TreeIter* pParentEntry, bool bInsertToPrefBox,
bool bIsReadOnly, bool bWasModified)
{
@@ -197,8 +201,8 @@ void CuiAboutConfigTabPage::InsertEntry(const OUString& rPropertyPath, const OUS
if (bOnlyModified && !bWasModified)
return;
- m_vectorUserData.push_back(
- std::make_unique<UserData>(rPropertyPath, rTooltip, bIsReadOnly, bWasModified));
+ m_vectorUserData.push_back(std::make_unique<UserData>(rPropertyPath, aPropertyValue, rTooltip,
+ bIsReadOnly, bWasModified));
if (bInsertToPrefBox)
{
OUString sId(weld::toId(m_vectorUserData.back().get()));
@@ -689,8 +693,9 @@ void CuiAboutConfigTabPage::FillItems(const Reference<XNameAccess>& xNameAccess,
for (int j = 1; j < lineage; ++j)
index = sPath.indexOf("/", index + 1);
- InsertEntry(sPath, sPath.copy(index + 1), item, sType, sValue.makeStringAndClear(),
- sTooltip, pParentEntry, !bLoadAll, bReadOnly, bWasModified);
+ InsertEntry(sPath, aNode, sPath.copy(index + 1), item, sType,
+ sValue.makeStringAndClear(), sTooltip, pParentEntry, !bLoadAll, bReadOnly,
+ bWasModified);
}
}
}
@@ -940,10 +945,8 @@ IMPL_LINK_NOARG(CuiAboutConfigTabPage, StandardHdl_Impl, weld::Button&, void)
else if (sPropertyType == "string-list")
{
SvxListDialog aListDialog(m_xDialog.get());
- Reference<XNameAccess> xConfigAccess
- = getConfigAccess(pUserData->sPropertyPath, false);
- Any aNode = xConfigAccess->getByName(sPropertyName);
- uno::Sequence<OUString> aList = aNode.get<uno::Sequence<OUString>>();
+ uno::Sequence<OUString> aList
+ = pUserData->aPropertyValue.get<uno::Sequence<OUString>>();
aListDialog.SetEntries(
comphelper::sequenceToContainer<std::vector<OUString>>(aList));
aListDialog.SetMode(ListMode::String);
@@ -962,6 +965,7 @@ IMPL_LINK_NOARG(CuiAboutConfigTabPage, StandardHdl_Impl, weld::Button&, void)
if (bSaveChanges)
{
AddToModifiedVector(pProperty);
+ pUserData->aPropertyValue = pProperty->Value;
//update listbox value.
m_xPrefBox->set_text(*m_xScratchIter, sPropertyType, 2);
diff --git a/cui/source/options/optaboutconfig.hxx b/cui/source/options/optaboutconfig.hxx
index 28406a8fd776..bc4f7a32f39d 100644
--- a/cui/source/options/optaboutconfig.hxx
+++ b/cui/source/options/optaboutconfig.hxx
@@ -72,8 +72,9 @@ private:
public:
explicit CuiAboutConfigTabPage(weld::Window* pParent);
virtual ~CuiAboutConfigTabPage() override;
- void InsertEntry(const OUString& rPropertyPath, const OUString& rProp, const OUString& rStatus,
- const OUString& rType, const OUString& rValue, const OUString& rTooltip,
+ void InsertEntry(const OUString& rPropertyPath, css::uno::Any aPropertyValue,
+ const OUString& rProp, const OUString& rStatus, const OUString& rType,
+ const OUString& rValue, const OUString& rTooltip,
const weld::TreeIter* pParentEntry, bool bInsertToPrefBox, bool bIsReadOnly,
bool bWasMOdified);
void Reset();