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

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Wed Sep 25 11:25:46 UTC 2019


 sw/source/ui/frmdlg/wrap.cxx         |   18 ++++++++++++++++++
 sw/source/uibase/inc/wrap.hxx        |    1 +
 sw/source/uibase/shells/drwbassh.cxx |    1 +
 sw/uiconfig/swriter/ui/wrappage.ui   |   15 +++++++++++++++
 4 files changed, 35 insertions(+)

New commits:
commit 472535a4f8aa95a17d996e96a67df60e72df7b32
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Wed Sep 25 09:36:24 2019 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Sep 25 13:25:03 2019 +0200

    Related: tdf#124600 sw anchored object allow overlap: add UI
    
    Determine is-modified state by always constructing our pool item, and
    then compare to the old one, rather than depending on save_state(). It
    seems both are equally good, but this is simpler to implement.
    
    Change-Id: I8d7a07eb06904f9f11d8c10bc854f7e42531cefa
    Reviewed-on: https://gerrit.libreoffice.org/79501
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    Tested-by: Jenkins

diff --git a/sw/source/ui/frmdlg/wrap.cxx b/sw/source/ui/frmdlg/wrap.cxx
index 14dbad2cc19f..99d9ad75e1b4 100644
--- a/sw/source/ui/frmdlg/wrap.cxx
+++ b/sw/source/ui/frmdlg/wrap.cxx
@@ -43,6 +43,7 @@
 #include <globals.hrc>
 #include <wrap.hxx>
 #include <bitmaps.hlst>
+#include <fmtwrapinfluenceonobjpos.hxx>
 
 using namespace ::com::sun::star;
 
@@ -88,6 +89,7 @@ SwWrapTabPage::SwWrapTabPage(TabPageParent pParent, const SfxItemSet &rSet)
     , m_xWrapTransparentCB(m_xBuilder->weld_check_button("transparent"))
     , m_xWrapOutlineCB(m_xBuilder->weld_check_button("outline"))
     , m_xWrapOutsideCB(m_xBuilder->weld_check_button("outside"))
+    , m_xAllowOverlapCB(m_xBuilder->weld_check_button("allowoverlap"))
 {
     SetExchangeSupport();
 
@@ -248,6 +250,10 @@ void SwWrapTabPage::Reset(const SfxItemSet *rSet)
     m_xBottomMarginED->save_value();
 
     ContourHdl(*m_xWrapOutlineCB);
+
+    const SwFormatWrapInfluenceOnObjPos& rInfluence = rSet->Get(RES_WRAP_INFLUENCE_ON_OBJPOS);
+    m_xAllowOverlapCB->set_active(rInfluence.GetAllowOverlap());
+
     ActivatePage( *rSet );
 }
 
@@ -349,6 +355,18 @@ bool SwWrapTabPage::FillItemSet(SfxItemSet *rSet)
             bModified |= nullptr != rSet->Put(SfxInt16Item(FN_DRAW_WRAP_DLG, bChecked ? 0 : 1));
     }
 
+    const SwFormatWrapInfluenceOnObjPos& rOldInfluence
+        = GetItemSet().Get(RES_WRAP_INFLUENCE_ON_OBJPOS);
+    SwFormatWrapInfluenceOnObjPos aInfluence(rOldInfluence);
+    aInfluence.SetAllowOverlap(m_xAllowOverlapCB->get_active());
+
+    pOldItem = GetOldItem(*rSet, RES_WRAP_INFLUENCE_ON_OBJPOS);
+    if (!pOldItem || aInfluence != *pOldItem)
+    {
+        rSet->Put(aInfluence);
+        bModified = true;
+    }
+
     return bModified;
 }
 
diff --git a/sw/source/uibase/inc/wrap.hxx b/sw/source/uibase/inc/wrap.hxx
index acb9bc3c2791..bffc69bb1c28 100644
--- a/sw/source/uibase/inc/wrap.hxx
+++ b/sw/source/uibase/inc/wrap.hxx
@@ -66,6 +66,7 @@ class SwWrapTabPage: public SfxTabPage
     std::unique_ptr<weld::CheckButton> m_xWrapTransparentCB;
     std::unique_ptr<weld::CheckButton> m_xWrapOutlineCB;
     std::unique_ptr<weld::CheckButton> m_xWrapOutsideCB;
+    std::unique_ptr<weld::CheckButton> m_xAllowOverlapCB;
 
     virtual ~SwWrapTabPage() override;
 
diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx
index 409bcd94ac26..12d87bab691b 100644
--- a/sw/source/uibase/shells/drwbassh.cxx
+++ b/sw/source/uibase/shells/drwbassh.cxx
@@ -129,6 +129,7 @@ void SwDrawBaseShell::Execute(SfxRequest const &rReq)
                                 RES_LR_SPACE, RES_UL_SPACE,
                                 RES_SURROUND, RES_SURROUND,
                                 RES_ANCHOR, RES_ANCHOR,
+                                RES_WRAP_INFLUENCE_ON_OBJPOS, RES_WRAP_INFLUENCE_ON_OBJPOS,
                                 SID_HTML_MODE, SID_HTML_MODE,
                                 FN_DRAW_WRAP_DLG, FN_DRAW_WRAP_DLG>{});
 
diff --git a/sw/uiconfig/swriter/ui/wrappage.ui b/sw/uiconfig/swriter/ui/wrappage.ui
index cf409da7999e..64a362d5e62e 100644
--- a/sw/uiconfig/swriter/ui/wrappage.ui
+++ b/sw/uiconfig/swriter/ui/wrappage.ui
@@ -446,6 +446,21 @@
                         <property name="top_attach">3</property>
                       </packing>
                     </child>
+                    <child>
+                      <object class="GtkCheckButton" id="allowoverlap">
+                        <property name="label" translatable="yes" context="wrappage|outside">Allow overlap</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="use_underline">True</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">4</property>
+                      </packing>
+                    </child>
                   </object>
                 </child>
               </object>


More information about the Libreoffice-commits mailing list