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)
367 rSet->
Put(aInfluence);
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;
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);
#define LINK(Instance, Class, Member)
constexpr TypedWhichId< SvxProtectItem > RES_PROTECT(100)
void SetFieldUnit(weld::MetricSpinButton &rField, FieldUnit eUnit, bool bAll)
constexpr TypedWhichId< SwFormatSurround > RES_SURROUND(101)
void SetRight(const tools::Long nR, const sal_uInt16 nProp=100)
constexpr TypedWhichId< SvxPrintItem > RES_PRINT(98)
sal_uInt16 GetLower() const
void setWidth(tools::Long nWidth)
static constexpr auto Items
void SetFormatUsed(bool bFormat, bool bDrawMode)
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
std::unique_ptr< weld::MetricSpinButton > m_xBottomMarginED
std::unique_ptr< weld::Image > m_xIdealWrapImg
tools::Long GetRight() const
SwWrtShell * GetActiveWrtShell()
std::unique_ptr< weld::RadioButton > m_xWrapParallelRB
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
weld::Container * get_content_area()
constexpr TypedWhichId< SvxOpaqueItem > RES_OPAQUE(99)
static SfxObjectShell * Current()
IMPL_LINK(SwWrapTabPage, RangeModifyHdl, weld::MetricSpinButton &, rEdit, void)
virtual ~SwWrapTabPage() override
std::unique_ptr< weld::Image > m_xWrapParallelImg
Value in Var-direction gives minimum (can be exceeded but not be less).
Used by the UI to modify the document model.
constexpr tools::Long Width() const
std::unique_ptr< weld::Image > m_xWrapRightImg
constexpr TypedWhichId< SwFormatVertOrient > RES_VERT_ORIENT(102)
static const WhichRangesContainer m_aWrapPageRg
constexpr TypedWhichId< SwFormatHoriOrient > RES_HORI_ORIENT(103)
void SetExchangeSupport()
constexpr TypedWhichId< SwFormatWrapInfluenceOnObjPos > RES_WRAP_INFLUENCE_ON_OBJPOS(125)
virtual void Reset(const SfxItemSet *rSet) override
void SetLower(const sal_uInt16 nL, const sal_uInt16 nProp=100)
void SetShell(SwWrtShell *pSh)
const SfxItemSet & GetItemSet() const
std::unique_ptr< weld::RadioButton > m_xWrapRightRB
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
std::unique_ptr< weld::RadioButton > m_xWrapLeftRB
const SfxPoolItem * GetOldItem(const SfxItemSet &rSet, sal_uInt16 nSlot, bool bDeep=true)
std::unique_ptr< weld::CheckButton > m_xWrapOutlineCB
SwWrapTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
Reference< XAnimationNode > Clone(const Reference< XAnimationNode > &xSourceNode, const SdPage *pSource, const SdPage *pTarget)
std::unique_ptr< weld::RadioButton > m_xWrapThroughRB
GraphicType GetType() const
std::unique_ptr< weld::MetricSpinButton > m_xRightMarginED
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
tools::Long GetLeft() const
virtual void set_active(bool active)=0
IMPL_LINK_NOARG(SwWrapTabPage, WrapTypeHdl, weld::Toggleable &, void)
void SetTabPage(std::unique_ptr< SfxTabPage > xTabPage)
Graphic GetIMapGraphic() const
Remove default parameter, because method always called this default value.
std::unique_ptr< weld::MetricSpinButton > m_xLeftMarginED
std::unique_ptr< weld::MetricSpinButton > m_xTopMarginED
virtual bool FillItemSet(SfxItemSet *rSet) override
std::unique_ptr< weld::CheckButton > m_xWrapTransparentCB
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void SetLeft(const tools::Long nL, const sal_uInt16 nProp=100)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
constexpr tools::Long Height() const
std::unique_ptr< weld::CheckButton > m_xWrapAnchorOnlyCB
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
std::unique_ptr< weld::RadioButton > m_xIdealWrapRB
void setHeight(tools::Long nHeight)
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
virtual void ActivatePage(const SfxItemSet &rSet) override
std::unique_ptr< weld::CheckButton > m_xAllowOverlapCB
std::unique_ptr< weld::Image > m_xWrapLeftImg
constexpr TypedWhichId< SwFormatFollowTextFlow > RES_FOLLOW_TEXT_FLOW(123)
SelectionType GetSelectionType() const
std::unique_ptr< weld::CheckButton > m_xWrapOutsideCB
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
std::unique_ptr< weld::RadioButton > m_xNoWrapRB
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
void ValidateMetrics(SvxSwFrameValidation &rVal, const SwPosition *pToCharContentPos, bool bOnlyPercentRefValue=false)
std::unique_ptr< weld::Image > m_xWrapThroughImg
SwWrapDlg(weld::Window *pParent, const SfxItemSet &rSet, SwWrtShell *pSh, bool bDrawMode)
std::unique_ptr< weld::Image > m_xNoWrapImg
const Size & GetSize() const
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(104)
sal_uInt16 GetUpper() const
bool m_bDetectedRangeSegmentation false