[Libreoffice-commits] core.git: sw/source

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Thu Jun 10 14:36:19 UTC 2021


 sw/source/ui/frmdlg/frmpage.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 5951da5175b9d7e5b3b47bd0d90989d2ef528c79
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Thu Jun 10 15:11:03 2021 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu Jun 10 16:35:34 2021 +0200

    sw image anchor type: add style UI for this
    
    A frame style contains RES_ANCHOR, and SwFormatAnchor::m_eAnchorId
    already describes an anchor type. This is even exposed on the UNO API as
    the AnchorType property and its ODF import/export is also implemented.
    
    Enable UI for this, so that templates can decide the default anchor type
    when inserting images. Still keep the "to frame" anchor type disabled as
    its meaning is unclear for frame styles.
    
    Change-Id: I5d8ef63af9c8f2efa6485c4ec827ba9aef9b8956
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116990
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    Tested-by: Jenkins

diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index dc148972e277..09d732efce5a 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -884,8 +884,8 @@ void SwFramePage::Reset( const SfxItemSet *rSet )
 
     if (m_bFormat)
     {
-        // at formats no anchor editing
-        m_xAnchorFrame->set_sensitive(false);
+        // at formats no to-fly anchor
+        m_xAnchorAtFrameRB->set_sensitive(false);
         if (rSet->GetItemState(FN_KEEP_ASPECT_RATIO) != SfxItemState::SET)
         {
             m_xFixedRatioCB->set_sensitive(false);
@@ -1047,7 +1047,7 @@ bool SwFramePage::FillItemSet(SfxItemSet *rSet)
 
     RndStdIds eAnchorId = GetAnchor();
 
-    if ( !m_bFormat )
+    if ( !m_bFormat || eAnchorId != RndStdIds::FLY_AT_FLY )
     {
         pOldItem = GetOldItem(*rSet, RES_ANCHOR);
         if (m_bNew || !pOldItem || eAnchorId != static_cast<const SwFormatAnchor*>(pOldItem)->GetAnchorId())
@@ -2287,7 +2287,7 @@ void SwFramePage::SetFormatUsed(bool bFormatUsed)
 {
     m_bFormat = bFormatUsed;
     if (m_bFormat)
-        m_xAnchorFrame->hide();
+        m_xAnchorAtFrameRB->hide();
 }
 
 void SwFramePage::EnableVerticalPositioning( bool bEnable )


More information about the Libreoffice-commits mailing list