42#include <bitmaps.hlst>
65 :
SfxTabPage(pPage, pController,
"modules/swriter/ui/wrappage.ui",
"WrapPage", &
rSet)
73 , m_bContourImage(false)
74 , m_xNoWrapImg(m_xBuilder->weld_image(
"noneimg"))
75 , m_xNoWrapRB(m_xBuilder->weld_radio_button(
"none"))
76 , m_xWrapLeftImg(m_xBuilder->weld_image(
"beforeimg"))
77 , m_xWrapLeftRB(m_xBuilder->weld_radio_button(
"before"))
78 , m_xWrapRightImg(m_xBuilder->weld_image(
"afterimg"))
79 , m_xWrapRightRB(m_xBuilder->weld_radio_button(
"after"))
80 , m_xWrapParallelImg(m_xBuilder->weld_image(
"parallelimg"))
81 , m_xWrapParallelRB(m_xBuilder->weld_radio_button(
"parallel"))
82 , m_xWrapThroughImg(m_xBuilder->weld_image(
"throughimg"))
83 , m_xWrapThroughRB(m_xBuilder->weld_radio_button(
"through"))
84 , m_xIdealWrapImg(m_xBuilder->weld_image(
"optimalimg"))
85 , m_xIdealWrapRB(m_xBuilder->weld_radio_button(
"optimal"))
86 , m_xLeftMarginED(m_xBuilder->weld_metric_spin_button(
"left",
FieldUnit::
CM))
87 , m_xRightMarginED(m_xBuilder->weld_metric_spin_button(
"right",
FieldUnit::
CM))
88 , m_xTopMarginED(m_xBuilder->weld_metric_spin_button(
"top",
FieldUnit::
CM))
89 , m_xBottomMarginED(m_xBuilder->weld_metric_spin_button(
"bottom",
FieldUnit::
CM))
90 , m_xWrapAnchorOnlyCB(m_xBuilder->weld_check_button(
"anchoronly"))
91 , m_xWrapTransparentCB(m_xBuilder->weld_check_button(
"transparent"))
92 , m_xWrapOutlineCB(m_xBuilder->weld_check_button(
"outline"))
93 , m_xWrapOutsideCB(m_xBuilder->weld_check_button(
"outside"))
94 , m_xAllowOverlapCB(m_xBuilder->weld_check_button(
"allowoverlap"))
121 return std::make_unique<SwWrapTabPage>(pPage, pController, *
rSet);
164 css::text::WrapTextMode nSur = rSurround.
GetSurround();
169 && (nSur != css::text::WrapTextMode_NONE))
178 const bool bContour = rSurround.
IsContour();
188 case css::text::WrapTextMode_NONE:
194 case css::text::WrapTextMode_THROUGH:
207 case css::text::WrapTextMode_PARALLEL:
213 case css::text::WrapTextMode_DYNAMIC:
221 if (nSur == css::text::WrapTextMode_LEFT)
223 else if (nSur == css::text::WrapTextMode_RIGHT)
264 bool bModified =
false;
269 std::shared_ptr<SvxOpaqueItem> aOp(std::make_shared<SvxOpaqueItem>(
RES_OPAQUE));
284 aSur.
SetSurround(css::text::WrapTextMode_PARALLEL);
289 aOp->SetValue(
false);
325 if ( bTopMod || bBottomMod )
342 if ( bLeftMod || bRightMod )
365 if (!pOldItem || aInfluence != *pOldItem)
380 bool bEnable = (
m_nAnchorId != RndStdIds::FLY_AS_CHAR);
467 css::text::WrapTextMode nSur = rSurround.
GetSurround();
476 const bool bAllHtmlModes =
478 (eHOrient == text::HoriOrientation::RIGHT || eHOrient == text::HoriOrientation::LEFT);
489 && (eHOrient == text::HoriOrientation::RIGHT)
490 && (eHRelOrient == text::RelOrientation::PRINT_AREA)));
494 && (eHOrient == text::HoriOrientation::LEFT)
495 && (eHRelOrient == text::RelOrientation::PRINT_AREA)));
500 && (eHRelOrient != text::RelOrientation::PRINT_AREA))
502 && (eHOrient != text::HoriOrientation::RIGHT));
544 && nSur != css::text::WrapTextMode_NONE );
554 return DeactivateRC::LeavePage;
559 auto nValue = rEdit.get_value(FieldUnit::NONE);
561 if (&rEdit == m_xLeftMarginED.get())
562 pOpposite = m_xRightMarginED.get();
563 else if (&rEdit == m_xRightMarginED.get())
564 pOpposite = m_xLeftMarginED.get();
565 else if (&rEdit == m_xTopMarginED.get())
566 pOpposite = m_xBottomMarginED.get();
567 else if (&rEdit == m_xBottomMarginED.get())
568 pOpposite = m_xTopMarginED.get();
574 auto nOpposite = pOpposite->
get_value(FieldUnit::NONE);
576 if (
nValue + nOpposite > std::max(rEdit.get_max(FieldUnit::NONE), pOpposite->
get_max(FieldUnit::NONE)))
583 bool bWrapThrough = m_xWrapThroughRB->get_active();
584 m_xWrapTransparentCB->set_sensitive(bWrapThrough && !m_bHtmlMode);
585 bWrapThrough |= ( m_nAnchorId == RndStdIds::FLY_AS_CHAR );
586 m_xWrapOutlineCB->set_sensitive(!bWrapThrough && !m_xNoWrapRB->get_active());
587 m_xWrapOutsideCB->set_sensitive(!bWrapThrough && m_xWrapOutlineCB->get_active());
588 m_xWrapAnchorOnlyCB->set_sensitive(
589 ((m_nAnchorId == RndStdIds::FLY_AT_PARA) || (m_nAnchorId == RndStdIds::FLY_AT_CHAR)) &&
590 (!m_xNoWrapRB->get_active()) );
592 ContourHdl(*m_xWrapOutlineCB);
597 bool bEnable = !(m_xWrapOutlineCB->get_active() && m_xWrapOutlineCB->get_sensitive());
599 m_xWrapOutsideCB->set_sensitive(!bEnable);
601 bEnable = !m_xWrapOutlineCB->get_active();
602 if (bEnable == m_bContourImage)
604 m_bContourImage = !bEnable;
623 m_xNoWrapImg->set_from_icon_name(RID_BMP_WRAP_CONTOUR_NONE);
GraphicType GetType() const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
void SetTabPage(std::unique_ptr< SfxTabPage > xTabPage)
weld::Container * get_content_area()
const SfxItemSet & GetItemSet() const
void SetExchangeSupport()
const SfxPoolItem * GetOldItem(const SfxItemSet &rSet, sal_uInt16 nSlot, bool bDeep=true)
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
void SetRight(const tools::Long nR, const sal_uInt16 nProp=100)
tools::Long GetRight() const
tools::Long GetLeft() const
void SetLeft(const tools::Long nL, const sal_uInt16 nProp=100)
const Size & GetSize() const
void SetLower(const sal_uInt16 nL, const sal_uInt16 nProp=100)
sal_uInt16 GetUpper() const
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
sal_uInt16 GetLower() const
Graphic GetIMapGraphic() const
Remove default parameter, because method always called this default value.
void ValidateMetrics(SvxSwFrameValidation &rVal, const SwFormatAnchor *pToCharContentPos, bool bOnlyPercentRefValue=false)
SwWrapDlg(weld::Window *pParent, const SfxItemSet &rSet, SwWrtShell *pSh, bool bDrawMode)
std::unique_ptr< weld::MetricSpinButton > m_xLeftMarginED
virtual void ActivatePage(const SfxItemSet &rSet) override
std::unique_ptr< weld::Image > m_xWrapLeftImg
SwWrapTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
static const WhichRangesContainer s_aWrapPageRg
std::unique_ptr< weld::MetricSpinButton > m_xBottomMarginED
std::unique_ptr< weld::MetricSpinButton > m_xTopMarginED
std::unique_ptr< weld::RadioButton > m_xWrapThroughRB
std::unique_ptr< weld::Image > m_xNoWrapImg
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
virtual void Reset(const SfxItemSet *rSet) override
std::unique_ptr< weld::Image > m_xIdealWrapImg
std::unique_ptr< weld::Image > m_xWrapRightImg
void SetShell(SwWrtShell *pSh)
std::unique_ptr< weld::CheckButton > m_xAllowOverlapCB
std::unique_ptr< weld::CheckButton > m_xWrapTransparentCB
std::unique_ptr< weld::RadioButton > m_xWrapParallelRB
std::unique_ptr< weld::Image > m_xWrapParallelImg
virtual ~SwWrapTabPage() override
std::unique_ptr< weld::RadioButton > m_xNoWrapRB
virtual bool FillItemSet(SfxItemSet *rSet) override
void SetFormatUsed(bool bFormat, bool bDrawMode)
std::unique_ptr< weld::RadioButton > m_xWrapLeftRB
std::unique_ptr< weld::MetricSpinButton > m_xRightMarginED
std::unique_ptr< weld::Image > m_xWrapThroughImg
std::unique_ptr< weld::RadioButton > m_xIdealWrapRB
std::unique_ptr< weld::RadioButton > m_xWrapRightRB
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
std::unique_ptr< weld::CheckButton > m_xWrapOutsideCB
std::unique_ptr< weld::CheckButton > m_xWrapAnchorOnlyCB
std::unique_ptr< weld::CheckButton > m_xWrapOutlineCB
Used by the UI to modify the document model.
SelectionType GetSelectionType() const
virtual void set_active(bool active)=0
@ Minimum
Value in Var-direction gives minimum (can be exceeded but not be less).
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
constexpr TypedWhichId< SwFormatHoriOrient > RES_HORI_ORIENT(109)
constexpr TypedWhichId< SwFormatVertOrient > RES_VERT_ORIENT(108)
constexpr TypedWhichId< SvxOpaqueItem > RES_OPAQUE(105)
constexpr TypedWhichId< SwFormatWrapInfluenceOnObjPos > RES_WRAP_INFLUENCE_ON_OBJPOS(132)
constexpr TypedWhichId< SvxProtectItem > RES_PROTECT(106)
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(110)
constexpr TypedWhichId< SwFormatSurround > RES_SURROUND(107)
constexpr TypedWhichId< SwFormatFollowTextFlow > RES_FOLLOW_TEXT_FLOW(130)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(97)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(98)
constexpr TypedWhichId< SvxPrintItem > RES_PRINT(104)
#define LINK(Instance, Class, Member)
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
css::uno::Reference< css::animations::XAnimationNode > Clone(const css::uno::Reference< css::animations::XAnimationNode > &xSourceNode, const SdPage *pSource=nullptr, const SdPage *pTarget=nullptr)
static constexpr auto Items
SwWrtShell * GetActiveWrtShell()
SVT_DLLPUBLIC void SetFieldUnit(weld::MetricSpinButton &rCtrl, FieldUnit eUnit, bool bAll=false)
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
IMPL_LINK_NOARG(SwWrapTabPage, WrapTypeHdl, weld::Toggleable &, void)
IMPL_LINK(SwWrapTabPage, RangeModifyHdl, weld::MetricSpinButton &, rEdit, void)