sw/source/core/frmedt/fews.cxx    |   17 ++++++++++++++++-
 sw/source/uibase/shells/grfsh.cxx |    4 ++++
 2 files changed, 20 insertions(+), 1 deletion(-)

New commits:
commit 059be5dc87b348cc923795bf5a07ab0696f8a8d4
Author:     Justin Luth <[email protected]>
AuthorDate: Mon Nov 10 19:22:55 2025 -0500
Commit:     Justin Luth <[email protected]>
CommitDate: Wed Nov 12 16:20:36 2025 +0100

    tdf#169219 swpagerelsize ui: apply WidthPercentRelation changes
    
    This fixes a 25.8 regression from
    commit 81f7503d2d205f4f6df0bfd1a66ed10cccb556c2
        tdf#132853 - UI: fix different sizes in Image tabs Type & Crop
    
    Without this patch, when you open up
    sw/qa/extras/odfexport/data/relh-page-tdf80282.odt,
    go to the image properties,
    and change the value from 100% to 50%,
    then the next time you open image properties
    it would be based on 'Entire paragraph area'.
    
    With the patch, it remains at 'Entire Page'.
    
    Note that tdf#132853 also caused regression bug tdf#166873
    which was only fixed in 26.2,
    so backporting this patch probably needs that one too. Untested...
    
    Change-Id: I0def4a73edc3445d5325f97336087ca878ccb312
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193774
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <[email protected]>

diff --git a/sw/source/uibase/shells/grfsh.cxx 
b/sw/source/uibase/shells/grfsh.cxx
index 08da7a6091ac..75a1c9b0ffca 100644
--- a/sw/source/uibase/shells/grfsh.cxx
+++ b/sw/source/uibase/shells/grfsh.cxx
@@ -433,6 +433,10 @@ void SwGrfShell::Execute(SfxRequest &rReq)
                         const Size& rRelativeSize = pSizeItem->GetSize();
                         aSize.SetWidthPercent( static_cast< sal_uInt8 >( 
rRelativeSize.Width() ) );
                         aSize.SetHeightPercent( static_cast< sal_uInt8 >( 
rRelativeSize.Height() ) );
+
+                        SwFormatFrameSize aCopyRelation = 
pSet->Get(RES_FRM_SIZE);
+                        
aSize.SetWidthPercentRelation(aCopyRelation.GetWidthPercentRelation());
+                        
aSize.SetHeightPercentRelation(aCopyRelation.GetHeightPercentRelation());
                     }
                     pSet->Put( aSize );
                 }
commit d5825b65bcfc06bd7062c76c4ef098835ffa1eab
Author:     Justin Luth <[email protected]>
AuthorDate: Mon Nov 10 18:59:26 2025 -0500
Commit:     Justin Luth <[email protected]>
CommitDate: Wed Nov 12 16:20:26 2025 +0100

    tdf#169219 swpagerelsize ui: fix width percent value
    
    This is a follow-up to 4.3 swpagerelsize
    
    Without this patch, when you open up
    sw/qa/extras/odfexport/data/relh-page-tdf80282.odt
    and go to the image properties,
    it would say relative width to entire page of 162 percent.
    Now it says 100%.
    
    Not sure why this wasn't handled earlier
    when the stuff I copied and pasted from a few lines below
    was initially added.
    Perhaps because that situation wasn't really working at all
    until my 6.1 commit which was flagged in this bug 169219.
    
    Change-Id: I73163ad94bf895099576004f5d16242ffba5ca98
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193773
    Reviewed-by: Justin Luth <[email protected]>
    Tested-by: Jenkins

diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx
index 27c38dbf44b4..2b109399fb2e 100644
--- a/sw/source/core/frmedt/fews.cxx
+++ b/sw/source/core/frmedt/fews.cxx
@@ -875,7 +875,22 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
             }
         }
         if ( _opPercent )
-            *_opPercent = pFrame->getFramePrintArea().SSize();
+        {
+            if (RndStdIds::FLY_AT_FLY == _nAnchorId || !pFormatFrameSize)
+                *_opPercent = pFrame->getFramePrintArea().SSize();
+            else
+            {
+                if (pFormatFrameSize->GetWidthPercentRelation() == 
text::RelOrientation::PAGE_FRAME)
+                    _opPercent->setWidth(pFrame->getFrameArea().Width());
+                else
+                    _opPercent->setWidth(pFrame->getFramePrintArea().Width());
+
+                if (pFormatFrameSize->GetHeightPercentRelation() == 
text::RelOrientation::PAGE_FRAME)
+                     _opPercent->setHeight(pFrame->getFrameArea().Height());
+                else
+                    
_opPercent->setHeight(pFrame->getFramePrintArea().Height());
+            }
+        }
     }
     else
     {

Reply via email to