summaryrefslogtreecommitdiffstats
path: root/sw/source/core/fields
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 09:29:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 09:29:03 +0000
commit5a7157d319477830426797532e02ac39d3b859f4 (patch)
tree3773f5ce209bee14a5643e98672e0f3828c71434 /sw/source/core/fields
parentReleasing progress-linux version 4:24.2.0-3~progress7.99u1. (diff)
downloadlibreoffice-5a7157d319477830426797532e02ac39d3b859f4.tar.xz
libreoffice-5a7157d319477830426797532e02ac39d3b859f4.zip
Merging upstream version 4:24.2.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sw/source/core/fields')
-rw-r--r--sw/source/core/fields/expfld.cxx20
-rw-r--r--sw/source/core/fields/postithelper.cxx4
2 files changed, 17 insertions, 7 deletions
diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx
index 434f676729..6ed4cdb7c1 100644
--- a/sw/source/core/fields/expfld.cxx
+++ b/sw/source/core/fields/expfld.cxx
@@ -881,10 +881,9 @@ std::unique_ptr<SwField> SwSetExpField::Copy() const
void SwSetExpField::SetSubType(sal_uInt16 nSub)
{
+ assert((nSub & 0xff) != (nsSwGetSetExpType::GSE_STRING|nsSwGetSetExpType::GSE_EXPR) && "SubType is illegal!");
static_cast<SwSetExpFieldType*>(GetTyp())->SetType(nSub & 0xff);
mnSubType = nSub & 0xff00;
-
- OSL_ENSURE( (nSub & 0xff) != 3, "SubType is illegal!" );
}
sal_uInt16 SwSetExpField::GetSubType() const
@@ -1100,8 +1099,19 @@ bool SwSetExpField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
break;
case FIELD_PROP_SUBTYPE:
nTmp32 = lcl_APIToSubType(rAny);
- if(nTmp32 >= 0)
- SetSubType(o3tl::narrowing<sal_uInt16>((GetSubType() & 0xff00) | nTmp32));
+ if (0 <= nTmp32 && nTmp32 != (GetSubType() & 0xff))
+ {
+ auto const subType(o3tl::narrowing<sal_uInt16>((GetSubType() & 0xff00) | nTmp32));
+ if (((nTmp32 & nsSwGetSetExpType::GSE_STRING) != (GetSubType() & nsSwGetSetExpType::GSE_STRING))
+ && GetInputFlag())
+ {
+ SwXTextField::TransmuteLeadToInputField(*this, &subType);
+ }
+ else
+ {
+ SetSubType(subType);
+ }
+ }
break;
case FIELD_PROP_PAR3:
rAny >>= maPText;
@@ -1120,7 +1130,7 @@ bool SwSetExpField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
if (static_cast<SwSetExpFieldType*>(GetTyp())->GetType()
& nsSwGetSetExpType::GSE_STRING)
{
- SwXTextField::TransmuteLeadToInputField(*this);
+ SwXTextField::TransmuteLeadToInputField(*this, nullptr);
}
else
{
diff --git a/sw/source/core/fields/postithelper.cxx b/sw/source/core/fields/postithelper.cxx
index a3f27be6f5..06fb3db7ef 100644
--- a/sw/source/core/fields/postithelper.cxx
+++ b/sw/source/core/fields/postithelper.cxx
@@ -97,8 +97,8 @@ SwAnchoredObject* GetAnchoredObjectOfAnnotationMark(const sw::mark::IMark& rAnno
for (SwAnchoredObject* pObject : *pAnchored)
{
- SwFrameFormat& rFrameFormat = pObject->GetFrameFormat();
- const SwPosition* pFrameAnchor = rFrameFormat.GetAnchor().GetContentAnchor();
+ SwFrameFormat* pFrameFormat = pObject->GetFrameFormat();
+ const SwPosition* pFrameAnchor = pFrameFormat->GetAnchor().GetContentAnchor();
if (!pFrameAnchor)
{
continue;