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