LibreOffice Module cui (master)  1
tpline.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 <editeng/sizeitem.hxx>
22 #include <osl/file.hxx>
23 #include <tools/urlobj.hxx>
24 
25 #include <strings.hrc>
26 #include <svx/colorbox.hxx>
27 #include <svx/dlgctrl.hxx>
28 #include <svx/xlineit0.hxx>
29 #include <svx/xlinjoit.hxx>
30 #include <svx/xlncapit.hxx>
31 #include <svx/xlndsit.hxx>
32 #include <svx/xlnwtit.hxx>
33 #include <svx/xlnstwit.hxx>
34 #include <svx/xlnedwit.hxx>
35 #include <svx/xlnclit.hxx>
36 #include <svx/xlnstit.hxx>
37 #include <svx/xlnedit.hxx>
38 #include <svx/xlnstcit.hxx>
39 #include <svx/xlnedcit.hxx>
40 
41 
42 #include <svx/tabline.hxx>
43 #include <svx/xtable.hxx>
44 #include <svx/drawitem.hxx>
45 #include <cuitabline.hxx>
46 #include <dialmgr.hxx>
47 #include <svx/dlgutil.hxx>
48 #include <svx/svxgrahicitem.hxx>
49 #include <svx/ofaitem.hxx>
50 #include <svx/svdobj.hxx>
51 #include <svx/svdpage.hxx>
52 #include <svx/svdview.hxx>
53 #include <svx/svdmodel.hxx>
54 #include <svx/xlntrit.hxx>
55 #include <svx/xfltrit.hxx>
56 #include <editeng/numitem.hxx>
57 #include <editeng/brushitem.hxx>
58 #include <svx/gallery.hxx>
59 #include <sfx2/opengrf.hxx>
60 #include <svx/dialmgr.hxx>
61 #include <svx/svxids.hrc>
62 #include <svx/strings.hrc>
63 #include <vcl/settings.hxx>
64 #include <cuitabarea.hxx>
65 #include <svtools/unitconv.hxx>
66 
67 #define MAX_BMP_WIDTH 16
68 #define MAX_BMP_HEIGHT 16
69 
70 using namespace com::sun::star;
71 
72 // static ----------------------------------------------------------------
73 
74 const sal_uInt16 SvxLineTabPage::pLineRanges[] =
75 {
78  SID_ATTR_LINE_STYLE,
79  SID_ATTR_LINE_ENDCENTER,
80  0
81 };
82 
84  : SfxTabPage(pParent, "cui/ui/linetabpage.ui", "LineTabPage", &rInAttrs)
85  , m_pSymbolList(nullptr)
86  , m_bNewSize(false)
87  , m_nSymbolType(SVX_SYMBOLTYPE_UNKNOWN) // unknown respectively unchanged
88  , m_pSymbolAttr(nullptr)
89  , m_bLastWidthModified(false)
90  , m_aSymbolLastSize(Size(0,0))
91  , m_bSymbols(false)
92  , m_rOutAttrs(rInAttrs)
93  , m_bObjSelected(false)
94  , m_aXLineAttr(rInAttrs.GetPool())
95  , m_rXLSet(m_aXLineAttr.GetItemSet())
96  , m_pnLineEndListState(nullptr)
97  , m_pnDashListState(nullptr)
98  , m_pnColorListState(nullptr)
99  , m_nPageType(PageType::Area)
100  , m_nDlgType(0)
101  , m_pPosDashLb(nullptr)
102  , m_pPosLineEndLb(nullptr)
103  , m_xBoxColor(m_xBuilder->weld_widget("boxCOLOR"))
104  , m_xLbLineStyle(new SvxLineLB(m_xBuilder->weld_combo_box("LB_LINE_STYLE")))
105  , m_xLbColor(new ColorListBox(m_xBuilder->weld_menu_button("LB_COLOR"), pParent.GetFrameWeld()))
106  , m_xBoxWidth(m_xBuilder->weld_widget("boxWIDTH"))
107  , m_xMtrLineWidth(m_xBuilder->weld_metric_spin_button("MTR_FLD_LINE_WIDTH", FieldUnit::CM))
108  , m_xBoxTransparency(m_xBuilder->weld_widget("boxTRANSPARENCY"))
109  , m_xMtrTransparent(m_xBuilder->weld_metric_spin_button("MTR_LINE_TRANSPARENT", FieldUnit::PERCENT))
110  , m_xFlLineEnds(m_xBuilder->weld_widget("FL_LINE_ENDS"))
111  , m_xBoxArrowStyles(m_xBuilder->weld_widget("boxARROW_STYLES"))
112  , m_xLbStartStyle(new SvxLineEndLB(m_xBuilder->weld_combo_box("LB_START_STYLE")))
113  , m_xBoxStart(m_xBuilder->weld_widget("boxSTART"))
114  , m_xMtrStartWidth(m_xBuilder->weld_metric_spin_button("MTR_FLD_START_WIDTH", FieldUnit::CM))
115  , m_xTsbCenterStart(m_xBuilder->weld_check_button("TSB_CENTER_START"))
116  , m_xBoxEnd(m_xBuilder->weld_widget("boxEND"))
117  , m_xLbEndStyle(new SvxLineEndLB(m_xBuilder->weld_combo_box("LB_END_STYLE")))
118  , m_xMtrEndWidth(m_xBuilder->weld_metric_spin_button("MTR_FLD_END_WIDTH", FieldUnit::CM))
119  , m_xTsbCenterEnd(m_xBuilder->weld_check_button("TSB_CENTER_END"))
120  , m_xCbxSynchronize(m_xBuilder->weld_check_button("CBX_SYNCHRONIZE"))
121  , m_xCtlPreview(new weld::CustomWeld(*m_xBuilder, "CTL_PREVIEW", m_aCtlPreview))
122  , m_xFLEdgeStyle(m_xBuilder->weld_widget("FL_EDGE_STYLE"))
123  , m_xGridEdgeCaps(m_xBuilder->weld_widget("gridEDGE_CAPS"))
124  , m_xLBEdgeStyle(m_xBuilder->weld_combo_box("LB_EDGE_STYLE"))
125  , m_xLBCapStyle(m_xBuilder->weld_combo_box("LB_CAP_STYLE")) // LineCaps
126  , m_xFlSymbol(m_xBuilder->weld_widget("FL_SYMBOL_FORMAT")) //#58425# Symbols on a line (e.g. StarChart)
127  , m_xGridIconSize(m_xBuilder->weld_widget("gridICON_SIZE"))
128  , m_xSymbolMB(m_xBuilder->weld_menu_button("MB_SYMBOL_BITMAP"))
129  , m_xSymbolWidthMF(m_xBuilder->weld_metric_spin_button("MF_SYMBOL_WIDTH", FieldUnit::CM))
130  , m_xSymbolHeightMF(m_xBuilder->weld_metric_spin_button("MF_SYMBOL_HEIGHT", FieldUnit::CM))
131  , m_xSymbolRatioCB(m_xBuilder->weld_check_button("CB_SYMBOL_RATIO"))
132 {
133  // This Page requires ExchangeSupport
135 
136  // Metric set
137  FieldUnit eFUnit = GetModuleFieldUnit( rInAttrs );
138 
139  switch ( eFUnit )
140  {
141  case FieldUnit::M:
142  case FieldUnit::KM:
143  eFUnit = FieldUnit::MM;
144  [[fallthrough]]; // we now have mm
145  case FieldUnit::MM:
146  m_xMtrLineWidth->set_increments(50, 500, FieldUnit::NONE);
147  m_xMtrStartWidth->set_increments(50, 500, FieldUnit::NONE);
148  m_xMtrEndWidth->set_increments(50, 500, FieldUnit::NONE);
149  break;
150 
151  case FieldUnit::INCH:
152  m_xMtrLineWidth->set_increments(2, 20, FieldUnit::NONE);
153  m_xMtrStartWidth->set_increments(2, 20, FieldUnit::NONE);
154  m_xMtrEndWidth->set_increments(2, 20, FieldUnit::NONE);
155  break;
156  default: ;// prevent warning
157  }
158  SetFieldUnit( *m_xMtrLineWidth, eFUnit );
159  SetFieldUnit( *m_xMtrStartWidth, eFUnit );
160  SetFieldUnit( *m_xMtrEndWidth, eFUnit );
161 
162  // determine PoolUnit
163  SfxItemPool* pPool = m_rOutAttrs.GetPool();
164  DBG_ASSERT( pPool, "Where is the pool?" );
165  m_ePoolUnit = pPool->GetMetric( SID_ATTR_LINE_WIDTH );
166 
167  m_xLbLineStyle->connect_changed(LINK(this, SvxLineTabPage, ClickInvisibleHdl_Impl));
168  m_xLbColor->SetSelectHdl( LINK( this, SvxLineTabPage, ChangePreviewListBoxHdl_Impl ) );
169  m_xMtrLineWidth->connect_value_changed(LINK(this, SvxLineTabPage, ChangePreviewModifyHdl_Impl));
170  m_xMtrTransparent->connect_value_changed(LINK( this, SvxLineTabPage, ChangeTransparentHdl_Impl));
171 
172  m_xLbStartStyle->connect_changed(LINK(this, SvxLineTabPage, ChangeStartListBoxHdl_Impl));
173  m_xLbEndStyle->connect_changed(LINK(this, SvxLineTabPage, ChangeEndListBoxHdl_Impl));
174  m_xMtrStartWidth->connect_value_changed(LINK(this, SvxLineTabPage, ChangeStartModifyHdl_Impl));
175  m_xMtrEndWidth->connect_value_changed(LINK( this, SvxLineTabPage, ChangeEndModifyHdl_Impl));
176  m_xTsbCenterStart->connect_clicked(LINK(this, SvxLineTabPage, ChangeStartClickHdl_Impl));
177  m_xTsbCenterEnd->connect_clicked(LINK(this, SvxLineTabPage, ChangeEndClickHdl_Impl));
178 
179  Link<weld::ComboBox&,void> aEdgeStyle = LINK(this, SvxLineTabPage, ChangeEdgeStyleHdl_Impl);
180  m_xLBEdgeStyle->connect_changed(aEdgeStyle);
181 
182  // LineCaps
183  Link<weld::ComboBox&,void> aCapStyle = LINK(this, SvxLineTabPage, ChangeCapStyleHdl_Impl);
184  m_xLBCapStyle->connect_changed(aCapStyle);
185 
186  // Symbols on a line (eg star charts), MB-handler set
187  m_xSymbolMB->connect_selected(LINK(this, SvxLineTabPage, GraphicHdl_Impl));
188  m_xSymbolMB->connect_toggled(LINK(this, SvxLineTabPage, MenuCreateHdl_Impl));
189  m_xSymbolWidthMF->connect_value_changed(LINK(this, SvxLineTabPage, SizeHdl_Impl));
190  m_xSymbolHeightMF->connect_value_changed(LINK(this, SvxLineTabPage, SizeHdl_Impl));
191  m_xSymbolRatioCB->connect_toggled(LINK(this, SvxLineTabPage, RatioHdl_Impl));
192 
193  m_xSymbolRatioCB->set_active(true);
194  ShowSymbolControls(false);
195 
196  m_nActLineWidth = -1;
197 }
198 
200 {
201  // Symbols on a line (e.g. StarCharts), symbol-enable controls
202 
203  m_bSymbols=bOn;
204  m_xFlSymbol->set_visible(bOn);
206 }
207 
209 {
210  disposeOnce();
211 }
212 
214 {
215  m_xCtlPreview.reset();
216  m_xLbEndStyle.reset();
217  m_xLbStartStyle.reset();
218  m_xLbColor.reset();
219  m_xLbLineStyle.reset();
220  m_aGalleryBrushItems.clear();
221  m_aSymbolBrushItems.clear();
222 
224 }
225 
227 {
228  FillListboxes();
229 }
230 
232 {
233  // Line styles
234  auto nOldSelect = m_xLbLineStyle->get_active();
235  // aLbLineStyle.FillStyles();
236  m_xLbLineStyle->Fill( m_pDashList );
237  m_xLbLineStyle->set_active( nOldSelect );
238 
239  // Line end style
240  OUString sNone( SvxResId( RID_SVXSTR_NONE ) );
241  nOldSelect = m_xLbStartStyle->get_active();
242  m_xLbStartStyle->clear();
243  m_xLbStartStyle->append_text(sNone);
245  m_xLbStartStyle->set_active(nOldSelect);
246  nOldSelect = m_xLbEndStyle->get_active();
247  m_xLbEndStyle->clear();
248  m_xLbEndStyle->append_text(sNone);
249  m_xLbEndStyle->Fill(m_pLineEndList, false);
250  m_xLbEndStyle->set_active(nOldSelect);
251 }
252 
254 {
255  const CntUInt16Item* pPageTypeItem = rSet.GetItem<CntUInt16Item>(SID_PAGE_TYPE, false);
256  if (pPageTypeItem)
257  SetPageType(static_cast<PageType>(pPageTypeItem->GetValue()));
258  if( m_nDlgType == 0 && m_pDashList.is() )
259  {
260  sal_Int32 nPos;
261  sal_Int32 nCount;
262 
263  // Dash list
264  if( ( *m_pnDashListState & ChangeType::MODIFIED ) ||
265  ( *m_pnDashListState & ChangeType::CHANGED ) )
266  {
267  if( *m_pnDashListState & ChangeType::CHANGED )
268  m_pDashList = static_cast<SvxLineTabDialog*>(GetDialogController() )->GetNewDashList();
269 
270  *m_pnDashListState = ChangeType::NONE;
271 
272  // Style list
273  nPos = m_xLbLineStyle->get_active();
274 
275  m_xLbLineStyle->clear();
276  m_xLbLineStyle->append_text(SvxResId(RID_SVXSTR_INVISIBLE));
277  m_xLbLineStyle->append_text(SvxResId(RID_SVXSTR_SOLID));
279  nCount = m_xLbLineStyle->get_count();
280 
281  if ( nCount == 0 )
282  ; // This case should never occur
283  else if( nCount <= nPos )
284  m_xLbLineStyle->set_active(0);
285  else
286  m_xLbLineStyle->set_active(nPos);
287  }
288 
289  INetURLObject aDashURL( m_pDashList->GetPath() );
290 
291  aDashURL.Append( m_pDashList->GetName() );
292  DBG_ASSERT( aDashURL.GetProtocol() != INetProtocol::NotValid, "invalid URL" );
293  // LineEnd list
294  if( ( *m_pnLineEndListState & ChangeType::MODIFIED ) || ( *m_pnLineEndListState & ChangeType::CHANGED ) )
295  {
296  if( *m_pnLineEndListState & ChangeType::CHANGED )
297  m_pLineEndList = static_cast<SvxLineTabDialog*>(GetDialogController())->GetNewLineEndList();
298 
299  *m_pnLineEndListState = ChangeType::NONE;
300 
301  nPos = m_xLbLineStyle->get_active();
302  OUString sNone(SvxResId(RID_SVXSTR_NONE));
303  m_xLbStartStyle->clear();
304  m_xLbStartStyle->append_text(sNone);
305 
307  nCount = m_xLbStartStyle->get_count();
308  if( nCount == 0 )
309  ; // This case should never occur
310  else if( nCount <= nPos )
311  m_xLbStartStyle->set_active(0);
312  else
313  m_xLbStartStyle->set_active(nPos);
314 
315  m_xLbEndStyle->clear();
316  m_xLbEndStyle->append_text(sNone);
317 
318  m_xLbEndStyle->Fill( m_pLineEndList, false );
319  nCount = m_xLbEndStyle->get_count();
320 
321  if( nCount == 0 )
322  ; // This case should never occur
323  else if( nCount <= nPos )
324  m_xLbEndStyle->set_active(0);
325  else
326  m_xLbEndStyle->set_active(nPos);
327  }
328  INetURLObject aLineURL( m_pLineEndList->GetPath() );
329 
330  aLineURL.Append( m_pLineEndList->GetName() );
331  DBG_ASSERT( aLineURL.GetProtocol() != INetProtocol::NotValid, "invalid URL" );
332  // Evaluate if another TabPage set another fill type
333  if( m_xLbLineStyle->get_active() != 0 )
334  {
335  if( m_nPageType == PageType::Hatch ) // 1
336  {
337  m_xLbLineStyle->set_active(*m_pPosDashLb + 2); // +2 due to SOLID and INVISIBLE
338  ChangePreviewHdl_Impl( nullptr );
339  }
341  {
342  m_xLbStartStyle->set_active(*m_pPosLineEndLb + 1);// +1 due to SOLID
343  m_xLbEndStyle->set_active(*m_pPosLineEndLb + 1);// +1 due to SOLID
344  ChangePreviewHdl_Impl( nullptr );
345  }
346  }
347 
348  // ColorList
349  if( *m_pnColorListState != ChangeType::NONE )
350  {
351  ChangePreviewHdl_Impl( nullptr );
352  }
353 
355  }
356  // Page does not yet exist in the ctor, that's why we do it here!
357 
358  else if (m_nDlgType == 1101) // nNoArrowNoShadowDlg from chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
359  {
360  m_xFlLineEnds->hide();
361  m_xFLEdgeStyle->hide();
362  }
363 }
364 
365 
367 {
368  if( m_nDlgType == 0 ) // Line dialog
369  {
370  m_nPageType = PageType::Gradient; // possibly for extensions
371  *m_pPosDashLb = m_xLbLineStyle->get_active() - 2;// First entry SOLID!!!
372  sal_Int32 nPos = m_xLbStartStyle->get_active();
373  if (nPos != -1)
374  nPos--;
375  *m_pPosLineEndLb = nPos;
376  }
377 
378  if( _pSet )
379  FillItemSet( _pSet );
380 
381  return DeactivateRC::LeavePage;
382 }
383 
384 
386 {
387  const SfxPoolItem* pOld = nullptr;
388  sal_Int32 nPos;
389  bool bModified = false;
390 
391  // To prevent modifications to the list, we do not set other page's items.
392  if( m_nDlgType != 0 || m_nPageType != PageType::Hatch )
393  {
394  nPos = m_xLbLineStyle->get_active();
395  if( nPos != -1 &&
396  m_xLbLineStyle->get_value_changed_from_saved() )
397  {
398  std::unique_ptr<XLineStyleItem> pStyleItem;
399 
400  if( nPos == 0 )
401  pStyleItem.reset(new XLineStyleItem( drawing::LineStyle_NONE ));
402  else if( nPos == 1 )
403  pStyleItem.reset(new XLineStyleItem( drawing::LineStyle_SOLID ));
404  else
405  {
406  pStyleItem.reset(new XLineStyleItem( drawing::LineStyle_DASH ));
407 
408  // For added security
409  if( m_pDashList->Count() > static_cast<long>( nPos - 2 ) )
410  {
411  XLineDashItem aDashItem( m_xLbLineStyle->get_active_text(),
412  m_pDashList->GetDash( nPos - 2 )->GetDash() );
413  pOld = GetOldItem( *rAttrs, XATTR_LINEDASH );
414  if ( !pOld || !( *static_cast<const XLineDashItem*>(pOld) == aDashItem ) )
415  {
416  rAttrs->Put( aDashItem );
417  bModified = true;
418  }
419  }
420  }
421  pOld = GetOldItem( *rAttrs, XATTR_LINESTYLE );
422  if ( !pOld || !( *static_cast<const XLineStyleItem*>(pOld) == *pStyleItem ) )
423  {
424  rAttrs->Put( *pStyleItem );
425  bModified = true;
426  }
427  }
428  }
429  // Line width
430  // GetSavedValue() returns OUString!
431  if( m_xMtrLineWidth->get_value_changed_from_saved() )
432  {
434  pOld = GetOldItem( *rAttrs, XATTR_LINEWIDTH );
435  if ( !pOld || !( *static_cast<const XLineWidthItem*>(pOld) == aItem ) )
436  {
437  rAttrs->Put( aItem );
438  bModified = true;
439  }
440  }
441  // Width line start
442  if( m_xMtrStartWidth->get_value_changed_from_saved() )
443  {
445  pOld = GetOldItem( *rAttrs, XATTR_LINESTARTWIDTH );
446  if ( !pOld || !( *static_cast<const XLineStartWidthItem*>(pOld) == aItem ) )
447  {
448  rAttrs->Put( aItem );
449  bModified = true;
450  }
451  }
452  // Width line end
453  if( m_xMtrEndWidth->get_value_changed_from_saved() )
454  {
456  pOld = GetOldItem( *rAttrs, XATTR_LINEENDWIDTH );
457  if ( !pOld || !( *static_cast<const XLineEndWidthItem*>(pOld) == aItem ) )
458  {
459  rAttrs->Put( aItem );
460  bModified = true;
461  }
462  }
463 
464  // Line color
465  {
466  NamedColor aColor = m_xLbColor->GetSelectedEntry();
467  XLineColorItem aItem(aColor.second, aColor.first);
468  pOld = GetOldItem( *rAttrs, XATTR_LINECOLOR );
469  if ( !pOld || !( *static_cast<const XLineColorItem*>(pOld) == aItem ) )
470  {
471  rAttrs->Put( aItem );
472  bModified = true;
473  }
474  }
475 
476  if( m_nDlgType != 0 || m_nPageType != PageType::Bitmap )
477  {
478  // Line start
479  nPos = m_xLbStartStyle->get_active();
480  if( nPos != -1 && m_xLbStartStyle->get_value_changed_from_saved() )
481  {
482  std::unique_ptr<XLineStartItem> pItem;
483  if( nPos == 0 )
484  pItem.reset(new XLineStartItem());
485  else if( m_pLineEndList->Count() > static_cast<long>( nPos - 1 ) )
486  pItem.reset(new XLineStartItem( m_xLbStartStyle->get_active_text(), m_pLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() ));
487  pOld = GetOldItem( *rAttrs, XATTR_LINESTART );
488  if( pItem && ( !pOld || !( *static_cast<const XLineEndItem*>(pOld) == *pItem ) ) )
489  {
490  rAttrs->Put( *pItem );
491  bModified = true;
492  }
493  }
494  // Line end
495  nPos = m_xLbEndStyle->get_active();
496  if( nPos != -1 && m_xLbEndStyle->get_value_changed_from_saved() )
497  {
498  std::unique_ptr<XLineEndItem> pItem;
499  if( nPos == 0 )
500  pItem.reset(new XLineEndItem());
501  else if( m_pLineEndList->Count() > static_cast<long>( nPos - 1 ) )
502  pItem.reset(new XLineEndItem( m_xLbEndStyle->get_active_text(), m_pLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() ));
503  pOld = GetOldItem( *rAttrs, XATTR_LINEEND );
504  if( pItem &&
505  ( !pOld || !( *static_cast<const XLineEndItem*>(pOld) == *pItem ) ) )
506  {
507  rAttrs->Put( *pItem );
508  bModified = true;
509  }
510  }
511  }
512 
513  // Centered line end
514  TriState eState = m_xTsbCenterStart->get_state();
515  if( m_xTsbCenterStart->get_state_changed_from_saved() )
516  {
517  XLineStartCenterItem aItem( eState != TRISTATE_FALSE );
518  pOld = GetOldItem( *rAttrs, XATTR_LINESTARTCENTER );
519  if ( !pOld || !( *static_cast<const XLineStartCenterItem*>(pOld) == aItem ) )
520  {
521  rAttrs->Put( aItem );
522  bModified = true;
523  }
524  }
525  eState = m_xTsbCenterEnd->get_state();
526  if( m_xTsbCenterEnd->get_state_changed_from_saved() )
527  {
528  XLineEndCenterItem aItem( eState != TRISTATE_FALSE );
529  pOld = GetOldItem( *rAttrs, XATTR_LINEENDCENTER );
530  if ( !pOld || !( *static_cast<const XLineEndCenterItem*>(pOld) == aItem ) )
531  {
532  rAttrs->Put( aItem );
533  bModified = true;
534  }
535  }
536 
537  // Transparency
538  sal_uInt16 nVal = m_xMtrTransparent->get_value(FieldUnit::PERCENT);
539  if( m_xMtrTransparent->get_value_changed_from_saved() )
540  {
541  XLineTransparenceItem aItem( nVal );
542  pOld = GetOldItem( *rAttrs, XATTR_LINETRANSPARENCE );
543  if ( !pOld || !( *static_cast<const XLineTransparenceItem*>(pOld) == aItem ) )
544  {
545  rAttrs->Put( aItem );
546  bModified = true;
547  }
548  }
549 
550  nPos = m_xLBEdgeStyle->get_active();
551  if (nPos != -1 && m_xLBEdgeStyle->get_value_changed_from_saved())
552  {
553  std::unique_ptr<XLineJointItem> pNew;
554 
555  switch(nPos)
556  {
557  case 0: // Rounded, default
558  {
559  pNew.reset(new XLineJointItem(css::drawing::LineJoint_ROUND));
560  break;
561  }
562  case 1: // - none -
563  {
564  pNew.reset(new XLineJointItem(css::drawing::LineJoint_NONE));
565  break;
566  }
567  case 2: // Miter
568  {
569  pNew.reset(new XLineJointItem(css::drawing::LineJoint_MITER));
570  break;
571  }
572  case 3: // Bevel
573  {
574  pNew.reset(new XLineJointItem(css::drawing::LineJoint_BEVEL));
575  break;
576  }
577  }
578 
579  if(pNew)
580  {
581  pOld = GetOldItem( *rAttrs, XATTR_LINEJOINT );
582 
583  if(!pOld || !(*static_cast<const XLineJointItem*>(pOld) == *pNew))
584  {
585  rAttrs->Put( *pNew );
586  bModified = true;
587  }
588  }
589  }
590 
591  // LineCaps
592  nPos = m_xLBCapStyle->get_active();
593  if (nPos != -1 && m_xLBCapStyle->get_value_changed_from_saved())
594  {
595  std::unique_ptr<XLineCapItem> pNew;
596 
597  switch(nPos)
598  {
599  case 0: // Butt (=Flat), default
600  {
601  pNew.reset(new XLineCapItem(css::drawing::LineCap_BUTT));
602  break;
603  }
604  case 1: // Round
605  {
606  pNew.reset(new XLineCapItem(css::drawing::LineCap_ROUND));
607  break;
608  }
609  case 2: // Square
610  {
611  pNew.reset(new XLineCapItem(css::drawing::LineCap_SQUARE));
612  break;
613  }
614  }
615 
616  if(pNew)
617  {
618  pOld = GetOldItem( *rAttrs, XATTR_LINECAP );
619 
620  if(!pOld || !(*static_cast<const XLineCapItem*>(pOld) == *pNew))
621  {
622  rAttrs->Put( *pNew );
623  bModified = true;
624  }
625  }
626  }
627 
629  {
630  // Was set by selection or the size is different
631  SvxSizeItem aSItem(rAttrs->GetPool()->GetWhich(SID_ATTR_SYMBOLSIZE),m_aSymbolSize);
632  const SfxPoolItem* pSOld = GetOldItem( *rAttrs, rAttrs->GetPool()->GetWhich(SID_ATTR_SYMBOLSIZE) );
633  m_bNewSize = pSOld ? *static_cast<const SvxSizeItem *>(pSOld) != aSItem : m_bNewSize ;
634  if(m_bNewSize)
635  {
636  rAttrs->Put(aSItem);
637  bModified=true;
638  }
639 
640  SfxInt32Item aTItem(rAttrs->GetPool()->GetWhich(SID_ATTR_SYMBOLTYPE),m_nSymbolType);
641  const SfxPoolItem* pTOld = GetOldItem( *rAttrs, rAttrs->GetPool()->GetWhich(SID_ATTR_SYMBOLTYPE) );
642  bool bNewType = pTOld == nullptr || *static_cast<const SfxInt32Item*>(pTOld) != aTItem;
643  if(bNewType && m_nSymbolType==SVX_SYMBOLTYPE_UNKNOWN)
644  bNewType=false; // a small fix, type wasn't set -> don't create a type item after all!
645  if(bNewType)
646  {
647  rAttrs->Put(aTItem);
648  bModified=true;
649  }
650 
652  {
653  SvxBrushItem aBItem(m_aSymbolGraphic,GPOS_MM,rAttrs->GetPool()->GetWhich(SID_ATTR_BRUSH));
654  const SfxPoolItem* pBOld = GetOldItem( *rAttrs, rAttrs->GetPool()->GetWhich(SID_ATTR_BRUSH) );
655  bool bNewBrush =
656  pBOld == nullptr || *static_cast<const SvxBrushItem*>(pBOld) != aBItem;
657  if(bNewBrush)
658  {
659  rAttrs->Put(aBItem);
660  bModified=true;
661  }
662  }
663  }
664  rAttrs->Put (CntUInt16Item(SID_PAGE_TYPE, static_cast<sal_uInt16>(m_nPageType)));
665  return bModified;
666 }
667 
668 
670 {
671  sal_Int32 nPos;
672 
673  if (m_xLbLineStyle->get_active() == -1)
674  {
675  m_rXLSet.Put( XLineStyleItem( drawing::LineStyle_NONE ) );
676  }
677  else if (m_xLbLineStyle->get_active() == 0)
678  m_rXLSet.Put( XLineStyleItem( drawing::LineStyle_NONE ) );
679  else if (m_xLbLineStyle->get_active() == 1)
680  m_rXLSet.Put( XLineStyleItem( drawing::LineStyle_SOLID ) );
681  else
682  {
683  m_rXLSet.Put( XLineStyleItem( drawing::LineStyle_DASH ) );
684 
685  nPos = m_xLbLineStyle->get_active();
686  if (nPos != -1)
687  {
688  m_rXLSet.Put( XLineDashItem( m_xLbLineStyle->get_active_text(),
689  m_pDashList->GetDash( nPos - 2 )->GetDash() ) );
690  }
691  }
692 
693  nPos = m_xLbStartStyle->get_active();
694  if (nPos != -1)
695  {
696  if( nPos == 0 )
698  else
699  m_rXLSet.Put( XLineStartItem( m_xLbStartStyle->get_active_text(),
700  m_pLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() ) );
701  }
702  nPos = m_xLbEndStyle->get_active();
703  if (nPos != -1)
704  {
705  if( nPos == 0 )
707  else
708  m_rXLSet.Put( XLineEndItem( m_xLbEndStyle->get_active_text(),
709  m_pLineEndList->GetLineEnd( nPos - 1 )->GetLineEnd() ) );
710  }
711 
712  nPos = m_xLBEdgeStyle->get_active();
713  if (nPos != -1)
714  {
715  switch(nPos)
716  {
717  case 0: // Rounded, default
718  {
719  m_rXLSet.Put(XLineJointItem(css::drawing::LineJoint_ROUND));
720  break;
721  }
722  case 1: // - none -
723  {
724  m_rXLSet.Put(XLineJointItem(css::drawing::LineJoint_NONE));
725  break;
726  }
727  case 2: // Miter
728  {
729  m_rXLSet.Put(XLineJointItem(css::drawing::LineJoint_MITER));
730  break;
731  }
732  case 3: // Bevel
733  {
734  m_rXLSet.Put(XLineJointItem(css::drawing::LineJoint_BEVEL));
735  break;
736  }
737  }
738  }
739 
740  // LineCaps
741  nPos = m_xLBCapStyle->get_active();
742  if (nPos != -1)
743  {
744  switch(nPos)
745  {
746  case 0: // Butt (=Flat), default
747  {
748  m_rXLSet.Put(XLineCapItem(css::drawing::LineCap_BUTT));
749  break;
750  }
751  case 1: // Round
752  {
753  m_rXLSet.Put(XLineCapItem(css::drawing::LineCap_ROUND));
754  break;
755  }
756  case 2: // Square
757  {
758  m_rXLSet.Put(XLineCapItem(css::drawing::LineCap_SQUARE));
759  break;
760  }
761  }
762  }
763 
766 
768  NamedColor aColor = m_xLbColor->GetSelectedEntry();
769  m_rXLSet.Put(XLineColorItem(aColor.second, aColor.first));
770 
771  // Centered line end
772  if( m_xTsbCenterStart->get_state() == TRISTATE_TRUE )
773  m_rXLSet.Put( XLineStartCenterItem( true ) );
774  else if( m_xTsbCenterStart->get_state() == TRISTATE_FALSE )
775  m_rXLSet.Put( XLineStartCenterItem( false ) );
776 
777  if( m_xTsbCenterEnd->get_state() == TRISTATE_TRUE )
778  m_rXLSet.Put( XLineEndCenterItem( true ) );
779  else if( m_xTsbCenterEnd->get_state() == TRISTATE_FALSE )
780  m_rXLSet.Put( XLineEndCenterItem( false ) );
781 
782  // Transparency
783  sal_uInt16 nVal = m_xMtrTransparent->get_value(FieldUnit::PERCENT);
785 
787 }
788 
789 
790 void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
791 {
792  drawing::LineStyle eXLS; // drawing::LineStyle_NONE, drawing::LineStyle_SOLID, drawing::LineStyle_DASH
793 
794  // Line style
795  const SfxPoolItem *pPoolItem;
796  long nSymType=SVX_SYMBOLTYPE_UNKNOWN;
797  bool bPrevSym=false;
798  bool bEnable=true;
799  bool bIgnoreGraphic=false;
800  bool bIgnoreSize=false;
801  if(rAttrs->GetItemState(rAttrs->GetPool()->GetWhich(SID_ATTR_SYMBOLTYPE),true,&pPoolItem) == SfxItemState::SET)
802  {
803  nSymType=static_cast<const SfxInt32Item *>(pPoolItem)->GetValue();
804  }
805 
806  if(nSymType == SVX_SYMBOLTYPE_AUTO)
807  {
810  bPrevSym=true;
811  }
812  else if(nSymType == SVX_SYMBOLTYPE_NONE)
813  {
814  bEnable=false;
815  bIgnoreGraphic=true;
816  bIgnoreSize=true;
817  }
818  else if(nSymType >= 0)
819  {
821  pVDev->SetMapMode(MapMode(MapUnit::Map100thMM));
822 
823  std::unique_ptr<SdrModel> pModel(
824  new SdrModel(nullptr, nullptr, true));
825  pModel->GetItemPool().FreezeIdRanges();
826  SdrPage* pPage = new SdrPage( *pModel, false );
827  pPage->SetSize(Size(1000,1000));
828  pModel->InsertPage( pPage, 0 );
829  {
830  std::unique_ptr<SdrView> pView(new SdrView( *pModel, pVDev ));
831  pView->hideMarkHandles();
832  pView->ShowSdrPage(pPage);
833  SdrObject *pObj=nullptr;
834  size_t nSymTmp = static_cast<size_t>(nSymType);
835  if(m_pSymbolList)
836  {
838  {
839  nSymTmp %= m_pSymbolList->GetObjCount(); // Treat list as cyclic!
840  pObj=m_pSymbolList->GetObj(nSymTmp);
841  if(pObj)
842  {
843  // directly clone to target SdrModel
844  pObj = pObj->CloneSdrObject(*pModel);
845 
846  if(m_pSymbolAttr)
847  {
849  }
850  else
851  {
853  }
854 
855  pPage->NbcInsertObject(pObj);
856 
857  // Generate invisible square to give all symbol types a
858  // bitmap size, which is independent from specific glyph
859  SdrObject* pInvisibleSquare(m_pSymbolList->GetObj(0));
860 
861  // directly clone to target SdrModel
862  pInvisibleSquare = pInvisibleSquare->CloneSdrObject(*pModel);
863 
864  pPage->NbcInsertObject(pInvisibleSquare);
865  pInvisibleSquare->SetMergedItem(XFillTransparenceItem(100));
866  pInvisibleSquare->SetMergedItem(XLineTransparenceItem(100));
867 
868  pView->MarkAll();
869  GDIMetaFile aMeta(pView->GetMarkedObjMetaFile());
870 
871  m_aSymbolGraphic=Graphic(aMeta);
873  m_aSymbolGraphic.SetPrefSize(pInvisibleSquare->GetSnapRect().GetSize());
874  m_aSymbolGraphic.SetPrefMapMode(MapMode(MapUnit::Map100thMM));
875  bPrevSym=true;
876  bEnable=true;
877  bIgnoreGraphic=true;
878 
879  pView->UnmarkAll();
880  pInvisibleSquare=pPage->RemoveObject(1);
881  SdrObject::Free( pInvisibleSquare);
882  pObj=pPage->RemoveObject(0);
883  SdrObject::Free( pObj );
884  }
885  }
886  }
887  }
888  }
889  if(rAttrs->GetItemState(rAttrs->GetPool()->GetWhich(SID_ATTR_BRUSH),true,&pPoolItem) == SfxItemState::SET)
890  {
891  const Graphic* pGraphic = static_cast<const SvxBrushItem *>(pPoolItem)->GetGraphic();
892  if( pGraphic )
893  {
894  if(!bIgnoreGraphic)
895  {
896  m_aSymbolGraphic=*pGraphic;
897  }
898  if(!bIgnoreSize)
899  {
901  pGraphic->GetPrefMapMode(),
902  MapMode(MapUnit::Map100thMM));
903  }
904  bPrevSym=true;
905  }
906  }
907 
908  if(rAttrs->GetItemState(rAttrs->GetPool()->GetWhich(SID_ATTR_SYMBOLSIZE),true,&pPoolItem) == SfxItemState::SET)
909  {
910  m_aSymbolSize = static_cast<const SvxSizeItem *>(pPoolItem)->GetSize();
911  }
912 
913  m_xGridIconSize->set_sensitive(bEnable);
914 
915  if(bPrevSym)
916  {
921  }
922 
923  if( rAttrs->GetItemState( XATTR_LINESTYLE ) != SfxItemState::DONTCARE )
924  {
925  eXLS = rAttrs->Get( XATTR_LINESTYLE ).GetValue();
926 
927  switch( eXLS )
928  {
929  case drawing::LineStyle_NONE:
930  m_xLbLineStyle->set_active(0);
931  break;
932  case drawing::LineStyle_SOLID:
933  m_xLbLineStyle->set_active(1);
934  break;
935 
936  case drawing::LineStyle_DASH:
937  m_xLbLineStyle->set_active(-1);
938  m_xLbLineStyle->set_active_text(rAttrs->Get( XATTR_LINEDASH ).GetName());
939  break;
940 
941  default:
942  break;
943  }
944  }
945  else
946  {
947  m_xLbLineStyle->set_active(-1);
948  }
949 
950  // Line strength
951  if( rAttrs->GetItemState( XATTR_LINEWIDTH ) != SfxItemState::DONTCARE )
952  {
953  SetMetricValue( *m_xMtrLineWidth, rAttrs->Get( XATTR_LINEWIDTH ).GetValue(), m_ePoolUnit );
954  }
955  else
956  m_xMtrLineWidth->set_text("");
957 
958  // Line color
959  m_xLbColor->SetNoSelection();
960 
961  if ( rAttrs->GetItemState( XATTR_LINECOLOR ) != SfxItemState::DONTCARE )
962  {
963  Color aCol = rAttrs->Get( XATTR_LINECOLOR ).GetColorValue();
964  m_xLbColor->SelectEntry( aCol );
965  }
966 
967  // Line start
968  if( m_bObjSelected && rAttrs->GetItemState( XATTR_LINESTART ) == SfxItemState::DEFAULT )
969  {
970  m_xLbStartStyle->set_sensitive(false);
971  }
972  else if( rAttrs->GetItemState( XATTR_LINESTART ) != SfxItemState::DONTCARE )
973  {
974  // #86265# select entry using list and polygon, not string
975  bool bSelected(false);
976  const basegfx::B2DPolyPolygon& rItemPolygon = rAttrs->Get(XATTR_LINESTART).GetLineStartValue();
977 
978  for(long a(0);!bSelected && a < m_pLineEndList->Count(); a++)
979  {
980  const XLineEndEntry* pEntry = m_pLineEndList->GetLineEnd(a);
981  const basegfx::B2DPolyPolygon& rEntryPolygon = pEntry->GetLineEnd();
982 
983  if(rItemPolygon == rEntryPolygon)
984  {
985  // select this entry
986  m_xLbStartStyle->set_active(a + 1);
987  bSelected = true;
988  }
989  }
990 
991  if(!bSelected)
992  m_xLbStartStyle->set_active(0);
993  }
994  else
995  {
996  m_xLbStartStyle->set_active(-1);
997  }
998 
999  // Line end
1000  if( m_bObjSelected && rAttrs->GetItemState( XATTR_LINEEND ) == SfxItemState::DEFAULT )
1001  {
1002  m_xLbEndStyle->set_sensitive(false);
1003  }
1004  else if( rAttrs->GetItemState( XATTR_LINEEND ) != SfxItemState::DONTCARE )
1005  {
1006  // #86265# select entry using list and polygon, not string
1007  bool bSelected(false);
1008  const basegfx::B2DPolyPolygon& rItemPolygon = rAttrs->Get(XATTR_LINEEND).GetLineEndValue();
1009 
1010  for(long a(0);!bSelected && a < m_pLineEndList->Count(); a++)
1011  {
1012  const XLineEndEntry* pEntry = m_pLineEndList->GetLineEnd(a);
1013  const basegfx::B2DPolyPolygon& rEntryPolygon = pEntry->GetLineEnd();
1014 
1015  if(rItemPolygon == rEntryPolygon)
1016  {
1017  // select this entry
1018  m_xLbEndStyle->set_active(a + 1);
1019  bSelected = true;
1020  }
1021  }
1022 
1023  if(!bSelected)
1024  m_xLbEndStyle->set_active(0);
1025  }
1026  else
1027  {
1028  m_xLbEndStyle->set_active(-1);
1029  }
1030 
1031  // Line start strength
1032  if( m_bObjSelected && rAttrs->GetItemState( XATTR_LINESTARTWIDTH ) == SfxItemState::DEFAULT )
1033  {
1034  m_xMtrStartWidth->set_sensitive(false);
1035  }
1036  else if( rAttrs->GetItemState( XATTR_LINESTARTWIDTH ) != SfxItemState::DONTCARE )
1037  {
1039  rAttrs->Get( XATTR_LINESTARTWIDTH ).GetValue(),
1040  m_ePoolUnit );
1041  }
1042  else
1043  m_xMtrStartWidth->set_text( "" );
1044 
1045  // Line end strength
1046  if( m_bObjSelected && rAttrs->GetItemState( XATTR_LINEENDWIDTH ) == SfxItemState::DEFAULT )
1047  {
1048  m_xMtrEndWidth->set_sensitive(false);
1049  }
1050  else if( rAttrs->GetItemState( XATTR_LINEENDWIDTH ) != SfxItemState::DONTCARE )
1051  {
1053  rAttrs->Get( XATTR_LINEENDWIDTH ).GetValue(),
1054  m_ePoolUnit );
1055  }
1056  else
1057  m_xMtrEndWidth->set_text("");
1058 
1059  // Centered line end (start)
1060  if( m_bObjSelected && rAttrs->GetItemState( XATTR_LINESTARTCENTER ) == SfxItemState::DEFAULT )
1061  {
1062  m_xTsbCenterStart->set_sensitive(false);
1063  }
1064  else if( rAttrs->GetItemState( XATTR_LINESTARTCENTER ) != SfxItemState::DONTCARE )
1065  {
1066  if( rAttrs->Get( XATTR_LINESTARTCENTER ).GetValue() )
1067  m_xTsbCenterStart->set_state(TRISTATE_TRUE);
1068  else
1069  m_xTsbCenterStart->set_state(TRISTATE_FALSE);
1070  }
1071  else
1072  {
1073  m_xTsbCenterStart->set_state(TRISTATE_INDET);
1074  }
1075 
1076  // Centered line end (end)
1077  if( m_bObjSelected && rAttrs->GetItemState( XATTR_LINEENDCENTER ) == SfxItemState::DEFAULT )
1078  {
1079  m_xTsbCenterEnd->set_sensitive(false);
1080  }
1081  else if( rAttrs->GetItemState( XATTR_LINEENDCENTER ) != SfxItemState::DONTCARE )
1082  {
1083  if( rAttrs->Get( XATTR_LINEENDCENTER ).GetValue() )
1084  m_xTsbCenterEnd->set_state(TRISTATE_TRUE);
1085  else
1086  m_xTsbCenterEnd->set_state(TRISTATE_FALSE);
1087  }
1088  else
1089  {
1090  m_xTsbCenterEnd->set_state(TRISTATE_INDET);
1091  }
1092 
1093  // Transparency
1094  if( rAttrs->GetItemState( XATTR_LINETRANSPARENCE ) != SfxItemState::DONTCARE )
1095  {
1096  sal_uInt16 nTransp = rAttrs->Get( XATTR_LINETRANSPARENCE ).GetValue();
1097  m_xMtrTransparent->set_value(nTransp, FieldUnit::PERCENT);
1098  ChangeTransparentHdl_Impl(*m_xMtrTransparent);
1099  }
1100  else
1101  m_xMtrTransparent->set_text( "" );
1102 
1103  if( !m_xLbStartStyle->get_sensitive() &&
1104  !m_xLbEndStyle->get_sensitive() &&
1105  !m_xMtrStartWidth->get_sensitive() &&
1106  !m_xMtrEndWidth->get_sensitive() &&
1107  !m_xTsbCenterStart->get_sensitive()&&
1108  !m_xTsbCenterEnd->get_sensitive() )
1109  {
1110  m_xCbxSynchronize->set_sensitive(false);
1111  m_xFlLineEnds->set_sensitive(false);
1112  }
1113 
1114  // Synchronize
1115  // We get the value from the INI file now
1116  OUString aStr = GetUserData();
1117  m_xCbxSynchronize->set_active(aStr.toInt32() != 0);
1118 
1119  if(m_bObjSelected && SfxItemState::DEFAULT == rAttrs->GetItemState(XATTR_LINEJOINT))
1120  {
1121 // maFTEdgeStyle.set_sensitive(false);
1122  m_xLBEdgeStyle->set_sensitive(false);
1123  }
1124  else if(SfxItemState::DONTCARE != rAttrs->GetItemState(XATTR_LINEJOINT))
1125  {
1126  const css::drawing::LineJoint eLineJoint = rAttrs->Get(XATTR_LINEJOINT).GetValue();
1127 
1128  switch(eLineJoint)
1129  {
1130  case css::drawing::LineJoint::LineJoint_MAKE_FIXED_SIZE: // fallback to round, unused value
1131  case css::drawing::LineJoint_ROUND : m_xLBEdgeStyle->set_active(0); break;
1132  case css::drawing::LineJoint_NONE : m_xLBEdgeStyle->set_active(1); break;
1133  case css::drawing::LineJoint_MIDDLE : // fallback to mitre, unused value
1134  case css::drawing::LineJoint_MITER : m_xLBEdgeStyle->set_active(2); break;
1135  case css::drawing::LineJoint_BEVEL : m_xLBEdgeStyle->set_active(3); break;
1136  }
1137  }
1138  else
1139  {
1140  m_xLBEdgeStyle->set_active(-1);
1141  }
1142 
1143  // fdo#43209
1144  if(m_bObjSelected && SfxItemState::DEFAULT == rAttrs->GetItemState(XATTR_LINECAP))
1145  {
1146  m_xLBCapStyle->set_sensitive(false);
1147  }
1148  else if(SfxItemState::DONTCARE != rAttrs->GetItemState(XATTR_LINECAP))
1149  {
1150  const css::drawing::LineCap eLineCap(rAttrs->Get(XATTR_LINECAP).GetValue());
1151 
1152  switch(eLineCap)
1153  {
1154  case css::drawing::LineCap_ROUND: m_xLBCapStyle->set_active(1); break;
1155  case css::drawing::LineCap_SQUARE : m_xLBCapStyle->set_active(2); break;
1156  default /*css::drawing::LineCap_BUTT*/: m_xLBCapStyle->set_active(0); break;
1157  }
1158  }
1159  else
1160  {
1161  m_xLBCapStyle->set_active(-1);
1162  }
1163 
1164  // Save values
1165  m_xLbLineStyle->save_value();
1166  m_xMtrLineWidth->save_value();
1167  m_xLbColor->SaveValue();
1168  m_xLbStartStyle->save_value();
1169  m_xLbEndStyle->save_value();
1170  m_xMtrStartWidth->save_value();
1171  m_xMtrEndWidth->save_value();
1172  m_xTsbCenterStart->save_state();
1173  m_xTsbCenterEnd->save_state();
1174  m_xMtrTransparent->save_value();
1175 
1176  m_xLBEdgeStyle->save_value();
1177 
1178  // LineCaps
1179  m_xLBCapStyle->save_value();
1180 
1182 
1183  ChangePreviewHdl_Impl( nullptr );
1184 }
1185 
1187  const SfxItemSet* rAttrs)
1188 {
1189  return VclPtr<SvxLineTabPage>::Create(pParent, *rAttrs);
1190 }
1191 
1192 IMPL_LINK_NOARG(SvxLineTabPage, ChangePreviewListBoxHdl_Impl, ColorListBox&, void)
1193 {
1194  ChangePreviewHdl_Impl(nullptr);
1195 }
1196 
1197 IMPL_LINK(SvxLineTabPage, ChangePreviewModifyHdl_Impl, weld::MetricSpinButton&, rEdit, void)
1198 {
1199  ChangePreviewHdl_Impl(&rEdit);
1200 }
1201 
1203 {
1204  if (pCntrl == m_xMtrLineWidth.get())
1205  {
1206  // Line width and start end width
1207  sal_Int32 nNewLineWidth = GetCoreValue( *m_xMtrLineWidth, m_ePoolUnit );
1208  if(m_nActLineWidth == -1)
1209  {
1210  // Don't initialize yet, get the start value
1211  const SfxPoolItem* pOld = GetOldItem( m_rXLSet, XATTR_LINEWIDTH );
1212  sal_Int32 nStartLineWidth = 0;
1213  if(pOld)
1214  nStartLineWidth = static_cast<const XLineWidthItem *>(pOld)->GetValue();
1215  m_nActLineWidth = nStartLineWidth;
1216  }
1217 
1218  if(m_nActLineWidth != nNewLineWidth)
1219  {
1220  // Adapt start/end width
1221  sal_Int32 nValAct = GetCoreValue( *m_xMtrStartWidth, m_ePoolUnit );
1222  sal_Int32 nValNew = nValAct + (((nNewLineWidth - m_nActLineWidth) * 15) / 10);
1223  if(nValNew < 0)
1224  nValNew = 0;
1226 
1227  nValAct = GetCoreValue( *m_xMtrEndWidth, m_ePoolUnit );
1228  nValNew = nValAct + (((nNewLineWidth - m_nActLineWidth) * 15) / 10);
1229  if(nValNew < 0)
1230  nValNew = 0;
1232  }
1233 
1234  // Remember current value
1235  m_nActLineWidth = nNewLineWidth;
1236  }
1237 
1238  FillXLSet_Impl();
1239  m_aCtlPreview.Invalidate();
1240 
1241  // Make transparency accessible accordingly
1242  if( m_xLbLineStyle->get_active() == 0 ) // invisible
1243  {
1244  m_xBoxTransparency->set_sensitive(false);
1245  }
1246  else
1247  {
1248  m_xBoxTransparency->set_sensitive(true);
1249  }
1250 
1251  const bool bHasLineStyle = m_xLbLineStyle->get_active() !=0;
1252  const bool bHasLineStart = m_xLbStartStyle->get_active() != 0;
1253 
1254  m_xBoxStart->set_sensitive(bHasLineStart && bHasLineStyle);
1255 
1256  const bool bHasLineEnd = m_xLbEndStyle->get_active() != 0;
1257 
1258  m_xBoxEnd->set_sensitive(bHasLineEnd && bHasLineStyle);
1259 }
1260 
1261 IMPL_LINK_NOARG(SvxLineTabPage, ChangeStartClickHdl_Impl, weld::Button&, void)
1262 {
1263  if (m_xCbxSynchronize->get_active())
1264  m_xTsbCenterEnd->set_state(m_xTsbCenterStart->get_state());
1265  ChangePreviewHdl_Impl(nullptr);
1266 }
1267 
1268 IMPL_LINK_NOARG(SvxLineTabPage, ChangeStartListBoxHdl_Impl, weld::ComboBox&, void)
1269 {
1270  if (m_xCbxSynchronize->get_active())
1271  m_xLbEndStyle->set_active(m_xLbStartStyle->get_active());
1272 
1273  ChangePreviewHdl_Impl(nullptr);
1274 }
1275 
1276 IMPL_LINK_NOARG(SvxLineTabPage, ChangeStartModifyHdl_Impl, weld::MetricSpinButton&, void)
1277 {
1278  if (m_xCbxSynchronize->get_active())
1279  m_xMtrEndWidth->set_value(m_xMtrStartWidth->get_value(FieldUnit::NONE), FieldUnit::NONE);
1280 
1281  ChangePreviewHdl_Impl(nullptr);
1282 }
1283 
1284 IMPL_LINK_NOARG(SvxLineTabPage, ChangeEdgeStyleHdl_Impl, weld::ComboBox&, void)
1285 {
1286  ChangePreviewHdl_Impl( nullptr );
1287 }
1288 
1289 // fdo#43209
1290 IMPL_LINK_NOARG(SvxLineTabPage, ChangeCapStyleHdl_Impl, weld::ComboBox&, void)
1291 {
1292  ChangePreviewHdl_Impl( nullptr );
1293 }
1294 
1295 IMPL_LINK_NOARG(SvxLineTabPage, ClickInvisibleHdl_Impl, weld::ComboBox&, void)
1296 {
1297  ClickInvisibleHdl_Impl();
1298 }
1299 
1301 {
1302  if( m_xLbLineStyle->get_active() == 0 ) // invisible
1303  {
1304  if(!m_bSymbols)
1305  m_xBoxColor->set_sensitive(false);
1306 
1307  m_xBoxWidth->set_sensitive(false);
1308 
1309  if( m_xFlLineEnds->get_sensitive() )
1310  {
1311  m_xBoxStart->set_sensitive(false);
1312  m_xBoxArrowStyles->set_sensitive(false);
1313  m_xGridEdgeCaps->set_sensitive(false);
1314  }
1315  }
1316  else
1317  {
1318  m_xBoxColor->set_sensitive(true);
1319  m_xBoxWidth->set_sensitive(true);
1320 
1321  if (m_xFlLineEnds->get_sensitive())
1322  {
1323  m_xBoxArrowStyles->set_sensitive(true);
1324  m_xGridEdgeCaps->set_sensitive(true);
1325  }
1326  }
1327  ChangePreviewHdl_Impl( nullptr );
1328 }
1329 
1330 IMPL_LINK_NOARG(SvxLineTabPage, ChangeEndClickHdl_Impl, weld::Button&, void)
1331 {
1332  if (m_xCbxSynchronize->get_active())
1333  m_xTsbCenterStart->set_state(m_xTsbCenterEnd->get_state());
1334 
1335  ChangePreviewHdl_Impl(nullptr);
1336 }
1337 
1338 IMPL_LINK_NOARG(SvxLineTabPage, ChangeEndListBoxHdl_Impl, weld::ComboBox&, void)
1339 {
1340  if (m_xCbxSynchronize->get_active())
1341  m_xLbStartStyle->set_active(m_xLbEndStyle->get_active());
1342 
1343  ChangePreviewHdl_Impl(nullptr);
1344 }
1345 
1346 IMPL_LINK_NOARG(SvxLineTabPage, ChangeEndModifyHdl_Impl, weld::MetricSpinButton&, void)
1347 {
1348  if (m_xCbxSynchronize->get_active())
1349  m_xMtrStartWidth->set_value(m_xMtrEndWidth->get_value(FieldUnit::NONE), FieldUnit::NONE);
1350 
1351  ChangePreviewHdl_Impl(nullptr);
1352 }
1353 
1354 IMPL_LINK_NOARG(SvxLineTabPage, ChangeTransparentHdl_Impl, weld::MetricSpinButton&, void)
1355 {
1356  sal_uInt16 nVal = m_xMtrTransparent->get_value(FieldUnit::PERCENT);
1357 
1358  m_rXLSet.Put(XLineTransparenceItem(nVal));
1359 
1360  FillXLSet_Impl();
1361 
1362  m_aCtlPreview.Invalidate();
1363 }
1364 
1366 {
1367  // Write the synched value to the INI file
1368  OUString aStrUserData = OUString::boolean(m_xCbxSynchronize->get_active());
1369  SetUserData( aStrUserData );
1370 }
1371 
1372 // #58425# Symbols on a list (e.g. StarChart)
1373 // Handler for the symbol selection's popup menu (NumMenueButton)
1374 // The following link originates from SvxNumOptionsTabPage
1376 {
1378 
1379  // Initialize popup
1380  if (!m_xGalleryMenu)
1381  {
1382  m_xGalleryMenu = m_xBuilder->weld_menu("gallerysubmenu");
1383  weld::WaitObject aWait(GetDialogFrameWeld());
1384  // Get gallery entries
1386 
1387  sal_uInt32 i = 0;
1388  for (auto const& grfName : m_aGrfNames)
1389  {
1390  const OUString *pUIName = &grfName;
1391 
1392  // Convert URL encodings to UI characters (e.g. %20 for spaces)
1393  OUString aPhysicalName;
1394  if (osl::FileBase::getSystemPathFromFileURL(grfName, aPhysicalName)
1395  == osl::FileBase::E_None)
1396  {
1397  pUIName = &aPhysicalName;
1398  }
1399 
1400  SvxBmpItemInfo* pInfo = new SvxBmpItemInfo;
1401  pInfo->pBrushItem.reset(new SvxBrushItem(grfName, "", GPOS_AREA, SID_ATTR_BRUSH));
1402  pInfo->sItemId = "gallery" + OUString::number(i);
1403  m_aGalleryBrushItems.emplace_back(pInfo);
1404  const Graphic* pGraphic = pInfo->pBrushItem->GetGraphic();
1405 
1406  if(pGraphic)
1407  {
1408  BitmapEx aBitmap(pGraphic->GetBitmapEx());
1409  Size aSize(aBitmap.GetSizePixel());
1410  if(aSize.Width() > MAX_BMP_WIDTH || aSize.Height() > MAX_BMP_HEIGHT)
1411  {
1412  bool bWidth = aSize.Width() > aSize.Height();
1413  double nScale = bWidth ?
1414  double(MAX_BMP_WIDTH) / static_cast<double>(aSize.Width()):
1415  double(MAX_BMP_HEIGHT) / static_cast<double>(aSize.Height());
1416  aBitmap.Scale(nScale, nScale);
1417 
1418  }
1419  pVD->SetOutputSizePixel(aBitmap.GetSizePixel());
1420  pVD->DrawBitmapEx(Point(), aBitmap);
1421  m_xGalleryMenu->append(pInfo->sItemId, *pUIName, *pVD);
1422  }
1423  else
1424  {
1425  m_xGalleryMenu->append(pInfo->sItemId, *pUIName);
1426  }
1427  ++i;
1428  }
1429 
1430  if (m_aGrfNames.empty())
1431  m_xSymbolMB->set_item_sensitive("gallery", false);
1432  }
1433 
1434  if (!m_xSymbolsMenu && m_pSymbolList)
1435  {
1436  m_xSymbolsMenu = m_xBuilder->weld_menu("symbolssubmenu");
1438  pVDev->SetMapMode(MapMode(MapUnit::Map100thMM));
1439  std::unique_ptr<SdrModel> pModel(
1440  new SdrModel(nullptr, nullptr, true));
1441  pModel->GetItemPool().FreezeIdRanges();
1442  // Page
1443  SdrPage* pPage = new SdrPage( *pModel, false );
1444  pPage->SetSize(Size(1000,1000));
1445  pModel->InsertPage( pPage, 0 );
1446  {
1447  // 3D View
1448  std::unique_ptr<SdrView> pView(new SdrView( *pModel, pVDev ));
1449  pView->hideMarkHandles();
1450  pView->ShowSdrPage(pPage);
1451 
1452  // Generate invisible square to give all symbols a
1453  // bitmap size, which is independent from specific glyph
1454  SdrObject *pInvisibleSquare=m_pSymbolList->GetObj(0);
1455 
1456  // directly clone to target SdrModel
1457  pInvisibleSquare = pInvisibleSquare->CloneSdrObject(*pModel);
1458 
1459  pPage->NbcInsertObject(pInvisibleSquare);
1460  pInvisibleSquare->SetMergedItem(XFillTransparenceItem(100));
1461  pInvisibleSquare->SetMergedItem(XLineTransparenceItem(100));
1462 
1463  for(size_t i=0;; ++i)
1464  {
1465  SdrObject *pObj=m_pSymbolList->GetObj(i);
1466  if(pObj==nullptr)
1467  break;
1468 
1469  // directly clone to target SdrModel
1470  pObj = pObj->CloneSdrObject(*pModel);
1471 
1472  m_aGrfNames.emplace_back("");
1473  pPage->NbcInsertObject(pObj);
1474  if(m_pSymbolAttr)
1475  {
1476  pObj->SetMergedItemSet(*m_pSymbolAttr);
1477  }
1478  else
1479  {
1480  pObj->SetMergedItemSet(m_rOutAttrs);
1481  }
1482  pView->MarkAll();
1483  BitmapEx aBitmapEx(pView->GetMarkedObjBitmapEx());
1484  GDIMetaFile aMeta(pView->GetMarkedObjMetaFile());
1485  pView->UnmarkAll();
1486  pObj=pPage->RemoveObject(1);
1487  SdrObject::Free(pObj);
1488 
1489  SvxBmpItemInfo* pInfo = new SvxBmpItemInfo;
1490  pInfo->pBrushItem.reset(new SvxBrushItem(Graphic(aMeta), GPOS_AREA, SID_ATTR_BRUSH));
1491  pInfo->sItemId = "symbol" + OUString::number(i);
1492  m_aSymbolBrushItems.emplace_back(pInfo);
1493 
1494  Size aSize(aBitmapEx.GetSizePixel());
1495  if(aSize.Width() > MAX_BMP_WIDTH || aSize.Height() > MAX_BMP_HEIGHT)
1496  {
1497  bool bWidth = aSize.Width() > aSize.Height();
1498  double nScale = bWidth ?
1499  double(MAX_BMP_WIDTH) / static_cast<double>(aSize.Width()):
1500  double(MAX_BMP_HEIGHT) / static_cast<double>(aSize.Height());
1501  aBitmapEx.Scale(nScale, nScale);
1502  }
1503  pVD->SetOutputSizePixel(aBitmapEx.GetSizePixel());
1504  pVD->DrawBitmapEx(Point(), aBitmapEx);
1505  m_xSymbolsMenu->append(pInfo->sItemId, "", *pVD);
1506  }
1507  pInvisibleSquare=pPage->RemoveObject(0);
1508  SdrObject::Free(pInvisibleSquare);
1509 
1510  if (m_aGrfNames.empty())
1511  m_xSymbolMB->set_item_sensitive("symbols", false);
1512  }
1513  }
1514 }
1515 
1516 // #58425# Symbols on a list (e.g. StarChart)
1517 // Handler for menu button
1518 IMPL_LINK(SvxLineTabPage, GraphicHdl_Impl, const OString&, rIdent, void)
1519 {
1520  const Graphic* pGraphic = nullptr;
1521  Graphic aGraphic;
1522  bool bResetSize = false;
1523  bool bEnable = true;
1524  long nPreviousSymbolType = m_nSymbolType;
1525 
1526  OString sNumber;
1527  if (rIdent.startsWith("gallery", &sNumber))
1528  {
1529  SvxBmpItemInfo* pInfo = m_aGalleryBrushItems[sNumber.toUInt32()].get();
1530  pGraphic = pInfo->pBrushItem->GetGraphic();
1531  m_nSymbolType = SVX_SYMBOLTYPE_BRUSHITEM;
1532  }
1533  else if (rIdent.startsWith("symbol", &sNumber))
1534  {
1535  m_nSymbolType = sNumber.toUInt32();
1536  SvxBmpItemInfo* pInfo = m_aSymbolBrushItems[m_nSymbolType].get();
1537  pGraphic = pInfo->pBrushItem->GetGraphic();
1538  }
1539  else if (rIdent == "automatic")
1540  {
1541  pGraphic=&m_aAutoSymbolGraphic;
1542  m_aAutoSymbolGraphic.SetPrefSize( Size(253,253) );
1543  m_nSymbolType=SVX_SYMBOLTYPE_AUTO;
1544  }
1545  else if (rIdent == "none")
1546  {
1547  m_nSymbolType=SVX_SYMBOLTYPE_NONE;
1548  pGraphic=nullptr;
1549  bEnable = false;
1550  }
1551  else if (rIdent == "file")
1552  {
1553  SvxOpenGraphicDialog aGrfDlg(CuiResId(RID_SVXSTR_EDIT_GRAPHIC), GetDialogFrameWeld());
1554  aGrfDlg.EnableLink(false);
1555  aGrfDlg.AsLink(false);
1556  if( !aGrfDlg.Execute() )
1557  {
1558  // Remember selected filters
1559  if( !aGrfDlg.GetGraphic(aGraphic) )
1560  {
1561  m_nSymbolType=SVX_SYMBOLTYPE_BRUSHITEM;
1562  pGraphic = &aGraphic;
1563  bResetSize = true;
1564  }
1565  }
1566  if( !pGraphic )
1567  return;
1568  }
1569 
1570  if (pGraphic)
1571  {
1572  Size aSize = SvxNumberFormat::GetGraphicSizeMM100(pGraphic);
1573  aSize = OutputDevice::LogicToLogic(aSize, MapMode(MapUnit::Map100thMM), MapMode(m_ePoolUnit));
1574  m_aSymbolGraphic=*pGraphic;
1575  if( bResetSize )
1576  {
1577  m_aSymbolSize=aSize;
1578  }
1579  else if( nPreviousSymbolType == SVX_SYMBOLTYPE_BRUSHITEM )
1580  { //#i31097# Data Point Symbol size changes when a different symbol is chosen(maoyg)
1581  if( m_aSymbolSize.Width() != m_aSymbolSize.Height() )
1582  {
1583  aSize.setWidth( static_cast<long>( m_aSymbolSize.Width() + m_aSymbolSize.Height() )/2 );
1584  aSize.setHeight( static_cast<long>( m_aSymbolSize.Width() + m_aSymbolSize.Height() )/2 );
1585  m_aSymbolSize = aSize;
1586  }
1587  }
1588  m_aCtlPreview.SetSymbol(&m_aSymbolGraphic,m_aSymbolSize);
1589  }
1590  else
1591  {
1592  m_aSymbolGraphic=Graphic();
1593  m_aCtlPreview.SetSymbol(nullptr,m_aSymbolSize);
1594  bEnable = false;
1595  }
1596  m_aSymbolLastSize=m_aSymbolSize;
1597  SetMetricValue(*m_xSymbolWidthMF, m_aSymbolSize.Width(), m_ePoolUnit);
1598  SetMetricValue(*m_xSymbolHeightMF, m_aSymbolSize.Height(), m_ePoolUnit);
1599 
1600  m_xGridIconSize->set_sensitive(bEnable);
1601  m_aCtlPreview.Invalidate();
1602 }
1603 
1604 IMPL_LINK( SvxLineTabPage, SizeHdl_Impl, weld::MetricSpinButton&, rField, void)
1605 {
1606  m_bNewSize = true;
1607  bool bWidth = &rField == m_xSymbolWidthMF.get();
1608  m_bLastWidthModified = bWidth;
1609  bool bRatio = m_xSymbolRatioCB->get_active();
1610  long nWidthVal = static_cast<long>(m_xSymbolWidthMF->denormalize(m_xSymbolWidthMF->get_value(FieldUnit::MM_100TH)));
1611  long nHeightVal= static_cast<long>(m_xSymbolHeightMF->denormalize(m_xSymbolHeightMF->get_value(FieldUnit::MM_100TH)));
1612  nWidthVal = OutputDevice::LogicToLogic(nWidthVal,MapUnit::Map100thMM, m_ePoolUnit );
1613  nHeightVal = OutputDevice::LogicToLogic(nHeightVal,MapUnit::Map100thMM, m_ePoolUnit);
1614  m_aSymbolSize = Size(nWidthVal,nHeightVal);
1615  double fSizeRatio = double(1);
1616 
1617  if(bRatio)
1618  {
1619  if (m_aSymbolLastSize.Height() && m_aSymbolLastSize.Width())
1620  fSizeRatio = static_cast<double>(m_aSymbolLastSize.Width()) / m_aSymbolLastSize.Height();
1621  }
1622 
1623  if (bWidth)
1624  {
1625  long nDelta = nWidthVal - m_aSymbolLastSize.Width();
1626  m_aSymbolSize.setWidth( nWidthVal );
1627  if (bRatio)
1628  {
1629  m_aSymbolSize.setHeight( m_aSymbolLastSize.Height() + static_cast<long>(static_cast<double>(nDelta) / fSizeRatio) );
1630  m_aSymbolSize.setHeight( OutputDevice::LogicToLogic( m_aSymbolSize.Height(), m_ePoolUnit, MapUnit::Map100thMM ) );
1631 //TODO m_xSymbolHeightMF->SetUserValue(m_xSymbolHeightMF->normalize(m_aSymbolSize.Height()), FieldUnit::MM_100TH);
1632  m_xSymbolHeightMF->set_value(m_xSymbolHeightMF->normalize(m_aSymbolSize.Height()), FieldUnit::MM_100TH);
1633  }
1634  }
1635  else
1636  {
1637  long nDelta = nHeightVal - m_aSymbolLastSize.Height();
1638  m_aSymbolSize.setHeight( nHeightVal );
1639  if (bRatio)
1640  {
1641  m_aSymbolSize.setWidth( m_aSymbolLastSize.Width() + static_cast<long>(static_cast<double>(nDelta) * fSizeRatio) );
1642  m_aSymbolSize.setWidth( OutputDevice::LogicToLogic( m_aSymbolSize.Width(), m_ePoolUnit, MapUnit::Map100thMM ) );
1643 //TODO m_xSymbolWidthMF->SetUserValue(m_xSymbolWidthMF->normalize(m_aSymbolSize.Width()), FieldUnit::MM_100TH);
1644  m_xSymbolWidthMF->set_value(m_xSymbolWidthMF->normalize(m_aSymbolSize.Width()), FieldUnit::MM_100TH);
1645  }
1646  }
1647  m_aCtlPreview.ResizeSymbol(m_aSymbolSize);
1648  m_aSymbolLastSize=m_aSymbolSize;
1649 }
1650 
1651 IMPL_LINK(SvxLineTabPage, RatioHdl_Impl, weld::ToggleButton&, rBox, void)
1652 {
1653  if (rBox.get_active())
1654  {
1655  if (m_bLastWidthModified)
1656  SizeHdl_Impl(*m_xSymbolWidthMF);
1657  else
1658  SizeHdl_Impl(*m_xSymbolHeightMF);
1659  }
1660 }
1661 
1663 {
1664  SfxTabPage::DataChanged( rDCEvt );
1665 
1666  if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) && (rDCEvt.GetFlags() & AllSettingsFlags::STYLE) )
1667  {
1668  FillListboxes();
1669  }
1670 }
1671 
1673 {
1674  const SvxDashListItem* pDashListItem = aSet.GetItem<SvxDashListItem>(SID_DASH_LIST, false);
1675  const SvxLineEndListItem* pLineEndListItem = aSet.GetItem<SvxLineEndListItem>(SID_LINEEND_LIST, false);
1676  const SfxUInt16Item* pPageTypeItem = aSet.GetItem<SfxUInt16Item>(SID_PAGE_TYPE, false);
1677  const SfxUInt16Item* pDlgTypeItem = aSet.GetItem<SfxUInt16Item>(SID_DLG_TYPE, false);
1678  const OfaPtrItem* pSdrObjListItem = aSet.GetItem<OfaPtrItem>(SID_OBJECT_LIST, false);
1679  const SfxTabDialogItem* pSymbolAttrItem = aSet.GetItem<SfxTabDialogItem>(SID_ATTR_SET, false);
1680  const SvxGraphicItem* pGraphicItem = aSet.GetItem<SvxGraphicItem>(SID_GRAPHIC, false);
1681 
1682  if (pDashListItem)
1683  SetDashList(pDashListItem->GetDashList());
1684  if (pLineEndListItem)
1685  SetLineEndList(pLineEndListItem->GetLineEndList());
1686  if (pPageTypeItem)
1687  SetPageType(static_cast<PageType>(pPageTypeItem->GetValue()));
1688  if (pDlgTypeItem)
1689  SetDlgType(pDlgTypeItem->GetValue());
1690  Construct();
1691 
1692  if(pSdrObjListItem) //symbols
1693  {
1694  ShowSymbolControls(true);
1695  m_pSymbolList = static_cast<SdrObjList*>(pSdrObjListItem->GetValue());
1696  if (pSymbolAttrItem)
1697  m_pSymbolAttr = new SfxItemSet(pSymbolAttrItem->GetItemSet());
1698  if(pGraphicItem)
1699  m_aAutoSymbolGraphic = pGraphicItem->GetGraphic();
1700  }
1701 }
1702 
1703 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
long Width() const
SdrObjList * m_pSymbolList
a list of symbols to be shown in menu.
Definition: cuitabline.hxx:97
std::unique_ptr< SvxBrushItem > pBrushItem
Definition: cuitabline.hxx:84
void SetFieldUnit(weld::MetricSpinButton &rField, FieldUnit eUnit, bool bAll)
#define XATTR_LINESTARTCENTER
std::pair< Color, OUString > NamedColor
sal_Int32 m_nActLineWidth
Definition: cuitabline.hxx:135
FieldUnit
static bool FillObjList(const OUString &rThemeName, std::vector< OUString > &rObjList)
ErrCode GetGraphic(Graphic &) const
virtual void SetSize(const Size &aSiz)
#define SVX_SYMBOLTYPE_BRUSHITEM
sal_uInt16 m_nDlgType
Definition: cuitabline.hxx:129
void SetUserData(const OUString &rString)
sal_Int32 * m_pPosDashLb
Definition: cuitabline.hxx:130
std::unique_ptr< weld::Widget > m_xFlLineEnds
Definition: cuitabline.hxx:145
std::string GetValue
Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
SvxXLinePreview m_aCtlPreview
Definition: cuitabline.hxx:137
#define XATTR_LINEENDWIDTH
std::unique_ptr< weld::Widget > m_xBoxWidth
Definition: cuitabline.hxx:141
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: tpline.cxx:1672
long Height() const
std::unique_ptr< weld::Widget > m_xFlSymbol
Definition: cuitabline.hxx:165
std::unique_ptr< weld::MenuButton > m_xSymbolMB
Definition: cuitabline.hxx:167
virtual void NbcInsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
virtual void FillUserData() override
Definition: tpline.cxx:1365
std::unique_ptr< weld::Widget > m_xBoxEnd
Definition: cuitabline.hxx:151
std::unique_ptr< SvxLineLB > m_xLbLineStyle
Definition: cuitabline.hxx:139
std::unique_ptr< weld::MetricSpinButton > m_xMtrLineWidth
Definition: cuitabline.hxx:142
SdrObject * GetObj(size_t nNum) const
size_t GetObjCount() const
sal_uInt16 GetValue() const
virtual void Reset(const SfxItemSet *) override
Definition: tpline.cxx:790
#define SVX_SYMBOLTYPE_UNKNOWN
Graphic m_aSymbolGraphic
Definition: cuitabline.hxx:112
std::unique_ptr< weld::MetricSpinButton > m_xMtrEndWidth
Definition: cuitabline.hxx:153
std::unique_ptr< weld::MetricSpinButton > m_xMtrTransparent
Definition: cuitabline.hxx:144
MapUnit m_ePoolUnit
Definition: cuitabline.hxx:133
DataChangedEventType GetType() const
PageType
void SetPageType(PageType nInType)
Definition: cuitabline.hxx:226
std::unique_ptr< weld::Widget > m_xBoxArrowStyles
Definition: cuitabline.hxx:146
static void Free(SdrObject *&_rpObject)
void SetLineAttributes(const SfxItemSet &rItemSet)
XDashListRef m_pDashList
Definition: cuitabline.hxx:122
TRISTATE_TRUE
static Size GetGraphicSizeMM100(const Graphic *pGraphic)
FieldUnit GetModuleFieldUnit(const SfxItemSet &rSet)
virtual const tools::Rectangle & GetSnapRect() const
virtual MapUnit GetMetric(sal_uInt16 nWhich) const
#define SVX_SYMBOLTYPE_NONE
std::unique_ptr< weld::CheckButton > m_xTsbCenterEnd
Definition: cuitabline.hxx:154
#define MAX_BMP_HEIGHT
Definition: tpline.cxx:68
#define XATTR_LINECAP
std::unique_ptr< ColorListBox > m_xLbColor
Definition: cuitabline.hxx:140
#define XATTR_LINEJOINT
virtual void dispose() override
Definition: tpline.cxx:213
Graphic m_aAutoSymbolGraphic
a graphic to be displayed in the preview in case that an automatic symbol is chosen ...
Definition: cuitabline.hxx:100
virtual bool FillItemSet(SfxItemSet *) override
Definition: tpline.cxx:385
OUString SvxResId(const char *pId)
std::unique_ptr< weld::Widget > m_xBoxTransparency
Definition: cuitabline.hxx:143
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
Definition: tpline.cxx:1662
void SetExchangeSupport()
weld::Window * GetFrameWeld(SfxFrame *pFrame)
AllSettingsFlags GetFlags() const
const OUString & GetUserData() const
void SetMergedItemSet(const SfxItemSet &rSet, bool bClearAllItems=false)
std::unique_ptr< weld::Widget > m_xGridEdgeCaps
Definition: cuitabline.hxx:159
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: tpline.cxx:366
std::unique_ptr< weld::Widget > m_xBoxStart
Definition: cuitabline.hxx:148
void ShowSymbol(bool b)
std::unique_ptr< weld::Widget > m_xFLEdgeStyle
Definition: cuitabline.hxx:158
virtual void dispose() override
TRISTATE_INDET
std::unique_ptr< SvxLineEndLB > m_xLbStartStyle
Definition: cuitabline.hxx:147
std::unique_ptr< weld::MetricSpinButton > m_xSymbolHeightMF
Definition: cuitabline.hxx:171
ChangeType * m_pnLineEndListState
Definition: cuitabline.hxx:125
#define XATTR_LINEENDCENTER
void ShowSymbolControls(bool bOn)
Definition: tpline.cxx:199
IMPL_LINK_NOARG(SvxLineTabPage, ChangePreviewListBoxHdl_Impl, ColorListBox &, void)
Definition: tpline.cxx:1192
SfxItemSet * m_pSymbolAttr
attributes for the shown symbols; only necessary if not equal to line properties
Definition: cuitabline.hxx:103
XLineEndListRef m_pLineEndList
Definition: cuitabline.hxx:123
const SfxPoolItem * GetOldItem(const SfxItemSet &rSet, sal_uInt16 nSlot, bool bDeep=true)
const XDashListRef & GetDashList() const
SfxItemSet & m_rXLSet
Definition: cuitabline.hxx:120
void Construct()
Definition: tpline.cxx:226
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
#define DBG_ASSERT(sCon, aError)
bool Append(OUString const &rTheSegment, EncodeMechanism eMechanism=EncodeMechanism::WasEncoded, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
ChangeType * m_pnColorListState
Definition: cuitabline.hxx:127
void SetDlgType(sal_uInt16 nInType)
Definition: cuitabline.hxx:227
XLineAttrSetItem m_aXLineAttr
Definition: cuitabline.hxx:119
void ChangePreviewHdl_Impl(const weld::MetricSpinButton *)
Definition: tpline.cxx:1202
int i
TRISTATE_FALSE
int GetCoreValue(const weld::MetricSpinButton &rField, MapUnit eUnit)
static VclPtr< SfxTabPage > Create(TabPageParent, const SfxItemSet *)
Definition: tpline.cxx:1186
void FillXLSet_Impl()
Definition: tpline.cxx:669
std::unique_ptr< weld::MetricSpinButton > m_xSymbolWidthMF
Definition: cuitabline.hxx:170
void SetDashList(XDashListRef const &pDshLst)
Definition: cuitabline.hxx:222
const SfxItemSet * GetItemSet(const SfxPoolItem &rAttr)
std::vector< std::unique_ptr< SvxBmpItemInfo > > m_aSymbolBrushItems
Definition: cuitabline.hxx:109
GPOS_MM
#define XATTR_LINESTYLE
void ClickInvisibleHdl_Impl()
Definition: tpline.cxx:1300
virtual ~SvxLineTabPage() override
Definition: tpline.cxx:208
void SetMergedItem(const SfxPoolItem &rItem)
BitmapEx GetBitmapEx(const GraphicConversionParameters &rParameters=GraphicConversionParameters()) const
GPOS_AREA
void SetMetricValue(weld::MetricSpinButton &rField, int nCoreValue, MapUnit eUnit)
std::unique_ptr< weld::ComboBox > m_xLBEdgeStyle
Definition: cuitabline.hxx:160
SfxItemPool * GetPool() const
virtual SdrObject * RemoveObject(size_t nObjNum)
#define XATTR_LINEDASH
OUString CuiResId(const char *pKey)
Definition: cuiresmgr.cxx:23
#define MAX_BMP_WIDTH
Definition: tpline.cxx:67
Size GetSize() const
void SetLineEndList(XLineEndListRef const &pLneEndLst)
Definition: cuitabline.hxx:223
std::unique_ptr< weld::CheckButton > m_xSymbolRatioCB
Definition: cuitabline.hxx:172
const SfxItemSet & m_rOutAttrs
Definition: cuitabline.hxx:116
Size GetPrefSize() const
#define XATTR_LINEWIDTH
const basegfx::B2DPolyPolygon & GetLineEnd() const
static const sal_uInt16 pLineRanges[]
Definition: cuitabline.hxx:92
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
weld::Entry & rEdit
SvxLineTabPage(TabPageParent pParent, const SfxItemSet &rInAttrs)
Definition: tpline.cxx:83
std::unique_ptr< weld::MetricSpinButton > m_xMtrStartWidth
Definition: cuitabline.hxx:149
void SetSymbol(Graphic *p, const Size &s)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
MapMode GetPrefMapMode() const
#define SVX_SYMBOLTYPE_AUTO
void FillListboxes()
Definition: tpline.cxx:231
#define XATTR_LINEEND
static VclPtr< reference_type > Create(Arg &&...arg)
std::unique_ptr< weld::Widget > m_xGridIconSize
Definition: cuitabline.hxx:166
std::unique_ptr< weld::ComboBox > m_xLBCapStyle
Definition: cuitabline.hxx:163
virtual SdrObject * CloneSdrObject(SdrModel &rTargetModel) const
ChangeType * m_pnDashListState
Definition: cuitabline.hxx:126
const OUString PERCENT("Percent")
SfxOkDialogController * GetDialogController() const
virtual void ActivatePage(const SfxItemSet &rSet) override
Definition: tpline.cxx:253
IMPL_LINK(SvxLineTabPage, ChangePreviewModifyHdl_Impl, weld::MetricSpinButton &, rEdit, void)
Definition: tpline.cxx:1197
std::unique_ptr< weld::CustomWeld > m_xCtlPreview
Definition: cuitabline.hxx:156
void SetPrefSize(const Size &rPrefSize)
std::unique_ptr< weld::Widget > m_xBoxColor
Definition: cuitabline.hxx:138
DeactivateRC
#define XATTR_LINESTARTWIDTH
PageType m_nPageType
Definition: cuitabline.hxx:128
Size m_aSymbolLastSize
Definition: cuitabline.hxx:111
#define XATTR_LINECOLOR
std::unique_ptr< weld::CheckButton > m_xCbxSynchronize
Definition: cuitabline.hxx:155
std::vector< std::unique_ptr< SvxBmpItemInfo > > m_aGalleryBrushItems
Definition: cuitabline.hxx:107
TriState
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
sal_Int32 nPos
void setWidth(long nWidth)
#define XATTR_LINETRANSPARENCE
aStr
std::unique_ptr< SvxLineEndLB > m_xLbEndStyle
Definition: cuitabline.hxx:152
OUString sItemId
Definition: cuitabline.hxx:85
sal_Int32 * m_pPosLineEndLb
Definition: cuitabline.hxx:131
#define XATTR_LINESTART
std::unique_ptr< weld::CheckButton > m_xTsbCenterStart
Definition: cuitabline.hxx:150
void setHeight(long nHeight)