This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 9f13e21939a3ebdfebf890b832e22e0818e4089f
Author: Arrigo Marchiori <[email protected]>
AuthorDate: Sat Aug 30 23:48:52 2025 +0200

    XMLTextFrameContext::EndElement() applies all properties to the ``winner'' 
context.
    
    Addresses bug #126768
    
    (cherry picked from commit 228d6099b5729dcc87c07e2244b07715de4c5994)
---
 main/xmloff/source/text/XMLTextFrameContext.cxx | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/main/xmloff/source/text/XMLTextFrameContext.cxx 
b/main/xmloff/source/text/XMLTextFrameContext.cxx
index 71288e94b2..0cafd06099 100644
--- a/main/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/main/xmloff/source/text/XMLTextFrameContext.cxx
@@ -1477,17 +1477,17 @@ void XMLTextFrameContext::EndElement()
 {
     /// solve if multiple image child contexts were imported
     /// the winner is returned, if something has yet to be done with it
-    const SvXMLImportContext* pWinner = solveMultipleImages();
+    SvXMLImportContext* pWinner = const_cast< SvXMLImportContext* >( 
solveMultipleImages() );
 
     // #123261# see if the winner is a XMLTextFrameContext_Impl
-    const XMLTextFrameContext_Impl* pImplWinner = dynamic_cast< const 
XMLTextFrameContext_Impl* >(pWinner);
+    XMLTextFrameContext_Impl* pImplWinner = dynamic_cast< 
XMLTextFrameContext_Impl* >(pWinner);
 
     if(pImplWinner)
     {
         // #123261# if yes, set name now, after the winner is identified 
(setting at each
         // candidate may run into problems due to colliding with efforts in 
the target to
         // avoid double names, so only set one name at one image and not at 
each)
-        const_cast< XMLTextFrameContext_Impl* 
>(pImplWinner)->SetNameForFrameFromPropSet();
+        pImplWinner->SetNameForFrameFromPropSet();
     }
 
     SvXMLImportContext *pContext = &m_xImplContext;
@@ -1496,11 +1496,17 @@ void XMLTextFrameContext::EndElement()
     if( pImpl )
     {
         pImpl->CreateIfNotThere();
-
+    }
         // --> OD 2009-07-22 #i73249#
 //        // alternative text
 //        if( m_sDesc.getLength() )
 //            pImpl->SetDesc( m_sDesc );
+
+    // Bug #126768: set all properties to the winner
+    if ( pImplWinner ) {
+        pImpl = pImplWinner;
+    }
+    if ( pImpl ) {
         // svg:title
         if( m_sTitle.getLength() )
         {

Reply via email to