LibreOffice Module cui (master)  1
backgrnd.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <memory>
21 #include <com/sun/star/drawing/FillStyle.hpp>
22 #include <unotools/pathoptions.hxx>
23 #include <vcl/settings.hxx>
24 #include <vcl/graphicfilter.hxx>
25 #include <vcl/idle.hxx>
26 #include <vcl/svapp.hxx>
27 #include <tools/urlobj.hxx>
28 #include <sfx2/dialoghelper.hxx>
29 #include <sfx2/objsh.hxx>
30 #include <sfx2/docfile.hxx>
31 #include <svx/dialogs.hrc>
32 #include <svx/svxids.hrc>
33 #include <svx/strings.hrc>
34 
35 #include <strings.hrc>
36 #include <svx/dialmgr.hxx>
37 #include <editeng/memberids.h>
38 
39 #include <editeng/brushitem.hxx>
40 #include <editeng/colritem.hxx>
41 #include <backgrnd.hxx>
42 
43 #include <svx/xtable.hxx>
44 #include <sfx2/opengrf.hxx>
45 #include <svx/svxerr.hxx>
46 #include <svx/drawitem.hxx>
47 #include <svx/xfillit0.hxx>
48 #include <svx/xflclit.hxx>
49 #include <dialmgr.hxx>
50 #include <sfx2/htmlmode.hxx>
51 #include <svtools/controldims.hxx>
52 #include <svx/flagsdef.hxx>
53 #include <svl/intitem.hxx>
54 #include <sfx2/request.hxx>
55 #include <vcl/GraphicObject.hxx>
56 
58 
59 using namespace css;
60 
61 // table background
62 #define TBL_DEST_CELL 0
63 #define TBL_DEST_ROW 1
64 #define TBL_DEST_TBL 2
65 
66 const sal_uInt16 SvxBackgroundTabPage::pPageRanges[] =
67 {
68  SID_ATTR_BRUSH, SID_ATTR_BRUSH,
69  SID_ATTR_BRUSH_CHAR, SID_ATTR_BRUSH_CHAR,
70  0
71 };
72 
74 static drawing::FillStyle lcl_getFillStyle(const weld::ComboBox& rLbSelect)
75 {
76  return static_cast<drawing::FillStyle>(rLbSelect.get_active_id().toUInt32());
77 }
78 
79 // Selects the entry matching the specified fill style.
80 static void lcl_setFillStyle(weld::ComboBox& rLbSelect, drawing::FillStyle eStyle)
81 {
82  OUString sStyle = OUString::number(static_cast<sal_uInt32>(eStyle));
83  for (int i = 0; i < rLbSelect.get_count(); ++i)
84  {
85  if (rLbSelect.get_id(i) == sStyle)
86  {
87  rLbSelect.set_active(i);
88  return;
89  }
90  }
91 }
92 
93 static sal_uInt16 GetItemId_Impl(const SvtValueSet& rValueSet, const Color& rCol)
94 {
95  bool bFound = false;
96  sal_uInt16 nCount = rValueSet.GetItemCount();
97  sal_uInt16 n = 1;
98 
99  while ( !bFound && n <= nCount )
100  {
101  Color aValCol = rValueSet.GetItemColor(n);
102 
103  bFound = ( aValCol.GetRed() == rCol.GetRed()
104  && aValCol.GetGreen() == rCol.GetGreen()
105  && aValCol.GetBlue() == rCol.GetBlue() );
106 
107  if ( !bFound )
108  n++;
109  }
110  return bFound ? n : 0;
111 }
112 
115 {
116 public:
117  explicit BackgroundPreviewImpl();
118  void setBmp(bool bBmp);
119 
120  void NotifyChange(const Color& rColor);
121  void NotifyChange(const BitmapEx* pBitmap);
122  void SetFillColor(const Color& rColor) { aColor = rColor; }
123 
124 protected:
125  virtual void Paint( vcl::RenderContext& /*rRenderContext*/, const ::tools::Rectangle& rRect ) override;
126  virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
127  virtual void Resize() override;
128 
129 private:
130 
131  void recalcDrawPos();
132 
133  bool bIsBmp;
134  std::unique_ptr<BitmapEx> pBitmap;
139 };
140 
142  : bIsBmp(false)
143  , aColor(Application::GetSettings().GetStyleSettings().GetFieldColor())
144 {
145 }
146 
148 {
149  CustomWidgetController::SetDrawingArea(pDrawingArea);
150  Size aSize(pDrawingArea->get_ref_device().LogicToPixel(Size(300, 77)));
151  pDrawingArea->set_size_request(aSize.Width(), aSize.Height());
152  aDrawRect = tools::Rectangle(Point(0,0), aSize);
154 }
155 
157 {
158  bIsBmp = bBmp;
159  Invalidate();
160 }
161 
163 {
164  if ( !bIsBmp )
165  {
166  const static Color aTranspCol(COL_TRANSPARENT);
167  SetFillColor(rColor == aTranspCol ? Application::GetSettings().GetStyleSettings().GetFieldColor() : rColor.GetRGBColor());
169  }
170 }
171 
173 {
174  if (bIsBmp && (pNewBitmap || pBitmap))
175  {
176  if (pNewBitmap && pBitmap)
177  *pBitmap = *pNewBitmap;
178  else if (pNewBitmap && !pBitmap)
179  pBitmap.reset( new BitmapEx(*pNewBitmap) );
180  else if (!pNewBitmap)
181  pBitmap.reset();
182 
183  recalcDrawPos();
184 
186  }
187 }
188 
190 {
191  if (pBitmap)
192  {
193  Size aSize = GetOutputSizePixel();
194  // InnerSize == Size without one pixel border
195  Size aInnerSize = aSize;
196  aInnerSize.AdjustWidth( -2 );
197  aInnerSize.AdjustHeight( -2 );
198  aDrawSize = pBitmap->GetSizePixel();
199 
200  // bitmap bigger than preview window?
201  if (aDrawSize.Width() > aInnerSize.Width())
202  {
203  aDrawSize.setHeight( aDrawSize.Height() * aInnerSize.Width() / aDrawSize.Width() );
204  if (aDrawSize.Height() > aInnerSize.Height())
205  {
207  aDrawSize.setHeight( aInnerSize.Height() );
208  }
209  else
210  aDrawSize.setWidth( aInnerSize.Width() );
211  }
212  else if (aDrawSize.Height() > aInnerSize.Height())
213  {
214  aDrawSize.setWidth( aDrawSize.Width() * aInnerSize.Height() / aDrawSize.Height() );
215  if (aDrawSize.Width() > aInnerSize.Width())
216  {
218  aDrawSize.setWidth( aInnerSize.Width() );
219  }
220  else
221  aDrawSize.setHeight( aInnerSize.Height() );
222  }
223 
224  aDrawPos.setX( (aSize.Width() - aDrawSize.Width()) / 2 );
225  aDrawPos.setY( (aSize.Height() - aDrawSize.Height()) / 2 );
226  }
227 }
228 
230 {
231  CustomWidgetController::Resize();
233  recalcDrawPos();
234 }
235 
236 void BackgroundPreviewImpl::Paint(vcl::RenderContext& rRenderContext, const ::tools::Rectangle&)
237 {
238  const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
239  rRenderContext.SetBackground(Wallpaper(rStyleSettings.GetWindowColor()));
240  rRenderContext.SetLineColor();
241 
242  if (bIsBmp)
243  rRenderContext.SetFillColor(COL_TRANSPARENT);
244  else
245  rRenderContext.SetFillColor(aColor);
246 
247  rRenderContext.DrawRect(aDrawRect);
248 
249  if (bIsBmp)
250  {
251  if (pBitmap)
252  rRenderContext.DrawBitmapEx(aDrawPos, aDrawSize, *pBitmap);
253  else
254  {
255  Size aSize(GetOutputSizePixel());
256  rRenderContext.DrawLine(Point(0, 0), Point(aSize.Width(), aSize.Height()));
257  rRenderContext.DrawLine(Point(0, aSize.Height()), Point(aSize.Width(), 0));
258  }
259  }
260 }
261 
262 #define HDL(hdl) LINK(this,SvxBackgroundTabPage,hdl)
263 
265  : SvxTabPage(pParent, "cui/ui/backgroundpage.ui", "BackgroundPage", rCoreSet)
266  , nHtmlMode(0)
267  , bAllowShowSelector(true)
268  , bIsGraphicValid(false)
269  , bHighlighting(false)
270  , bCharBackColor(false)
271  , m_bColorSelected(false)
272  , m_xWndPosition(new SvxRectCtl(this))
273  , m_xBackgroundColorSet(new ColorValueSet(m_xBuilder->weld_scrolled_window("backgroundcolorsetwin")))
274  , m_xPreview1(new BackgroundPreviewImpl)
275  , m_xPreview2(new BackgroundPreviewImpl)
276  , m_xFindGraphicsFt(m_xBuilder->weld_label("findgraphicsft"))
277  , m_xAsGrid(m_xBuilder->weld_widget("asgrid"))
278  , m_xSelectTxt(m_xBuilder->weld_label("asft"))
279  , m_xLbSelect(m_xBuilder->weld_combo_box("selectlb"))
280  , m_xTblDesc(m_xBuilder->weld_label("forft"))
281  , m_xTblLBox(m_xBuilder->weld_combo_box("tablelb"))
282  , m_xBackGroundColorLabelFT(m_xBuilder->weld_label("background_label"))
283  , m_xBackGroundColorFrame(m_xBuilder->weld_widget("backgroundcolorframe"))
284  , m_xBtnPreview(m_xBuilder->weld_check_button("showpreview"))
285  , m_xBitmapContainer(m_xBuilder->weld_widget("graphicgrid"))
286  , m_xFileFrame(m_xBuilder->weld_widget("fileframe"))
287  , m_xBtnBrowse(m_xBuilder->weld_button("browse"))
288  , m_xBtnLink(m_xBuilder->weld_check_button("link"))
289  , m_xFtUnlinked(m_xBuilder->weld_label("unlinkedft"))
290  , m_xFtFile(m_xBuilder->weld_label("fileft"))
291  , m_xTypeFrame(m_xBuilder->weld_widget("typeframe"))
292  , m_xBtnPosition(m_xBuilder->weld_radio_button("positionrb"))
293  , m_xBtnArea(m_xBuilder->weld_radio_button("arearb"))
294  , m_xBtnTile(m_xBuilder->weld_radio_button("tilerb"))
295  , m_xWndPositionWin(new weld::CustomWeld(*m_xBuilder, "windowpos", *m_xWndPosition))
296  , m_xBackgroundColorSetWin(new weld::CustomWeld(*m_xBuilder, "backgroundcolorset", *m_xBackgroundColorSet))
297  , m_xPreviewWin1(new weld::CustomWeld(*m_xBuilder, "preview1", *m_xPreview1))
298  , m_xPreviewWin2(new weld::CustomWeld(*m_xBuilder, "preview2", *m_xPreview2))
299 
300 {
301  m_xPreview2->setBmp(true);
302 
303  // this page needs ExchangeSupport
304  SetExchangeSupport();
305 
306  const SfxPoolItem* pItem;
307  SfxObjectShell* pShell;
308 
309  if ( SfxItemState::SET == rCoreSet.GetItemState( SID_HTML_MODE, false, &pItem )
310  || ( nullptr != ( pShell = SfxObjectShell::Current()) &&
311  nullptr != ( pItem = pShell->GetItem( SID_HTML_MODE ) ) ) )
312  {
313  nHtmlMode = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
314  }
315 
317 
318  m_xBackgroundColorSet->SetSelectHdl(HDL(BackgroundColorHdl_Impl));
320  m_xBackgroundColorSet->SetText(SvxResId(RID_SVXSTR_NOFILL));
321 }
322 
324 {
325  disposeOnce();
326 }
327 
329 {
330  m_pLoadIdle.reset();
331  pImportDlg.reset();
332  m_pCellBrush.reset();
333  m_pRowBrush.reset();
334  m_pTableBrush.reset();
335  m_xPreviewWin2.reset();
336  m_xPreviewWin1.reset();
337  m_xBackgroundColorSetWin.reset();
338  m_xWndPositionWin.reset();
339  m_xPreview2.reset();
340  m_xPreview1.reset();
341  m_xBackgroundColorSet.reset();
342  m_xWndPosition.reset();
343 
344  SvxTabPage::dispose();
345 }
346 
348 {
349  return VclPtr<SvxBackgroundTabPage>::Create(pParent, *rAttrSet);
350 }
351 
353 {
354  m_bColorSelected = false;
355 
356  // condition of the preview button is persistent due to UserData
357  OUString aUserData = GetUserData();
358  m_xBtnPreview->set_active(!aUserData.isEmpty() && '1' == aUserData[0]);
359 
360  // don't be allowed to call ShowSelector() after reset anymore
361  bAllowShowSelector = false;
362 
363 
364  // get and evaluate Input-BrushItem
365  bool bBrushItemSet = false;
366  sal_uInt16 nSlot = SID_ATTR_BRUSH;
367  const SfxPoolItem* pItem;
368  sal_uInt16 nDestValue = USHRT_MAX;
369 
370  if ( SfxItemState::SET == rSet->GetItemState( SID_BACKGRND_DESTINATION,
371  false, &pItem ) )
372  {
373  nDestValue = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
374  m_xTblLBox->set_active(nDestValue);
375 
376  switch ( nDestValue )
377  {
378  case TBL_DEST_CELL:
379  nSlot = SID_ATTR_BRUSH;
380  break;
381  case TBL_DEST_ROW:
382  nSlot = SID_ATTR_BRUSH_ROW;
383  break;
384  case TBL_DEST_TBL:
385  nSlot = SID_ATTR_BRUSH_TABLE;
386  break;
387  }
388  }
389  else if( bHighlighting )
390  {
391  nSlot = SID_ATTR_BRUSH_CHAR;
392  }
393  else if( bCharBackColor )
394  {
395  nSlot = SID_ATTR_CHAR_BACK_COLOR;
396  }
397 
398  //#111173# the destination item is missing when the parent style has been changed
399  if (USHRT_MAX == nDestValue && m_xTblLBox->get_visible())
400  nDestValue = 0;
401  sal_uInt16 nWhich = GetWhich(nSlot);
402  std::shared_ptr<SvxBrushItem> aBgdAttr(std::make_shared<SvxBrushItem>(nWhich));
403 
404  if (rSet->GetItemState( nWhich, false ) >= SfxItemState::DEFAULT)
405  {
406  if (!bCharBackColor)
407  {
408  aBgdAttr.reset(static_cast<SvxBrushItem*>(rSet->Get(nWhich).Clone()));
409  }
410  else
411  {
412  // EE_CHAR_BKGCOLOR is SvxBackgroundColorItem, but char background tabpage
413  // can only work with SvxBrushItems
414  // extract Color out of SvxBackColorItem
415  Color aBackColor = static_cast<const SvxBackgroundColorItem&>(rSet->Get(nWhich)).GetValue();
416  // make new SvxBrushItem with this Color
417  aBgdAttr = std::make_shared<SvxBrushItem>(aBackColor, SID_ATTR_BRUSH_CHAR);
418  }
419  bBrushItemSet = true;
420  }
421 
422  m_xBtnTile->set_active(true);
423 
424  if (bBrushItemSet)
425  {
426  FillControls_Impl(*aBgdAttr, aUserData);
427  aBgdColor = aBgdAttr->GetColor();
428  }
429  else
430  {
431  m_xSelectTxt->hide();
432  m_xLbSelect->hide();
433  lcl_setFillStyle(*m_xLbSelect, drawing::FillStyle_SOLID);
435 
436  const SfxPoolItem* pOld = GetOldItem( *rSet, SID_ATTR_BRUSH );
437 
438  if ( pOld )
439  aBgdColor = static_cast<const SvxBrushItem*>(pOld)->GetColor();
440  }
441 
442  if ( nDestValue != USHRT_MAX )
443  {
444  if (m_xTblLBox->get_visible())
445  {
446  m_pCellBrush.reset();
447  m_pRowBrush.reset();
448  m_pTableBrush.reset();
449  m_nActPos = m_xTblLBox->get_active();
450 
451  nWhich = GetWhich( SID_ATTR_BRUSH );
452  if ( rSet->GetItemState( nWhich, false ) >= SfxItemState::DEFAULT )
453  {
454  m_pCellBrush.reset(static_cast<SvxBrushItem*>(rSet->Get(nWhich).Clone()));
455  }
456  m_nCellWhich = nWhich;
457 
458  if ( rSet->GetItemState( SID_ATTR_BRUSH_ROW, false ) >= SfxItemState::DEFAULT )
459  {
460  m_pRowBrush.reset(static_cast<SvxBrushItem*>(rSet->Get(SID_ATTR_BRUSH_ROW).Clone()));
461  }
462  m_nRowWhich = SID_ATTR_BRUSH_ROW;
463 
464  if ( rSet->GetItemState( SID_ATTR_BRUSH_TABLE, false ) >= SfxItemState::DEFAULT )
465  {
466  m_pTableBrush.reset(static_cast<SvxBrushItem*>(rSet->Get(SID_ATTR_BRUSH_TABLE).Clone()));
467  }
468  m_nTableWhich = SID_ATTR_BRUSH_TABLE;
469 
470  TblDestinationHdl_Impl(*m_xTblLBox);
471  m_xTblLBox->save_value();
472  }
473  else if( bHighlighting )
474  {
475  nWhich = GetWhich( SID_ATTR_BRUSH_CHAR );
476  if ( rSet->GetItemState( nWhich, false ) >= SfxItemState::DEFAULT )
477  {
478  pHighlighting.reset(static_cast<SvxBrushItem*>(rSet->Get(nWhich).Clone()));
479  }
480  }
481  else if( bCharBackColor )
482  {
483  nWhich = GetWhich(SID_ATTR_CHAR_BACK_COLOR);
484  if ( rSet->GetItemState( nWhich, false ) >= SfxItemState::DEFAULT )
485  {
486  // EE_CHAR_BKGCOLOR is SvxBackgroundColorItem, but char background tabpage
487  // can only work with SvxBrushItems
488  // extract Color out of SvxBackColorItem
489  Color aBackColor = static_cast<const SvxBackgroundColorItem&>(rSet->Get(nWhich)).GetValue();
490  // make new SvxBrushItem with this Color
491  pHighlighting = std::make_unique<SvxBrushItem>(aBackColor, SID_ATTR_BRUSH_CHAR);
492  }
493  }
494  }
495 }
496 
503 {
504  SetUserData(m_xBtnPreview->get_active() ? OUString('1') : OUString('0'));
505 }
506 
508 {
509  if ( m_pLoadIdle && m_pLoadIdle->IsActive() )
510  {
511  m_pLoadIdle->Stop();
512  LoadIdleHdl_Impl( m_pLoadIdle.get() );
513  }
514 
515  bool bModified = false;
516  bool bCompareOldBrush = true;
517  sal_uInt16 nSlot = SID_ATTR_BRUSH;
518 
519  if (m_xTblLBox->get_visible())
520  {
521  switch (m_xTblLBox->get_active())
522  {
523  case TBL_DEST_CELL:
524  nSlot = SID_ATTR_BRUSH;
525  break;
526  case TBL_DEST_ROW:
527  nSlot = SID_ATTR_BRUSH_ROW;
528  break;
529  case TBL_DEST_TBL:
530  nSlot = SID_ATTR_BRUSH_TABLE;
531  break;
532  }
533  }
534  else if( bHighlighting )
535  {
536  nSlot = SID_ATTR_BRUSH_CHAR;
537  }
538  else if( bCharBackColor )
539  {
540  nSlot = SID_ATTR_CHAR_BACK_COLOR;
541  bCompareOldBrush = false;
542  }
543 
544  sal_uInt16 nWhich = GetWhich( nSlot );
545 
546  const SfxPoolItem* pOld = GetOldItem(*rCoreSet, nSlot);
547  if (pOld && bCompareOldBrush)
548  {
549  SfxItemState eOldItemState = rCoreSet->GetItemState(nSlot, false);
550  const SfxItemSet& rOldSet = GetItemSet();
551  const SvxBrushItem& rOldItem = static_cast<const SvxBrushItem&>(*pOld);
552 
553  SvxGraphicPosition eOldPos = rOldItem.GetGraphicPos();
554  const bool bIsBrush = ( drawing::FillStyle_SOLID == lcl_getFillStyle(*m_xLbSelect) );
555 
556  if ( ( (GPOS_NONE == eOldPos) && bIsBrush )
557  || ( (GPOS_NONE != eOldPos) && !bIsBrush ) ) // Brush <-> Bitmap changed?
558  {
559  // background art hasn't been changed:
560 
561  if (GPOS_NONE == eOldPos || !m_xLbSelect->get_visible())
562  {
563  // Brush-treatment:
564  if ( rOldItem.GetColor() != aBgdColor ||
565  (SfxItemState::DEFAULT >= eOldItemState && m_bColorSelected))
566  {
567  bModified = true;
568  rCoreSet->Put( SvxBrushItem( aBgdColor, nWhich ) );
569  }
570  else if ( SfxItemState::DEFAULT == rOldSet.GetItemState( nWhich, false ) )
571  rCoreSet->ClearItem( nWhich );
572  }
573  else
574  {
575  // Bitmap-treatment:
576 
578  const bool bIsLink = m_xBtnLink->get_active();
579  const bool bWasLink = !rOldItem.GetGraphicLink().isEmpty();
580 
581 
582  if ( !bIsLink && !bIsGraphicValid )
584 
585  bool bModifyBrush = false;
586  if (eNewPos != eOldPos || bIsLink != bWasLink)
587  bModifyBrush = true;
588  else if (bWasLink && rOldItem.GetGraphicLink() != aBgdGraphicPath)
589  bModifyBrush = true;
590  else if (!bWasLink)
591  {
592  const Graphic* pGraphic = rOldItem.GetGraphic();
593  if (pGraphic)
594  bModifyBrush = pGraphic->GetBitmapEx() != aBgdGraphic.GetBitmapEx();
595  }
596  if (bModifyBrush)
597  {
598  bModified = true;
599  std::unique_ptr<SvxBrushItem> aTmpBrush;
600 
601  if ( bIsLink )
602  {
603  aTmpBrush.reset(new SvxBrushItem( aBgdGraphicPath,
605  eNewPos,
606  nWhich ));
607  }
608  else
609  {
610  aTmpBrush.reset(new SvxBrushItem( aBgdGraphic,
611  eNewPos,
612  nWhich ));
613  }
614 
615  rCoreSet->Put(*aTmpBrush);
616  }
617  else if ( SfxItemState::DEFAULT == rOldSet.GetItemState( nWhich, false ) )
618  rCoreSet->ClearItem( nWhich );
619  }
620  }
621  else // Brush <-> Bitmap changed!
622  {
623  if ( bIsBrush )
624  {
625  rCoreSet->Put( SvxBrushItem( aBgdColor, nWhich ) );
626  }
627  else
628  {
629  std::unique_ptr<SvxBrushItem> pTmpBrush;
630  if ( m_xBtnLink->get_active() )
631  {
632  pTmpBrush.reset(new SvxBrushItem( aBgdGraphicPath,
635  nWhich ));
636  }
637  else
638  {
639  if ( !bIsGraphicValid )
641 
642  if ( bIsGraphicValid )
643  pTmpBrush.reset(new SvxBrushItem( aBgdGraphic,
645  nWhich ));
646  }
647  if(pTmpBrush)
648  {
649  rCoreSet->Put(*pTmpBrush);
650  }
651  }
652  bModified = ( bIsBrush || m_xBtnLink->get_active() || bIsGraphicValid );
653  }
654  }
655  else if (pOld && SID_ATTR_CHAR_BACK_COLOR == nSlot)
656  {
657  SfxItemState eOldItemState = rCoreSet->GetItemState(nSlot, false);
658  const SfxItemSet& rOldSet = GetItemSet();
659  const SvxBackgroundColorItem& rOldItem = static_cast<const SvxBackgroundColorItem&>(*pOld);
660 
661  // Brush-treatment:
662  if ( rOldItem.GetValue() != aBgdColor ||
663  (SfxItemState::DEFAULT >= eOldItemState && m_bColorSelected))
664  {
665  bModified = true;
666  rCoreSet->Put(SvxBackgroundColorItem(aBgdColor, nWhich));
667  }
668  else if ( SfxItemState::DEFAULT == rOldSet.GetItemState( nWhich, false ) )
669  rCoreSet->ClearItem( nWhich );
670  }
671  else if ( SID_ATTR_BRUSH_CHAR == nSlot && aBgdColor != COL_WHITE )
672  {
673  rCoreSet->Put( SvxBrushItem( aBgdColor, nWhich ) );
674  bModified = true;
675  }
676 
677  if (m_xTblLBox->get_visible())
678  {
679  // the current condition has already been put
680  if( nSlot != SID_ATTR_BRUSH && m_pCellBrush)
681  {
682  const SfxPoolItem* pOldCell =
683  GetOldItem( *rCoreSet, SID_ATTR_BRUSH );
684 
685  if ( *m_pCellBrush != *pOldCell )
686  {
687  rCoreSet->Put( *m_pCellBrush );
688  bModified = true;
689  }
690  }
691 
692  if( nSlot != SID_ATTR_BRUSH_ROW && m_pRowBrush)
693  {
694  const SfxPoolItem* pOldRow =
695  GetOldItem( *rCoreSet, SID_ATTR_BRUSH_ROW );
696 
697  if ( *m_pRowBrush != *pOldRow )
698  {
699  rCoreSet->Put( *m_pRowBrush );
700  bModified = true;
701  }
702  }
703 
704  if( nSlot != SID_ATTR_BRUSH_TABLE && m_pTableBrush)
705  {
706  const SfxPoolItem* pOldTable =
707  GetOldItem( *rCoreSet, SID_ATTR_BRUSH_TABLE );
708 
709  if ( *m_pTableBrush != *pOldTable )
710  {
711  rCoreSet->Put( *m_pTableBrush );
712  bModified = true;
713  }
714  }
715 
716  if (m_xTblLBox->get_value_changed_from_saved())
717  {
718  rCoreSet->Put(SfxUInt16Item(SID_BACKGRND_DESTINATION,
719  m_xTblLBox->get_active()));
720  bModified = true;
721  }
722  }
723  else if( bHighlighting )
724  {
725  if( nSlot != SID_ATTR_BRUSH_CHAR )
726  {
727  const SfxPoolItem* pOldChar =
728  GetOldItem( *rCoreSet, SID_ATTR_BRUSH_CHAR );
729  if ( pOldChar && pHighlighting &&
730  (*pHighlighting != *pOldChar || *pHighlighting != SvxBrushItem(SID_ATTR_BRUSH_CHAR)))
731  {
732  rCoreSet->Put( *pHighlighting );
733  bModified = true;
734  }
735  }
736  }
737  return bModified;
738 }
739 
742 {
744  return DeactivateRC::KeepPage;
745 
746  if ( _pSet )
747  FillItemSet( _pSet );
748 
749  return DeactivateRC::LeavePage;
750 }
751 
753 {
754  // has to be implemented so that position control can work
755 }
756 
758 {
759  if( bAllowShowSelector)
760  {
761  m_xAsGrid->show();
762  m_xSelectTxt->show();
763  m_xLbSelect->show();
764  m_xLbSelect->connect_changed(HDL(SelectHdl_Impl));
765  m_xBtnLink->connect_toggled(HDL(FileClickHdl_Impl));
766  m_xBtnPreview->connect_toggled(HDL(FileClickHdl_Impl));
767  m_xBtnBrowse->connect_clicked(HDL(BrowseHdl_Impl));
768  m_xBtnArea->connect_toggled(HDL(RadioClickHdl_Impl));
769  m_xBtnTile->connect_toggled(HDL(RadioClickHdl_Impl));
770  m_xBtnPosition->connect_toggled(HDL(RadioClickHdl_Impl));
771 
772  // delayed loading via timer (because of UI-Update)
773  m_pLoadIdle.reset( new Idle("DelayedLoad") );
774  m_pLoadIdle->SetPriority( TaskPriority::LOWEST );
775  m_pLoadIdle->SetInvokeHandler(
776  LINK( this, SvxBackgroundTabPage, LoadIdleHdl_Impl ) );
777 
778  bAllowShowSelector = false;
779 
780  if (nHtmlMode & HTMLMODE_ON)
781  {
782  m_xBtnArea->set_sensitive(false);
783  }
784  }
785 }
786 
788 {
790  OUString(),
791  GetDialogFrameWeld(),
793  SvxResLocale() );
794 
797  aBgdGraphicPath ) );
798 }
799 
801 {
802  bool bResult = ( !aBgdGraphicPath.isEmpty() ) &&
805  aBgdGraphic ) );
806  return bResult;
807 }
808 
810 {
812  const SfxPoolItem* pItem = nullptr;
813  XColorListRef pColorTable;
814  if ( pDocSh && ( nullptr != ( pItem = pDocSh->GetItem( SID_COLOR_TABLE ) ) ) )
815  {
816  pColorTable = static_cast<const SvxColorListItem*>(pItem)->GetColorList();
817  }
818 
819  if ( !pColorTable.is() )
820  pColorTable = XColorList::CreateStdColorList();
821 
822  if ( pColorTable.is() )
823  {
824  m_xBackgroundColorSet->Clear();
825  m_xBackgroundColorSet->addEntriesForXColorList(*pColorTable);
826  }
827 
829  m_xBackgroundColorSet->SetStyle(nBits);
831 }
832 
837 {
838  if (!m_xBackGroundColorFrame->get_visible())
839  {
841  m_xBackGroundColorFrame->show();
842  }
843 }
844 
846 {
847  m_xBackGroundColorFrame->hide();
848 }
849 
854 {
855  if (m_xLbSelect->get_visible() &&
856  (m_xBackGroundColorFrame->get_visible() || !m_xFileFrame->get_visible()))
857  {
859 
860  m_xBitmapContainer->show();
861  m_xFileFrame->show();
862  m_xBtnLink->set_visible(!(nHtmlMode & HTMLMODE_ON));
863  m_xTypeFrame->show();
864  m_xPreviewWin2->show();
865  m_xBtnPreview->show();
866  }
867 }
868 
870 {
871  m_xBitmapContainer->hide();
872  m_xFileFrame->hide();
873  m_xTypeFrame->hide();
874  m_xPreviewWin2->hide();
875  m_xBtnPreview->hide();
876 }
877 
879 {
880  switch ( ePos )
881  {
882  case GPOS_AREA:
883  {
884  m_xBtnArea->set_active(true);
885  m_xWndPositionWin->set_sensitive(false);
886  }
887  break;
888 
889  case GPOS_TILED:
890  {
891  m_xBtnTile->set_active(true);
892  m_xWndPositionWin->set_sensitive(false);
893  }
894  break;
895 
896  default:
897  {
898  m_xBtnPosition->set_active(true);
899  m_xWndPositionWin->set_sensitive(true);
900  RectPoint eNewPos = RectPoint::MM;
901 
902  switch ( ePos )
903  {
904  case GPOS_MM: break;
905  case GPOS_LT: eNewPos = RectPoint::LT; break;
906  case GPOS_MT: eNewPos = RectPoint::MT; break;
907  case GPOS_RT: eNewPos = RectPoint::RT; break;
908  case GPOS_LM: eNewPos = RectPoint::LM; break;
909  case GPOS_RM: eNewPos = RectPoint::RM; break;
910  case GPOS_LB: eNewPos = RectPoint::LB; break;
911  case GPOS_MB: eNewPos = RectPoint::MB; break;
912  case GPOS_RB: eNewPos = RectPoint::RB; break;
913  default: ;//prevent warning
914  }
915  m_xWndPosition->SetActualRP( eNewPos );
916  }
917  break;
918  }
919  m_xWndPosition->Invalidate();
920 }
921 
923 {
924  if (m_xBtnTile->get_active())
925  return GPOS_TILED;
926  else if (m_xBtnArea->get_active())
927  return GPOS_AREA;
928  else
929  {
930  switch (m_xWndPosition->GetActualRP())
931  {
932  case RectPoint::LT: return GPOS_LT;
933  case RectPoint::MT: return GPOS_MT;
934  case RectPoint::RT: return GPOS_RT;
935  case RectPoint::LM: return GPOS_LM;
936  case RectPoint::MM: return GPOS_MM;
937  case RectPoint::RM: return GPOS_RM;
938  case RectPoint::LB: return GPOS_LB;
939  case RectPoint::MB: return GPOS_MB;
940  case RectPoint::RB: return GPOS_RB;
941  }
942  }
943  return GPOS_MM;
944 }
945 
946 
947 // Handler
948 
950 IMPL_LINK_NOARG(SvxBackgroundTabPage, BackgroundColorHdl_Impl, SvtValueSet*, void)
951 {
952  sal_uInt16 nItemId = m_xBackgroundColorSet->GetSelectedItemId();
953  Color aColor = nItemId ? ( m_xBackgroundColorSet->GetItemColor( nItemId ) ) : COL_TRANSPARENT;
954  aBgdColor = aColor;
955  m_bColorSelected = true;
956  m_xPreview1->NotifyChange( aBgdColor );
957 }
958 
960 {
961  if ( drawing::FillStyle_SOLID == lcl_getFillStyle(*m_xLbSelect) )
962  {
963  ShowColorUI_Impl();
964  }
965  else
966  {
967  ShowBitmapUI_Impl();
968  }
969 }
970 
971 IMPL_LINK(SvxBackgroundTabPage, FileClickHdl_Impl, weld::ToggleButton&, rBox, void)
972 {
973  if (m_xBtnLink.get() == &rBox)
974  {
975  if (m_xBtnLink->get_active())
976  {
977  m_xFtUnlinked->hide();
978  INetURLObject aObj( aBgdGraphicPath );
979  OUString aFilePath;
980  if ( aObj.GetProtocol() == INetProtocol::File )
981  aFilePath = aObj.getFSysPath( FSysStyle::Detect );
982  else
983  aFilePath = aBgdGraphicPath;
984  m_xFtFile->set_label(aFilePath);
985  m_xFtFile->show();
986  }
987  else
988  {
989  m_xFtUnlinked->show();
990  m_xFtFile->hide();
991  }
992  }
993  else if (m_xBtnPreview.get() == &rBox)
994  {
995  if (m_xBtnPreview->get_active())
996  {
997  if ( !bIsGraphicValid )
998  bIsGraphicValid = LoadLinkedGraphic_Impl();
999 
1000  if ( bIsGraphicValid )
1001  {
1002  BitmapEx aBmp = aBgdGraphic.GetBitmapEx();
1003  m_xPreview2->NotifyChange( &aBmp );
1004  }
1005  else
1006  {
1007  if ( !aBgdGraphicPath.isEmpty() ) // only for linked bitmap
1008  RaiseLoadError_Impl();
1009  m_xPreview2->NotifyChange( nullptr );
1010  }
1011  }
1012  else
1013  m_xPreview2->NotifyChange( nullptr );
1014  }
1015 }
1016 
1017 IMPL_LINK(SvxBackgroundTabPage, RadioClickHdl_Impl, weld::ToggleButton&, rBtn, void)
1018 {
1019  if (&rBtn == m_xBtnPosition.get())
1020  {
1021  if (!m_xWndPositionWin->get_sensitive())
1022  {
1023  m_xWndPositionWin->set_sensitive(true);
1024  m_xWndPositionWin->queue_draw();
1025  }
1026  }
1027  else if (m_xWndPositionWin->get_sensitive())
1028  {
1029  m_xWndPositionWin->set_sensitive(false);
1030  m_xWndPositionWin->queue_draw();
1031  }
1032 }
1033 
1038 {
1039  if ( m_pLoadIdle->IsActive() )
1040  return;
1041  bool bHtml = 0 != ( nHtmlMode & HTMLMODE_ON );
1042 
1043  OUString aStrBrowse(m_xFindGraphicsFt->get_label());
1044  pImportDlg.reset(new SvxOpenGraphicDialog(aStrBrowse, GetDialogFrameWeld()));
1045  if ( bHtml )
1046  pImportDlg->EnableLink(false);
1047  pImportDlg->SetPath(aBgdGraphicPath, m_xBtnLink->get_active());
1048 
1049  m_bIsImportDlgInExecute = true;
1050  ErrCode nErr = pImportDlg->Execute();
1051  m_bIsImportDlgInExecute = false;
1052 
1053  if( !nErr )
1054  {
1055  if (bHtml)
1056  m_xBtnLink->set_active(true);
1057  // if link isn't checked and preview isn't, either,
1058  // activate preview, so that the user sees which
1059  // graphic he has chosen
1060  if (!m_xBtnLink->get_active() && !m_xBtnPreview->get_active())
1061  m_xBtnPreview->set_active(true);
1062  // timer-delayed loading of the graphic
1063  m_pLoadIdle->Start();
1064  }
1065  else
1066  pImportDlg.reset();
1067 }
1068 
1073 IMPL_LINK( SvxBackgroundTabPage, LoadIdleHdl_Impl, Timer*, pIdle, void )
1074 {
1075  if ( pIdle == m_pLoadIdle.get() )
1076  {
1077  m_pLoadIdle->Stop();
1078 
1079  if ( pImportDlg )
1080  {
1081  INetURLObject aOld( aBgdGraphicPath );
1082  INetURLObject aNew( pImportDlg->GetPath() );
1083  if ( aBgdGraphicPath.isEmpty() || aNew != aOld )
1084  {
1085  // new file chosen
1086  aBgdGraphicPath = pImportDlg->GetPath();
1087  aBgdGraphicFilter = pImportDlg->GetDetectedFilter();
1088  bool bLink = ( nHtmlMode & HTMLMODE_ON ) || pImportDlg->IsAsLink();
1089  m_xBtnLink->set_active(bLink);
1090  m_xBtnLink->set_sensitive(true);
1091 
1092  if (m_xBtnPreview->get_active())
1093  {
1094  if( !pImportDlg->GetGraphic(aBgdGraphic) )
1095  {
1096  bIsGraphicValid = true;
1097  }
1098  else
1099  {
1100  aBgdGraphicFilter.clear();
1101  aBgdGraphicPath.clear();
1102  bIsGraphicValid = false;
1103  }
1104  }
1105  else
1106  bIsGraphicValid = false; // load graphic not until preview click
1107 
1108  if (m_xBtnPreview->get_active() && bIsGraphicValid)
1109  {
1110  BitmapEx aBmp = aBgdGraphic.GetBitmapEx();
1111  m_xPreview2->NotifyChange( &aBmp );
1112  }
1113  else
1114  m_xPreview2->NotifyChange( nullptr );
1115  }
1116 
1117  FileClickHdl_Impl(*m_xBtnLink);
1118  pImportDlg.reset();
1119  }
1120  }
1121 }
1122 
1124 {
1125  m_xTblLBox->connect_changed(HDL(TblDestinationHdl_Impl));
1126  m_xTblLBox->set_active(0);
1127  m_xTblDesc->show();
1128  m_xTblLBox->show();
1129  m_xAsGrid->show();
1130 }
1131 
1132 IMPL_LINK(SvxBackgroundTabPage, TblDestinationHdl_Impl, weld::ComboBox&, rBox, void)
1133 {
1134  int nSelPos = rBox.get_active();
1135  if( m_nActPos != nSelPos)
1136  {
1137  std::unique_ptr<SvxBrushItem> xItemHolder;
1138  std::unique_ptr<SvxBrushItem>* pActItem = nullptr;
1139  sal_uInt16 nWhich = 0;
1140  switch(m_nActPos)
1141  {
1142  case TBL_DEST_CELL:
1143  pActItem = &m_pCellBrush;
1144  nWhich = m_nCellWhich;
1145  break;
1146  case TBL_DEST_ROW:
1147  pActItem = &m_pRowBrush;
1148  nWhich = m_nRowWhich;
1149  break;
1150  case TBL_DEST_TBL:
1151  pActItem = &m_pTableBrush;
1152  nWhich = m_nTableWhich;
1153  break;
1154  default:
1155  pActItem = nullptr;
1156  break;
1157  }
1158  m_nActPos = nSelPos;
1159  if(!pActItem)
1160  {
1161  xItemHolder.reset(new SvxBrushItem(nWhich));
1162  pActItem = &xItemHolder;
1163  }
1164  if(drawing::FillStyle_SOLID == lcl_getFillStyle(*m_xLbSelect)) // brush selected
1165  {
1166  *pActItem = std::make_unique<SvxBrushItem>(aBgdColor, nWhich);
1167  }
1168  else
1169  {
1170  SvxGraphicPosition eNewPos = GetGraphicPosition_Impl();
1171  const bool bIsLink = m_xBtnLink->get_active();
1172 
1173  if ( !bIsLink && !bIsGraphicValid )
1174  bIsGraphicValid = LoadLinkedGraphic_Impl();
1175 
1176  if ( bIsLink )
1177  {
1178  *pActItem = std::make_unique<SvxBrushItem>( aBgdGraphicPath,
1179  aBgdGraphicFilter,
1180  eNewPos,
1181  (*pActItem)->Which() );
1182  }
1183  else
1184  {
1185  *pActItem = std::make_unique<SvxBrushItem>( aBgdGraphic,
1186  eNewPos,
1187  (*pActItem)->Which() );
1188  }
1189  }
1190  switch(nSelPos)
1191  {
1192  case TBL_DEST_CELL:
1193  pActItem = &m_pCellBrush;
1194  m_xLbSelect->set_sensitive(true);
1195  nWhich = m_nCellWhich;
1196  break;
1197  case TBL_DEST_ROW:
1198  pActItem = &m_pRowBrush;
1199  nWhich = m_nRowWhich;
1200  break;
1201  case TBL_DEST_TBL:
1202  pActItem = &m_pTableBrush;
1203  m_xLbSelect->set_sensitive(true);
1204  nWhich = m_nTableWhich;
1205  break;
1206  default:
1207  // The item will be new'ed again below, but that will be the
1208  // default item then, not an existing modified one.
1209  xItemHolder.reset();
1210  pActItem = nullptr;
1211  break;
1212  }
1213  OUString aUserData = GetUserData();
1214  if (!pActItem)
1215  {
1216  xItemHolder.reset(new SvxBrushItem(nWhich));
1217  pActItem = &xItemHolder;
1218  }
1219  FillControls_Impl(**pActItem, aUserData);
1220  }
1221 }
1222 
1224  const OUString& rUserData )
1225 {
1226  SvxGraphicPosition ePos = rBgdAttr.GetGraphicPos();
1227  const Color& rColor = rBgdAttr.GetColor();
1228 
1229  if (GPOS_NONE == ePos || !m_xLbSelect->get_visible())
1230  {
1231  lcl_setFillStyle(*m_xLbSelect, drawing::FillStyle_SOLID);
1232  ShowColorUI_Impl();
1233  Color aTrColor( COL_TRANSPARENT );
1234  aBgdColor = rColor;
1235 
1236  sal_uInt16 nCol = ( aTrColor != aBgdColor ) ?
1238 
1239  if( aTrColor != aBgdColor && nCol == 0)
1240  {
1241  m_xBackgroundColorSet->SetNoSelection();
1242  }
1243  else
1244  {
1245  m_xBackgroundColorSet->SelectItem( nCol );
1246  }
1247 
1248  m_xPreview1->NotifyChange( aBgdColor );
1249 
1250  if (m_xLbSelect->get_visible()) // initialize graphic part
1251  {
1252  aBgdGraphicFilter.clear();
1253  aBgdGraphicPath.clear();
1254 
1255  if ( rUserData.isEmpty() )
1256  m_xBtnPreview->set_active(false);
1257  m_xBtnLink->set_active(false);
1258  m_xBtnLink->set_sensitive(false);
1259  m_xPreview2->NotifyChange(nullptr);
1260  SetGraphicPosition_Impl( GPOS_TILED ); // tiles as default
1261  }
1262  }
1263  else
1264  {
1265  const OUString& aStrLink = rBgdAttr.GetGraphicLink();
1266  const OUString& aStrFilter = rBgdAttr.GetGraphicFilter();
1267 
1268  lcl_setFillStyle(*m_xLbSelect, drawing::FillStyle_BITMAP);
1270 
1271  if ( !aStrLink.isEmpty() )
1272  {
1273 #ifdef DBG_UTIL
1274  INetURLObject aObj( aStrLink );
1275  DBG_ASSERT( aObj.GetProtocol() != INetProtocol::NotValid, "Invalid URL!" );
1276 #endif
1277  aBgdGraphicPath = aStrLink;
1278  m_xBtnLink->set_active(true);
1279  m_xBtnLink->set_sensitive(true);
1280  }
1281  else
1282  {
1283  aBgdGraphicPath.clear();
1284  m_xBtnLink->set_active(false);
1285  m_xBtnLink->set_sensitive(false);
1286  }
1287 
1288  FileClickHdl_Impl(*m_xBtnLink);
1289 
1290  aBgdGraphicFilter = aStrFilter;
1291 
1292  if (aStrLink.isEmpty() || m_xBtnPreview->get_active())
1293  {
1294  // Graphic exists in the item and doesn't have
1295  // to be loaded:
1296 
1297  const Graphic* pGraphic = rBgdAttr.GetGraphic();
1298 
1299  if (!pGraphic && m_xBtnPreview->get_active())
1301  else if ( pGraphic )
1302  {
1303  aBgdGraphic = *pGraphic;
1304  bIsGraphicValid = true;
1305 
1306  if (rUserData.isEmpty())
1307  m_xBtnPreview->set_active(true);
1308  }
1309  else
1310  {
1312  bIsGraphicValid = false;
1313 
1314  if ( rUserData.isEmpty() )
1315  m_xBtnPreview->set_active(false);
1316  }
1317  }
1318 
1319  if (m_xBtnPreview->get_active() && bIsGraphicValid)
1320  {
1321  BitmapEx aBmp = aBgdGraphic.GetBitmapEx();
1322  m_xPreview2->NotifyChange( &aBmp );
1323  }
1324  else
1325  m_xPreview2->NotifyChange( nullptr );
1326 
1327  SetGraphicPosition_Impl( ePos );
1328  }
1329 }
1330 
1332 {
1333  const SfxUInt32Item* pFlagItem = aSet.GetItem<SfxUInt32Item>(SID_FLAG_TYPE, false);
1334 
1335  if (pFlagItem)
1336  {
1337  SvxBackgroundTabFlags nFlags = static_cast<SvxBackgroundTabFlags>(pFlagItem->GetValue());
1338  if (nFlags & SvxBackgroundTabFlags::SHOW_TBLCTL )
1339  ShowTblControl();
1340  if ( nFlags & SvxBackgroundTabFlags::SHOW_SELECTOR )
1341  {
1342  ShowSelector();
1343  }
1344  if ((nFlags & SvxBackgroundTabFlags::SHOW_HIGHLIGHTING) ||
1345  (nFlags & SvxBackgroundTabFlags::SHOW_CHAR_BKGCOLOR))
1346  {
1347  m_xBackGroundColorLabelFT->set_label(CuiResId(RID_SVXSTR_CHARNAME_HIGHLIGHTING));
1348  bHighlighting = bool(nFlags & SvxBackgroundTabFlags::SHOW_HIGHLIGHTING);
1349  bCharBackColor = bool(nFlags & SvxBackgroundTabFlags::SHOW_CHAR_BKGCOLOR);
1350  }
1351  }
1352 }
1353 
1354 static sal_uInt16 lcl_GetTableDestSlot(sal_Int32 nTblDest)
1355 {
1356  switch (nTblDest)
1357  {
1358  default:
1359  case TBL_DEST_CELL:
1360  {
1361  return SID_ATTR_BRUSH;
1362  }
1363  case TBL_DEST_ROW:
1364  {
1365  return SID_ATTR_BRUSH_ROW;
1366  }
1367  case TBL_DEST_TBL:
1368  {
1369  return SID_ATTR_BRUSH_TABLE;
1370  }
1371  }
1372 }
1373 
1375  : SvxAreaTabPage(pParent, rInAttrs),
1376  bHighlighting(false),
1377  bCharBackColor(false),
1378  maSet(rInAttrs)
1379 {
1380  m_xBtnGradient->hide();
1381  m_xBtnHatch->hide();
1382  m_xBtnBitmap->hide();
1383  m_xBtnPattern->hide();
1384 
1386  const SfxPoolItem* pItem = nullptr;
1387 
1388  XColorListRef pColorTable;
1389  if ( pDocSh && ( nullptr != ( pItem = pDocSh->GetItem( SID_COLOR_TABLE ) ) ) )
1390  {
1391  pColorTable = static_cast<const SvxColorListItem*>(pItem)->GetColorList();
1392  }
1393 
1394  if ( !pColorTable.is() )
1395  pColorTable = XColorList::CreateStdColorList();
1396 
1397  XBitmapListRef pBitmapList;
1398  if ( pDocSh && ( nullptr != ( pItem = pDocSh->GetItem( SID_BITMAP_LIST ) ) ) )
1399  {
1400  pBitmapList = static_cast<const SvxBitmapListItem*>(pItem)->GetBitmapList();
1401  }
1402 
1403  SetColorList(pColorTable);
1404  SetBitmapList(pBitmapList);
1405 }
1406 
1408 {
1409  disposeOnce();
1410 }
1411 
1413 {
1414  m_xTblLBox.reset();
1416 }
1417 
1419 {
1421 }
1422 
1424 {
1425  if ( DeactivateRC::KeepPage == SvxAreaTabPage::DeactivatePage( &maSet ) )
1426  return DeactivateRC::KeepPage;
1427 
1428  if ( _pSet )
1429  FillItemSet( _pSet );
1430 
1431  return DeactivateRC::LeavePage;
1432 }
1433 
1435 {
1436  maSet.Set( *m_pResetSet.get() );
1437  if ( m_xTblLBox && m_xTblLBox->get_visible() )
1438  {
1439  m_nActPos = -1;
1440  const SfxPoolItem* pItem;
1441  if ( SfxItemState::SET == m_pResetSet->GetItemState( SID_BACKGRND_DESTINATION, false, &pItem ) )
1442  {
1443  sal_uInt16 nDestValue = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
1444  m_xTblLBox->set_active( nDestValue );
1445  TblDestinationHdl_Impl( *m_xTblLBox );
1446  }
1447  m_xTblLBox->save_value();
1448  }
1450 }
1451 
1453 {
1454  sal_uInt16 nSlot = SID_ATTR_BRUSH;
1455  if (m_xTblLBox && m_xTblLBox->get_visible())
1456  nSlot = lcl_GetTableDestSlot(m_xTblLBox->get_active());
1457  else if ( bHighlighting )
1458  nSlot = SID_ATTR_BRUSH_CHAR;
1459  else if( bCharBackColor )
1460  nSlot = SID_ATTR_CHAR_BACK_COLOR;
1461 
1462  sal_uInt16 nWhich = GetWhich(nSlot);
1463 
1464  drawing::FillStyle eFillType = maSet.Get( XATTR_FILLSTYLE ).GetValue();
1465  switch( eFillType )
1466  {
1467  case drawing::FillStyle_NONE:
1468  {
1469  if ( IsBtnClicked() )
1470  {
1471  if ( SID_ATTR_CHAR_BACK_COLOR == nSlot )
1472  {
1474  rCoreSet->Put( SvxBackgroundColorItem( COL_TRANSPARENT, nWhich ) );
1475  }
1476  else
1477  {
1478  maSet.Put( SvxBrushItem( COL_TRANSPARENT, nWhich ) );
1479  rCoreSet->Put( SvxBrushItem( COL_TRANSPARENT, nWhich ) );
1480  }
1481  }
1482  break;
1483  }
1484  case drawing::FillStyle_SOLID:
1485  {
1486  XFillColorItem aColorItem( maSet.Get( XATTR_FILLCOLOR ) );
1487  if ( SID_ATTR_CHAR_BACK_COLOR == nSlot )
1488  {
1489  maSet.Put( SvxBackgroundColorItem( aColorItem.GetColorValue(), nWhich ) );
1490  rCoreSet->Put( SvxBackgroundColorItem( aColorItem.GetColorValue(), nWhich ) );
1491  }
1492  else
1493  {
1494  maSet.Put( SvxBrushItem( aColorItem.GetColorValue(), nWhich ) );
1495  rCoreSet->Put( SvxBrushItem( aColorItem.GetColorValue(), nWhich ) );
1496  }
1497  break;
1498  }
1499  case drawing::FillStyle_BITMAP:
1500  {
1501  std::shared_ptr<SvxBrushItem> aBrushItem( getSvxBrushItemFromSourceSet( maSet, nWhich ) );
1502  if ( GraphicType::NONE != aBrushItem->GetGraphicObject()->GetType() )
1503  rCoreSet->Put( *aBrushItem );
1504  break;
1505  }
1506  default:
1507  break;
1508  }
1509 
1510  if (m_xTblLBox && m_xTblLBox->get_visible())
1511  {
1512  if (nSlot != SID_ATTR_BRUSH)
1513  {
1514  nWhich = maSet.GetPool()->GetWhich(SID_ATTR_BRUSH);
1515  if (SfxItemState::SET == maSet.GetItemState(nWhich))
1516  {
1517  SvxBrushItem aBrushItem(static_cast<const SvxBrushItem&>(maSet.Get(nWhich)));
1518  rCoreSet->Put(aBrushItem);
1519  }
1520  }
1521  if (nSlot != SID_ATTR_BRUSH_ROW)
1522  {
1523  nWhich = maSet.GetPool()->GetWhich(SID_ATTR_BRUSH_ROW);
1524  if (SfxItemState::SET == maSet.GetItemState(nWhich))
1525  {
1526  SvxBrushItem aBrushItem(static_cast<const SvxBrushItem&>(maSet.Get(nWhich)));
1527  rCoreSet->Put(aBrushItem);
1528  }
1529  }
1530  if (nSlot != SID_ATTR_BRUSH_TABLE)
1531  {
1532  nWhich = maSet.GetPool()->GetWhich(SID_ATTR_BRUSH_TABLE);
1533  if (SfxItemState::SET == maSet.GetItemState(nWhich))
1534  {
1535  SvxBrushItem aBrushItem(static_cast<const SvxBrushItem&>(maSet.Get(nWhich)));
1536  rCoreSet->Put(aBrushItem);
1537  }
1538  }
1539 
1540  if (m_xTblLBox->get_value_changed_from_saved())
1541  {
1542  rCoreSet->Put(SfxUInt16Item(SID_BACKGRND_DESTINATION, m_xTblLBox->get_active()));
1543  }
1544  }
1545 
1546  return true;
1547 }
1548 
1550 {
1551  auto xRet = VclPtr<SvxBkgTabPage>::Create(pWindow, *rAttrs);
1552  xRet->SetOptimalSize(pWindow.pController);
1553  return xRet;
1554 }
1555 
1557 {
1558  const SfxUInt32Item* pFlagItem = aSet.GetItem<SfxUInt32Item>(SID_FLAG_TYPE, false);
1559  if (pFlagItem)
1560  {
1561  SvxBackgroundTabFlags nFlags = static_cast<SvxBackgroundTabFlags>(pFlagItem->GetValue());
1562  if ( nFlags & SvxBackgroundTabFlags::SHOW_TBLCTL )
1563  {
1564  m_xBtnBitmap->show();
1565  m_xTblLBox = m_xBuilder->weld_combo_box("tablelb");
1566  m_xTblLBox->connect_changed(LINK(this, SvxBkgTabPage, TblDestinationHdl_Impl));
1567  m_xTblLBox->show();
1568  }
1569  if ((nFlags & SvxBackgroundTabFlags::SHOW_HIGHLIGHTING) ||
1570  (nFlags & SvxBackgroundTabFlags::SHOW_CHAR_BKGCOLOR))
1571  {
1572  bHighlighting = bool(nFlags & SvxBackgroundTabFlags::SHOW_HIGHLIGHTING);
1573  bCharBackColor = bool(nFlags & SvxBackgroundTabFlags::SHOW_CHAR_BKGCOLOR);
1574  }
1575  if (nFlags & SvxBackgroundTabFlags::SHOW_SELECTOR)
1576  m_xBtnBitmap->show();
1578  }
1579 
1580  if ( bCharBackColor )
1581  {
1582  sal_uInt16 nWhich(maSet.GetPool()->GetWhich(SID_ATTR_CHAR_BACK_COLOR));
1583  Color aBackColor(static_cast<const SvxBackgroundColorItem&>(maSet.Get(nWhich)).GetValue());
1584  SvxBrushItem aBrushItem(SvxBrushItem(aBackColor, SID_ATTR_BRUSH_CHAR));
1586  }
1587  else
1588  {
1589  sal_uInt16 nWhich(maSet.GetPool()->GetWhich(bHighlighting ? SID_ATTR_BRUSH_CHAR : SID_ATTR_BRUSH));
1590  SvxBrushItem aBrushItem(static_cast<const SvxBrushItem&>(maSet.Get(nWhich)));
1592  }
1593 
1594  m_pResetSet = maSet.Clone();
1595 
1597 }
1598 
1599 IMPL_LINK(SvxBkgTabPage, TblDestinationHdl_Impl, weld::ComboBox&, rBox, void)
1600 {
1601  if (m_nActPos > -1)
1602  {
1603  // fill local item set with XATTR_FILL settings gathered from tab page
1604  // and convert to SvxBrushItem and store in table destination slot Which
1606  maSet.Put(*getSvxBrushItemFromSourceSet(maSet, maSet.GetPool()->GetWhich(lcl_GetTableDestSlot(m_nActPos))));
1607  }
1608 
1609  sal_Int32 nSelPos = rBox.get_active();
1610  if (m_nActPos != nSelPos)
1611  {
1612  m_nActPos = nSelPos;
1613 
1614  // fill local item set with XATTR_FILL created from SvxBushItem for table destination slot Which
1615  sal_uInt16 nWhich = maSet.GetPool()->GetWhich(lcl_GetTableDestSlot(nSelPos));
1616  if (SfxItemState::SET == maSet.GetItemState(nWhich))
1617  {
1618  SvxBrushItem aBrushItem(static_cast<const SvxBrushItem&>(maSet.Get(nWhich)));
1619  setSvxBrushItemAsFillAttributesToTargetSet(aBrushItem, maSet);
1620  }
1621  else
1622  {
1623  SelectFillType(*m_xBtnNone, &maSet);
1624  return;
1625  }
1626 
1627  // show tab page
1628  drawing::FillStyle eXFS = drawing::FillStyle_NONE;
1629  if (maSet.GetItemState(XATTR_FILLSTYLE) != SfxItemState::DONTCARE)
1630  {
1631  XFillStyleItem aFillStyleItem(static_cast<const XFillStyleItem&>(maSet.Get(GetWhich( XATTR_FILLSTYLE))));
1632  eXFS = aFillStyleItem.GetValue();
1633  }
1634  switch(eXFS)
1635  {
1636  default:
1637  case drawing::FillStyle_NONE:
1638  {
1639  SelectFillType(*m_xBtnNone, &maSet);
1640  break;
1641  }
1642  case drawing::FillStyle_SOLID:
1643  {
1644  SelectFillType(*m_xBtnColor, &maSet);
1645  // color tab page Active and New preview controls are same after SelectFillType
1646  // hack to restore color tab page Active preview
1647  setSvxBrushItemAsFillAttributesToTargetSet(static_cast<const SvxBrushItem&>(m_pResetSet->Get(nWhich)), *m_pResetSet);
1648  static_cast<SvxColorTabPage*>(GetFillTabPage())->SetCtlPreviewOld(*m_pResetSet);
1649  break;
1650  }
1651  case drawing::FillStyle_BITMAP:
1652  {
1653  SelectFillType(*m_xBtnBitmap, &maSet);
1654  break;
1655  }
1656  }
1657  }
1658 }
1659 
1660 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
IMPL_LINK(SvxBackgroundTabPage, FileClickHdl_Impl, weld::ToggleButton &, rBox, void)
Definition: backgrnd.cxx:971
long Width() const
::tools::Rectangle aDrawRect
Definition: backgrnd.cxx:137
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: backgrnd.cxx:1423
virtual void Paint(vcl::RenderContext &, const ::tools::Rectangle &rRect) override
Definition: backgrnd.cxx:236
std::unique_ptr< weld::ComboBox > m_xTblLBox
Definition: backgrnd.hxx:159
sal_Int32 m_nActPos
Definition: backgrnd.hxx:165
sal_uInt8 GetRed() const
virtual bool FillItemSet(SfxItemSet *) override
Definition: tparea.cxx:277
std::unique_ptr< weld::Label > m_xBackGroundColorLabelFT
Definition: backgrnd.hxx:113
void setBmp(bool bBmp)
Definition: backgrnd.cxx:156
GPOS_RM
long AdjustWidth(long n)
SvxGraphicPosition GetGraphicPosition_Impl()
Definition: backgrnd.cxx:922
bool Set(const SfxItemSet &, bool bDeep=true)
bool bCharBackColor
Definition: backgrnd.hxx:161
OUString aBgdGraphicPath
Definition: backgrnd.hxx:82
std::unique_ptr< BitmapEx > pBitmap
Definition: backgrnd.cxx:134
std::string GetValue
void FillColorValueSets_Impl()
Definition: backgrnd.cxx:809
long Height() const
const OUString & GetGraphicFilter() const
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
static XColorListRef CreateStdColorList()
void DrawBitmapEx(const Point &rDestPt, const BitmapEx &rBitmapEx)
#define ERRCODE_SVX_GRAPHIC_NOTREADABLE
GPOS_NONE
GPOS_LT
#define HDL(hdl)
Definition: backgrnd.cxx:262
std::unique_ptr< SvxBrushItem > m_pRowBrush
Definition: backgrnd.hxx:92
std::unique_ptr< weld::Widget > m_xBackGroundColorFrame
Definition: backgrnd.hxx:114
static sal_uInt16 GetItemId_Impl(const SvtValueSet &rValueSet, const Color &rCol)
Definition: backgrnd.cxx:93
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
std::shared_ptr< SvxBrushItem > getSvxBrushItemFromSourceSet(const SfxItemSet &rSourceSet, sal_uInt16 nBackgroundID, bool bSearchInParents, bool bXMLImportHack)
std::unique_ptr< weld::ToggleButton > m_xBtnHatch
Definition: cuitabarea.hxx:245
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: tparea.cxx:180
std::unique_ptr< weld::CustomWeld > m_xBackgroundColorSetWin
Definition: backgrnd.hxx:132
virtual void Reset(const SfxItemSet *) override
Definition: tparea.cxx:318
std::unique_ptr< weld::Widget > m_xFileFrame
Definition: backgrnd.hxx:120
std::unique_ptr< ColorValueSet > m_xBackgroundColorSet
Definition: backgrnd.hxx:102
virtual void dispose() override
Definition: tparea.cxx:174
static SfxObjectShell * Current()
virtual OUString get_active_id() const =0
void SetColorList(XColorListRef const &pColorList)
Definition: cuitabarea.hxx:282
static drawing::FillStyle lcl_getFillStyle(const weld::ComboBox &rLbSelect)
Returns the fill style of the currently selected entry.
Definition: backgrnd.cxx:74
#define WB_NONEFIELD
bool LoadLinkedGraphic_Impl()
Definition: backgrnd.cxx:800
long AdjustHeight(long n)
css::chart::ChartAxisLabelPosition ePos
virtual int get_count() const =0
Color GetRGBColor() const
Size const & GetOutputSizePixel() const
#define XATTR_FILLCOLOR
virtual bool FillItemSet(SfxItemSet *rSet) override
Definition: backgrnd.cxx:507
sal_uInt16 nHtmlMode
Definition: backgrnd.hxx:75
std::unique_ptr< weld::Widget > m_xTypeFrame
Definition: backgrnd.hxx:126
bool bHighlighting
Definition: backgrnd.hxx:160
GPOS_TILED
static sal_uInt32 getColumnCount()
sal_Int64 WinBits
constexpr::Color COL_TRANSPARENT(0xFF, 0xFF, 0xFF, 0xFF)
void SetBackground()
SvxGraphicPosition GetGraphicPos() const
void RaiseLoadError_Impl()
Definition: backgrnd.cxx:787
static VclPtr< SfxTabPage > Create(TabPageParent, const SfxItemSet *)
Definition: backgrnd.cxx:1549
GPOS_LM
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: backgrnd.cxx:1556
SvxBackgroundTabFlags
OUString SvxResId(const char *pId)
void setX(long nX)
#define WB_ITEMBORDER
std::unique_ptr< Idle > m_pLoadIdle
Definition: backgrnd.hxx:85
SvxBkgTabPage(TabPageParent pParent, const SfxItemSet &rInAttrs)
Definition: backgrnd.cxx:1374
virtual void dispose() override
Definition: backgrnd.cxx:328
std::unique_ptr< weld::ComboBox > m_xLbSelect
Definition: backgrnd.hxx:109
std::unique_ptr< weld::CheckButton > m_xBtnPreview
Definition: backgrnd.hxx:116
const Graphic * GetGraphic(OUString const &referer=OUString()) const
#define ERRCTX_SVX_BACKGROUND
virtual OutputDevice & get_ref_device()=0
void setY(long nY)
std::unique_ptr< weld::RadioButton > m_xBtnTile
Definition: backgrnd.hxx:129
sal_uInt16 m_nTableWhich
Definition: backgrnd.hxx:96
void DrawLine(const Point &rStartPt, const Point &rEndPt)
sal_uInt8 GetBlue() const
void DrawRect(const tools::Rectangle &rRect)
void SetFillColor(const Color &rColor)
Definition: backgrnd.cxx:122
std::unique_ptr< weld::Widget > m_xAsGrid
Definition: backgrnd.hxx:107
bool m_bIsImportDlgInExecute
Definition: backgrnd.hxx:86
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: tparea.cxx:409
std::unique_ptr< weld::ToggleButton > m_xBtnGradient
Definition: cuitabarea.hxx:244
static ErrCode LoadGraphic(const OUString &rPath, const OUString &rFilter, Graphic &rGraphic, GraphicFilter *pFilter=nullptr, sal_uInt16 *pDeterminedFormat=nullptr)
const Color & GetColor() const
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
bool IsBtnClicked()
Definition: cuitabarea.hxx:254
RectPoint
void FillControls_Impl(const SvxBrushItem &rBgdAttr, const OUString &rUserData)
Definition: backgrnd.cxx:1223
void SetLineColor()
std::unique_ptr< weld::Button > m_xBtnBrowse
Definition: backgrnd.hxx:121
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
OUString getFSysPath(FSysStyle eStyle, sal_Unicode *pDelimiter=nullptr) const
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
Definition: backgrnd.cxx:147
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
#define DBG_ASSERT(sCon, aError)
weld::DialogController * pController
std::unique_ptr< weld::Builder > m_xBuilder
static VclPtr< SfxTabPage > Create(TabPageParent pParent, const SfxItemSet *rAttrSet)
Definition: backgrnd.cxx:347
virtual void FillUserData() override
When destroying a SfxTabPage this virtual method is called, so that the TabPage can save internal inf...
Definition: backgrnd.cxx:502
virtual bool FillItemSet(SfxItemSet *) override
Definition: backgrnd.cxx:1452
std::unique_ptr< weld::RadioButton > m_xBtnArea
Definition: backgrnd.hxx:128
SVX_DLLPUBLIC const ErrMsgCode RID_SVXERRCTX[]
SfxItemSet maSet
Definition: backgrnd.hxx:162
static DialogMask HandleError(ErrCode nId, weld::Window *pParent=nullptr, DialogMask nMask=DialogMask::MAX)
virtual void dispose() override
Definition: backgrnd.cxx:1412
int i
static const sal_uInt16 pPageRanges[]
Definition: backgrnd.hxx:47
HTMLMODE_ON
static void lcl_setFillStyle(weld::ComboBox &rLbSelect, drawing::FillStyle eStyle)
Definition: backgrnd.cxx:80
void SetFillColor()
GPOS_MT
SvxGraphicPosition
sal_Int32 m_nActPos
Definition: backgrnd.hxx:97
const SfxItemSet * GetItemSet(const SfxPoolItem &rAttr)
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: tparea.cxx:239
std::unique_ptr< weld::Widget > m_xBitmapContainer
Definition: backgrnd.hxx:119
std::unique_ptr< SvxOpenGraphicDialog > pImportDlg
Items for Sw-Table must be corrected.
Definition: backgrnd.hxx:88
class SvxBackgroundTabPage -----------------------------------------—
Definition: backgrnd.hxx:43
GPOS_MM
void setSvxBrushItemAsFillAttributesToTargetSet(const SvxBrushItem &rBrush, SfxItemSet &rToSet)
virtual void set_active(int pos)=0
const AllSettings & GetSettings() const
void ShowSelector()
Shift-ListBox activation.
Definition: backgrnd.cxx:757
std::unique_ptr< weld::ToggleButton > m_xBtnBitmap
Definition: cuitabarea.hxx:246
BitmapEx GetBitmapEx(const GraphicConversionParameters &rParameters=GraphicConversionParameters()) const
#define XATTR_FILLSTYLE
std::unique_ptr< SvxBrushItem > pHighlighting
Definition: backgrnd.hxx:99
GPOS_AREA
std::unique_ptr< BackgroundPreviewImpl > m_xPreview1
Definition: backgrnd.hxx:103
SfxItemPool * GetPool() const
std::unique_ptr< weld::Label > m_xSelectTxt
Definition: backgrnd.hxx:108
OUString CuiResId(const char *pKey)
Definition: cuiresmgr.cxx:23
std::unique_ptr< weld::ComboBox > m_xTblLBox
Definition: backgrnd.hxx:111
Preview window for brush or bitmap.
Definition: backgrnd.cxx:114
GPOS_MB
std::unique_ptr< weld::Label > m_xTblDesc
Definition: backgrnd.hxx:110
Point LogicToPixel(const Point &rLogicPt) const
const OUString & GetGraphicLink() const
sal_uInt8 GetGreen() const
#define TBL_DEST_ROW
Definition: backgrnd.cxx:63
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
std::unique_ptr< SvxBrushItem > m_pTableBrush
Definition: backgrnd.hxx:93
OUString aBgdGraphicFilter
Definition: backgrnd.hxx:83
#define TBL_DEST_CELL
Definition: backgrnd.cxx:62
virtual void ActivatePage(const SfxItemSet &) override
Definition: backgrnd.cxx:1418
SfxItemState
OUString GetPath() const
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
#define ERRCODE_NONE
#define GetWhich(nSlot)
virtual std::unique_ptr< SfxItemSet > Clone(bool bItems=true, SfxItemPool *pToPool=nullptr) const
Color GetItemColor(sal_uInt16 nItemId) const
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
std::unique_ptr< SvxBrushItem > m_pCellBrush
Definition: backgrnd.hxx:91
virtual ~SvxBkgTabPage() override
Definition: backgrnd.cxx:1407
virtual void Reset(const SfxItemSet *) override
Definition: backgrnd.cxx:1434
INetProtocol GetProtocol() const
virtual void Reset(const SfxItemSet *rSet) override
Definition: backgrnd.cxx:352
std::unique_ptr< BackgroundPreviewImpl > m_xPreview2
Definition: backgrnd.hxx:104
static VclPtr< reference_type > Create(Arg &&...arg)
SvxBackgroundTabPage(TabPageParent pParent, const SfxItemSet &rCoreSet)
Definition: backgrnd.cxx:264
std::unique_ptr< weld::CustomWeld > m_xPreviewWin1
Definition: backgrnd.hxx:133
SfxOkDialogController * GetDialogController() const
const Color & GetWindowColor() const
void ShowBitmapUI_Impl()
Hide the controls for color settings and show controls for editing the bitmap instead.
Definition: backgrnd.cxx:853
constexpr::Color COL_WHITE(0xFF, 0xFF, 0xFF)
virtual OUString get_id(int pos) const =0
void SetGraphicPosition_Impl(SvxGraphicPosition ePos)
Definition: backgrnd.cxx:878
DeactivateRC
virtual void Resize() override
Definition: backgrnd.cxx:229
std::unique_ptr< weld::RadioButton > m_xBtnPosition
Definition: backgrnd.hxx:127
sal_uInt32 GetValue() const
void NotifyChange(const Color &rColor)
Definition: backgrnd.cxx:162
std::unique_ptr< weld::ToggleButton > m_xBtnPattern
Definition: cuitabarea.hxx:247
static sal_uInt16 lcl_GetTableDestSlot(sal_Int32 nTblDest)
Definition: backgrnd.cxx:1354
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
virtual method; is called on deactivation
Definition: backgrnd.cxx:741
GPOS_RB
std::unique_ptr< weld::CustomWeld > m_xPreviewWin2
Definition: backgrnd.hxx:134
std::unique_ptr< SfxItemSet > m_pResetSet
Definition: backgrnd.hxx:163
GPOS_LB
void SetBitmapList(XBitmapListRef const &pBmpLst)
Definition: cuitabarea.hxx:287
sal_uInt16 m_nRowWhich
Definition: backgrnd.hxx:95
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: backgrnd.cxx:1331
virtual void set_size_request(int nWidth, int nHeight)=0
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
GPOS_RT
std::unique_ptr< weld::CustomWeld > m_xWndPositionWin
Definition: backgrnd.hxx:131
void setWidth(long nWidth)
#define TBL_DEST_TBL
Definition: backgrnd.cxx:64
virtual ~SvxBackgroundTabPage() override
Definition: backgrnd.cxx:323
size_t GetItemCount() const
std::locale SvxResLocale()
IMPL_LINK_NOARG(SvxBackgroundTabPage, BackgroundColorHdl_Impl, SvtValueSet *, void)
Handler, called when color selection is changed.
Definition: backgrnd.cxx:950
std::unique_ptr< weld::CheckButton > m_xBtnLink
Definition: backgrnd.hxx:122
virtual void PointChanged(weld::DrawingArea *pWindow, RectPoint eRP) override
Definition: backgrnd.cxx:752
const Color & GetValue() const
void SetOptimalSize(weld::DialogController *pController)
Definition: tparea.cxx:125
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
void ShowTblControl()
for the Writer (cells/rows/tables)
Definition: backgrnd.cxx:1123
std::unique_ptr< SvxRectCtl > m_xWndPosition
Definition: backgrnd.hxx:101
void ShowColorUI_Impl()
Hide the controls for editing the bitmap and show the controls for color settings instead...
Definition: backgrnd.cxx:836
sal_uInt16 m_nCellWhich
Definition: backgrnd.hxx:94
void setHeight(long nHeight)
#define WB_NAMEFIELD