sw/source/ui/frmdlg/frmpage.cxx |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 81f7503d2d205f4f6df0bfd1a66ed10cccb556c2
Author:     Balazs Varga <balazs.varga.ext...@allotropia.de>
AuthorDate: Mon Jan 20 14:40:49 2025 +0100
Commit:     Balazs Varga <balazs.varga.ext...@allotropia.de>
CommitDate: Fri Jan 24 10:03:39 2025 +0100

    tdf#132853 - UI: fix different sizes in Image tabs Type & Crop
    
    Sincornize Graphic frame size and frame size values in Writer
    "Position and Size" tab and "Crop" tab.
    
    Change-Id: Ifc325bb510ac4d2376ec5be791aadb7df81e8ff5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180510
    Reviewed-by: Heiko Tietze <heiko.tie...@documentfoundation.org>
    Tested-by: Jenkins
    Reviewed-by: Balazs Varga <balazs.varga.ext...@allotropia.de>

diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 5de4a804bbf0..d4265da6df75 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -1351,6 +1351,12 @@ bool SwFramePage::FillItemSet(SfxItemSet *rSet)
             aSz.SetHeightSizeType(SwFrameSize::Minimum);
 
         bRet |= nullptr != rSet->Put( aSz );
+        if (bRet)
+        {
+            SvxSizeItem aGSz(SID_ATTR_GRAF_FRMSIZE);
+            aGSz.SetSize(aSz.GetSize());
+            bRet |= nullptr != rSet->Put(aGSz);
+        }
     }
     if (m_xFollowTextFlowCB->get_state_changed_from_saved())
     {
@@ -2296,7 +2302,14 @@ void SwFramePage::Init(const SfxItemSet& rSet)
         }
     }
 
-    const SwFormatFrameSize& rSize = rSet.Get(RES_FRM_SIZE);
+    SwFormatFrameSize rSize = rSet.Get(RES_FRM_SIZE);
+    // size could already have been set from another (Crop) page
+    if (const SvxSizeItem* pSizeItem = 
rSet.GetItemIfSet(SID_ATTR_GRAF_FRMSIZE, false))
+    {
+        if (pSizeItem->GetSize() != rSize.GetSize())
+            rSize.SetSize(pSizeItem->GetSize());
+    }
+
     sal_Int64 nWidth  = m_xWidthED->NormalizePercent(rSize.GetWidth());
     sal_Int64 nHeight = m_xHeightED->NormalizePercent(rSize.GetHeight());
 

Reply via email to