summaryrefslogtreecommitdiff
path: root/sw/source/ui
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-09-25 09:36:24 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-09-25 13:25:03 +0200
commit472535a4f8aa95a17d996e96a67df60e72df7b32 (patch)
tree8c7af0b2cd292f3fd23a03707a521b8fdd13cc89 /sw/source/ui
parent96bd7504165f89ec5485d00a487e54634af347ce (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
Diffstat (limited to 'sw/source/ui')
-rw-r--r--sw/source/ui/frmdlg/wrap.cxx18
1 files changed, 18 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;
}