diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-09-25 09:36:24 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-09-25 13:25:03 +0200 |
commit | 472535a4f8aa95a17d996e96a67df60e72df7b32 (patch) | |
tree | 8c7af0b2cd292f3fd23a03707a521b8fdd13cc89 | |
parent | 96bd7504165f89ec5485d00a487e54634af347ce (diff) |
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@collabora.com>
Tested-by: Jenkins
-rw-r--r-- | sw/source/ui/frmdlg/wrap.cxx | 18 | ||||
-rw-r--r-- | sw/source/uibase/inc/wrap.hxx | 1 | ||||
-rw-r--r-- | sw/source/uibase/shells/drwbassh.cxx | 1 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/wrappage.ui | 15 |
4 files changed, 35 insertions, 0 deletions
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> |