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