22 #include <svx/svxids.hrc>
35 #define TBL_DEST_CELL 0
36 #define TBL_DEST_ROW 1
37 #define TBL_DEST_TBL 2
41 SID_ATTR_BRUSH, SID_ATTR_BRUSH,
42 SID_ATTR_BRUSH_CHAR, SID_ATTR_BRUSH_CHAR,
53 return SID_ATTR_BRUSH;
57 return SID_ATTR_BRUSH_ROW;
61 return SID_ATTR_BRUSH_TABLE;
69 bCharBackColor(false),
81 if (
auto pItem = pDocSh->
GetItem( SID_COLOR_TABLE ))
82 pColorTable = pItem->GetColorList();
84 if ( !pColorTable.is() )
89 if (
auto pItem = pDocSh->
GetItem( SID_BITMAP_LIST ) )
90 pBitmapList = pItem->GetBitmapList();
109 return DeactivateRC::KeepPage;
114 return DeactivateRC::LeavePage;
124 if ( SfxItemState::SET ==
m_pResetSet->GetItemState( SID_BACKGRND_DESTINATION,
false, &pItem ) )
137 sal_uInt16 nSlot = SID_ATTR_BRUSH;
141 nSlot = SID_ATTR_BRUSH_CHAR;
143 nSlot = SID_ATTR_CHAR_BACK_COLOR;
145 sal_uInt16 nWhich =
GetWhich(nSlot);
150 case drawing::FillStyle_NONE:
154 if ( SID_ATTR_CHAR_BACK_COLOR == nSlot )
167 case drawing::FillStyle_SOLID:
170 if ( SID_ATTR_CHAR_BACK_COLOR == nSlot )
182 case drawing::FillStyle_BITMAP:
185 if ( GraphicType::NONE != aBrushItem->GetGraphicObject()->GetType() )
186 rCoreSet->
Put( *aBrushItem );
195 if (nSlot != SID_ATTR_BRUSH)
201 rCoreSet->
Put(aBrushItem);
204 if (nSlot != SID_ATTR_BRUSH_ROW)
210 rCoreSet->
Put(aBrushItem);
213 if (nSlot != SID_ATTR_BRUSH_TABLE)
219 rCoreSet->
Put(aBrushItem);
223 if (
m_xTblLBox->get_value_changed_from_saved())
234 auto xRet = std::make_unique<SvxBkgTabPage>(pPage, pController, *rAttrs);
235 xRet->SetOptimalSize(pController);
245 if ( nFlags & SvxBackgroundTabFlags::SHOW_TBLCTL )
248 m_xTblLBox = m_xBuilder->weld_combo_box(
"tablelb");
252 if ((nFlags & SvxBackgroundTabFlags::SHOW_HIGHLIGHTING) ||
253 (nFlags & SvxBackgroundTabFlags::SHOW_CHAR_BKGCOLOR))
255 bHighlighting = bool(nFlags & SvxBackgroundTabFlags::SHOW_HIGHLIGHTING);
256 bCharBackColor = bool(nFlags & SvxBackgroundTabFlags::SHOW_CHAR_BKGCOLOR);
258 if (nFlags & SvxBackgroundTabFlags::SHOW_SELECTOR)
292 sal_Int32 nSelPos = rBox.get_active();
293 if (m_nActPos == nSelPos)
300 if (SfxItemState::SET == maSet.GetItemState(nWhich))
302 SvxBrushItem aBrushItem(static_cast<const SvxBrushItem&>(maSet.Get(nWhich)));
307 SelectFillType(*m_xBtnNone, &maSet);
312 drawing::FillStyle eXFS = drawing::FillStyle_NONE;
316 eXFS = aFillStyleItem.GetValue();
321 case drawing::FillStyle_NONE:
323 SelectFillType(*m_xBtnNone, &maSet);
326 case drawing::FillStyle_SOLID:
328 SelectFillType(*m_xBtnColor, &maSet);
332 static_cast<SvxColorTabPage*
>(GetFillTabPage())->SetCtlPreviewOld(*m_pResetSet);
335 case drawing::FillStyle_BITMAP:
337 SelectFillType(*m_xBtnBitmap, &maSet);
#define LINK(Instance, Class, Member)
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
std::unique_ptr< weld::ComboBox > m_xTblLBox
virtual bool FillItemSet(SfxItemSet *) override
bool Set(const SfxItemSet &, bool bDeep=true)
std::unique_ptr< SvxBrushItem > getSvxBrushItemFromSourceSet(const SfxItemSet &rSourceSet, sal_uInt16 nBackgroundID, bool bSearchInParents, bool bXMLImportHack)
static XColorListRef CreateStdColorList()
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)
std::unique_ptr< weld::ToggleButton > m_xBtnHatch
virtual void ActivatePage(const SfxItemSet &rSet) override
virtual void Reset(const SfxItemSet *) override
static SfxObjectShell * Current()
void SetColorList(XColorListRef const &pColorList)
IMPL_LINK(SvxBkgTabPage, TblDestinationHdl_Impl, weld::ComboBox &, rBox, void)
constexpr::Color COL_TRANSPARENT(0xFF, 0xFF, 0xFF, 0xFF)
virtual void PageCreated(const SfxAllItemSet &aSet) override
SvxBkgTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rInAttrs)
virtual void PageCreated(const SfxAllItemSet &aSet) override
bool IsBtnClicked() const
std::unique_ptr< weld::ToggleButton > m_xBtnGradient
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
virtual bool FillItemSet(SfxItemSet *) override
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
void setSvxBrushItemAsFillAttributesToTargetSet(const SvxBrushItem &rBrush, SfxItemSet &rToSet)
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
std::unique_ptr< weld::ToggleButton > m_xBtnBitmap
SfxItemPool * GetPool() const
constexpr TypedWhichId< XFillColorItem > XATTR_FILLCOLOR(XATTR_FILL_FIRST+1)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
virtual void ActivatePage(const SfxItemSet &) override
class SvxBackgroundTabPage -----------------------------------------—
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
virtual std::unique_ptr< SfxItemSet > Clone(bool bItems=true, SfxItemPool *pToPool=nullptr) const
virtual ~SvxBkgTabPage() override
virtual void Reset(const SfxItemSet *) override
SfxOkDialogController * GetDialogController() const
sal_uInt32 GetValue() const
static const sal_uInt16 pPageRanges[]
std::unique_ptr< weld::ToggleButton > m_xBtnPattern
static sal_uInt16 lcl_GetTableDestSlot(sal_Int32 nTblDest)
std::unique_ptr< SfxItemSet > m_pResetSet
void SetBitmapList(XBitmapListRef const &pBmpLst)
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
void SetOptimalSize(weld::DialogController *pController)
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const