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/svxgraphicitem.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<tools::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<tools::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<tools::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;
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  size_t nSymTmp = static_cast<size_t>(nSymType);
831  if(m_pSymbolList)
832  {
834  {
835  nSymTmp %= m_pSymbolList->GetObjCount(); // Treat list as cyclic!
836  SdrObject *pObj=m_pSymbolList->GetObj(nSymTmp);
837  if(pObj)
838  {
839  // directly clone to target SdrModel
840  pObj = pObj->CloneSdrObject(*pModel);
841 
842  if(m_pSymbolAttr)
843  {
845  }
846  else
847  {
849  }
850 
851  pPage->NbcInsertObject(pObj);
852 
853  // Generate invisible square to give all symbol types a
854  // bitmap size, which is independent from specific glyph
855  SdrObject* pInvisibleSquare(m_pSymbolList->GetObj(0));
856 
857  // directly clone to target SdrModel
858  pInvisibleSquare = pInvisibleSquare->CloneSdrObject(*pModel);
859 
860  pPage->NbcInsertObject(pInvisibleSquare);
861  pInvisibleSquare->SetMergedItem(XFillTransparenceItem(100));
862  pInvisibleSquare->SetMergedItem(XLineTransparenceItem(100));
863 
864  pView->MarkAll();
865  GDIMetaFile aMeta(pView->GetMarkedObjMetaFile());
866 
867  m_aSymbolGraphic=Graphic(aMeta);
869  m_aSymbolGraphic.SetPrefSize(pInvisibleSquare->GetSnapRect().GetSize());
870  m_aSymbolGraphic.SetPrefMapMode(MapMode(MapUnit::Map100thMM));
871  bPrevSym=true;
872  bEnable=true;
873  bIgnoreGraphic=true;
874 
875  pView->UnmarkAll();
876  pInvisibleSquare=pPage->RemoveObject(1);
877  SdrObject::Free( pInvisibleSquare);
878  pObj=pPage->RemoveObject(0);
879  SdrObject::Free( pObj );
880  }
881  }
882  }
883  }
884  }
885  if(rAttrs->GetItemState(rAttrs->GetPool()->GetWhich(SID_ATTR_BRUSH),true,&pPoolItem) == SfxItemState::SET)
886  {
887  const Graphic* pGraphic = static_cast<const SvxBrushItem *>(pPoolItem)->GetGraphic();
888  if( pGraphic )
889  {
890  if(!bIgnoreGraphic)
891  {
892  m_aSymbolGraphic=*pGraphic;
893  }
894  if(!bIgnoreSize)
895  {
897  pGraphic->GetPrefMapMode(),
898  MapMode(MapUnit::Map100thMM));
899  }
900  bPrevSym=true;
901  }
902  }
903 
904  if(rAttrs->GetItemState(rAttrs->GetPool()->GetWhich(SID_ATTR_SYMBOLSIZE),true,&pPoolItem) == SfxItemState::SET)
905  {
906  m_aSymbolSize = static_cast<const SvxSizeItem *>(pPoolItem)->GetSize();
907  }
908 
909  m_xGridIconSize->set_sensitive(bEnable);
910 
911  if(bPrevSym)
912  {
917  }
918 
919  if( rAttrs->GetItemState( XATTR_LINESTYLE ) != SfxItemState::DONTCARE )
920  {
921  eXLS = rAttrs->Get( XATTR_LINESTYLE ).GetValue();
922 
923  switch( eXLS )
924  {
925  case drawing::LineStyle_NONE:
926  m_xLbLineStyle->set_active(0);
927  break;
928  case drawing::LineStyle_SOLID:
929  m_xLbLineStyle->set_active(1);
930  break;
931 
932  case drawing::LineStyle_DASH:
933  m_xLbLineStyle->set_active(-1);
934  m_xLbLineStyle->set_active_text(rAttrs->Get( XATTR_LINEDASH ).GetName());
935  break;
936 
937  default:
938  break;
939  }
940  }
941  else
942  {
943  m_xLbLineStyle->set_active(-1);
944  }
945 
946  // Line strength
947  if( rAttrs->GetItemState( XATTR_LINEWIDTH ) != SfxItemState::DONTCARE )
948  {
949  SetMetricValue( *m_xMtrLineWidth, rAttrs->Get( XATTR_LINEWIDTH ).GetValue(), m_ePoolUnit );
950  }
951  else
952  m_xMtrLineWidth->set_text("");
953 
954  // Line color
955  m_xLbColor->SetNoSelection();
956 
957  if ( rAttrs->GetItemState( XATTR_LINECOLOR ) != SfxItemState::DONTCARE )
958  {
959  Color aCol = rAttrs->Get( XATTR_LINECOLOR ).GetColorValue();
960  m_xLbColor->SelectEntry( aCol );
961  }
962 
963  // Line start
964  if( m_bObjSelected && rAttrs->GetItemState( XATTR_LINESTART ) == SfxItemState::DEFAULT )
965  {
966  m_xLbStartStyle->set_sensitive(false);
967  }
968  else if( rAttrs->GetItemState( XATTR_LINESTART ) != SfxItemState::DONTCARE )
969  {
970  // #86265# select entry using list and polygon, not string
971  bool bSelected(false);
972  const basegfx::B2DPolyPolygon& rItemPolygon = rAttrs->Get(XATTR_LINESTART).GetLineStartValue();
973 
974  for(tools::Long a(0);!bSelected && a < m_pLineEndList->Count(); a++)
975  {
976  const XLineEndEntry* pEntry = m_pLineEndList->GetLineEnd(a);
977  const basegfx::B2DPolyPolygon& rEntryPolygon = pEntry->GetLineEnd();
978 
979  if(rItemPolygon == rEntryPolygon)
980  {
981  // select this entry
982  m_xLbStartStyle->set_active(a + 1);
983  bSelected = true;
984  }
985  }
986 
987  if(!bSelected)
988  m_xLbStartStyle->set_active(0);
989  }
990  else
991  {
992  m_xLbStartStyle->set_active(-1);
993  }
994 
995  // Line end
996  if( m_bObjSelected && rAttrs->GetItemState( XATTR_LINEEND ) == SfxItemState::DEFAULT )
997  {
998  m_xLbEndStyle->set_sensitive(false);
999  }
1000  else if( rAttrs->GetItemState( XATTR_LINEEND ) != SfxItemState::DONTCARE )
1001  {
1002  // #86265# select entry using list and polygon, not string
1003  bool bSelected(false);
1004  const basegfx::B2DPolyPolygon& rItemPolygon = rAttrs->Get(XATTR_LINEEND).GetLineEndValue();
1005 
1006  for(tools::Long a(0);!bSelected && a < m_pLineEndList->Count(); a++)
1007  {
1008  const XLineEndEntry* pEntry = m_pLineEndList->GetLineEnd(a);
1009  const basegfx::B2DPolyPolygon& rEntryPolygon = pEntry->GetLineEnd();
1010 
1011  if(rItemPolygon == rEntryPolygon)
1012  {
1013  // select this entry
1014  m_xLbEndStyle->set_active(a + 1);
1015  bSelected = true;
1016  }
1017  }
1018 
1019  if(!bSelected)
1020  m_xLbEndStyle->set_active(0);
1021  }
1022  else
1023  {
1024  m_xLbEndStyle->set_active(-1);
1025  }
1026 
1027  // Line start strength
1028  if( m_bObjSelected && rAttrs->GetItemState( XATTR_LINESTARTWIDTH ) == SfxItemState::DEFAULT )
1029  {
1030  m_xMtrStartWidth->set_sensitive(false);
1031  }
1032  else if( rAttrs->GetItemState( XATTR_LINESTARTWIDTH ) != SfxItemState::DONTCARE )
1033  {
1035  rAttrs->Get( XATTR_LINESTARTWIDTH ).GetValue(),
1036  m_ePoolUnit );
1037  }
1038  else
1039  m_xMtrStartWidth->set_text( "" );
1040 
1041  // Line end strength
1042  if( m_bObjSelected && rAttrs->GetItemState( XATTR_LINEENDWIDTH ) == SfxItemState::DEFAULT )
1043  {
1044  m_xMtrEndWidth->set_sensitive(false);
1045  }
1046  else if( rAttrs->GetItemState( XATTR_LINEENDWIDTH ) != SfxItemState::DONTCARE )
1047  {
1049  rAttrs->Get( XATTR_LINEENDWIDTH ).GetValue(),
1050  m_ePoolUnit );
1051  }
1052  else
1053  m_xMtrEndWidth->set_text("");
1054 
1055  // Centered line end (start)
1056  if( m_bObjSelected && rAttrs->GetItemState( XATTR_LINESTARTCENTER ) == SfxItemState::DEFAULT )
1057  {
1058  m_xTsbCenterStart->set_sensitive(false);
1059  }
1060  else if( rAttrs->GetItemState( XATTR_LINESTARTCENTER ) != SfxItemState::DONTCARE )
1061  {
1062  if( rAttrs->Get( XATTR_LINESTARTCENTER ).GetValue() )
1063  m_xTsbCenterStart->set_state(TRISTATE_TRUE);
1064  else
1065  m_xTsbCenterStart->set_state(TRISTATE_FALSE);
1066  }
1067  else
1068  {
1069  m_xTsbCenterStart->set_state(TRISTATE_INDET);
1070  }
1071 
1072  // Centered line end (end)
1073  if( m_bObjSelected && rAttrs->GetItemState( XATTR_LINEENDCENTER ) == SfxItemState::DEFAULT )
1074  {
1075  m_xTsbCenterEnd->set_sensitive(false);
1076  }
1077  else if( rAttrs->GetItemState( XATTR_LINEENDCENTER ) != SfxItemState::DONTCARE )
1078  {
1079  if( rAttrs->Get( XATTR_LINEENDCENTER ).GetValue() )
1080  m_xTsbCenterEnd->set_state(TRISTATE_TRUE);
1081  else
1082  m_xTsbCenterEnd->set_state(TRISTATE_FALSE);
1083  }
1084  else
1085  {
1086  m_xTsbCenterEnd->set_state(TRISTATE_INDET);
1087  }
1088 
1089  // Transparency
1090  if( rAttrs->GetItemState( XATTR_LINETRANSPARENCE ) != SfxItemState::DONTCARE )
1091  {
1092  sal_uInt16 nTransp = rAttrs->Get( XATTR_LINETRANSPARENCE ).GetValue();
1093  m_xMtrTransparent->set_value(nTransp, FieldUnit::PERCENT);
1094  ChangeTransparentHdl_Impl(*m_xMtrTransparent);
1095  }
1096  else
1097  m_xMtrTransparent->set_text( "" );
1098 
1099  if( !m_xLbStartStyle->get_sensitive() &&
1100  !m_xLbEndStyle->get_sensitive() &&
1101  !m_xMtrStartWidth->get_sensitive() &&
1102  !m_xMtrEndWidth->get_sensitive() &&
1103  !m_xTsbCenterStart->get_sensitive()&&
1104  !m_xTsbCenterEnd->get_sensitive() )
1105  {
1106  m_xCbxSynchronize->set_sensitive(false);
1107  m_xFlLineEnds->set_sensitive(false);
1108  }
1109 
1110  // Synchronize
1111  // We get the value from the INI file now
1112  OUString aStr = GetUserData();
1113  m_xCbxSynchronize->set_active(aStr.toInt32() != 0);
1114 
1115  if(m_bObjSelected && SfxItemState::DEFAULT == rAttrs->GetItemState(XATTR_LINEJOINT))
1116  {
1117 // maFTEdgeStyle.set_sensitive(false);
1118  m_xLBEdgeStyle->set_sensitive(false);
1119  }
1120  else if(SfxItemState::DONTCARE != rAttrs->GetItemState(XATTR_LINEJOINT))
1121  {
1122  const css::drawing::LineJoint eLineJoint = rAttrs->Get(XATTR_LINEJOINT).GetValue();
1123 
1124  switch(eLineJoint)
1125  {
1126  case css::drawing::LineJoint::LineJoint_MAKE_FIXED_SIZE: // fallback to round, unused value
1127  case css::drawing::LineJoint_ROUND : m_xLBEdgeStyle->set_active(0); break;
1128  case css::drawing::LineJoint_NONE : m_xLBEdgeStyle->set_active(1); break;
1129  case css::drawing::LineJoint_MIDDLE : // fallback to mitre, unused value
1130  case css::drawing::LineJoint_MITER : m_xLBEdgeStyle->set_active(2); break;
1131  case css::drawing::LineJoint_BEVEL : m_xLBEdgeStyle->set_active(3); break;
1132  }
1133  }
1134  else
1135  {
1136  m_xLBEdgeStyle->set_active(-1);
1137  }
1138 
1139  // fdo#43209
1140  if(m_bObjSelected && SfxItemState::DEFAULT == rAttrs->GetItemState(XATTR_LINECAP))
1141  {
1142  m_xLBCapStyle->set_sensitive(false);
1143  }
1144  else if(SfxItemState::DONTCARE != rAttrs->GetItemState(XATTR_LINECAP))
1145  {
1146  const css::drawing::LineCap eLineCap(rAttrs->Get(XATTR_LINECAP).GetValue());
1147 
1148  switch(eLineCap)
1149  {
1150  case css::drawing::LineCap_ROUND: m_xLBCapStyle->set_active(1); break;
1151  case css::drawing::LineCap_SQUARE : m_xLBCapStyle->set_active(2); break;
1152  default /*css::drawing::LineCap_BUTT*/: m_xLBCapStyle->set_active(0); break;
1153  }
1154  }
1155  else
1156  {
1157  m_xLBCapStyle->set_active(-1);
1158  }
1159 
1160  // Save values
1161  m_xLbLineStyle->save_value();
1162  m_xMtrLineWidth->save_value();
1163  m_xLbColor->SaveValue();
1164  m_xLbStartStyle->save_value();
1165  m_xLbEndStyle->save_value();
1166  m_xMtrStartWidth->save_value();
1167  m_xMtrEndWidth->save_value();
1168  m_xTsbCenterStart->save_state();
1169  m_xTsbCenterEnd->save_state();
1170  m_xMtrTransparent->save_value();
1171 
1172  m_xLBEdgeStyle->save_value();
1173 
1174  // LineCaps
1175  m_xLBCapStyle->save_value();
1176 
1178 
1179  ChangePreviewHdl_Impl( nullptr );
1180 }
1181 
1182 std::unique_ptr<SfxTabPage> SvxLineTabPage::Create(weld::Container* pPage, weld::DialogController* pController,
1183  const SfxItemSet* rAttrs)
1184 {
1185  return std::make_unique<SvxLineTabPage>(pPage, pController, *rAttrs);
1186 }
1187 
1188 IMPL_LINK_NOARG(SvxLineTabPage, ChangePreviewListBoxHdl_Impl, ColorListBox&, void)
1189 {
1190  ChangePreviewHdl_Impl(nullptr);
1191 }
1192 
1193 IMPL_LINK(SvxLineTabPage, ChangePreviewModifyHdl_Impl, weld::MetricSpinButton&, rEdit, void)
1194 {
1195  ChangePreviewHdl_Impl(&rEdit);
1196 }
1197 
1199 {
1200  if (pCntrl == m_xMtrLineWidth.get())
1201  {
1202  // Line width and start end width
1203  sal_Int32 nNewLineWidth = GetCoreValue( *m_xMtrLineWidth, m_ePoolUnit );
1204  if(m_nActLineWidth == -1)
1205  {
1206  // Don't initialize yet, get the start value
1207  const SfxPoolItem* pOld = GetOldItem( m_rXLSet, XATTR_LINEWIDTH );
1208  sal_Int32 nStartLineWidth = 0;
1209  if(pOld)
1210  nStartLineWidth = static_cast<const XLineWidthItem *>(pOld)->GetValue();
1211  m_nActLineWidth = nStartLineWidth;
1212  }
1213 
1214  if(m_nActLineWidth != nNewLineWidth)
1215  {
1216  // Adapt start/end width
1217  sal_Int32 nValAct = GetCoreValue( *m_xMtrStartWidth, m_ePoolUnit );
1218  sal_Int32 nValNew = nValAct + (((nNewLineWidth - m_nActLineWidth) * 15) / 10);
1219  if(nValNew < 0)
1220  nValNew = 0;
1222 
1223  nValAct = GetCoreValue( *m_xMtrEndWidth, m_ePoolUnit );
1224  nValNew = nValAct + (((nNewLineWidth - m_nActLineWidth) * 15) / 10);
1225  if(nValNew < 0)
1226  nValNew = 0;
1228  }
1229 
1230  // Remember current value
1231  m_nActLineWidth = nNewLineWidth;
1232  }
1233 
1234  FillXLSet_Impl();
1235  m_aCtlPreview.Invalidate();
1236 
1237  // Make transparency accessible accordingly
1238  if( m_xLbLineStyle->get_active() == 0 ) // invisible
1239  {
1240  m_xBoxTransparency->set_sensitive(false);
1241  }
1242  else
1243  {
1244  m_xBoxTransparency->set_sensitive(true);
1245  }
1246 
1247  const bool bHasLineStyle = m_xLbLineStyle->get_active() !=0;
1248  const bool bHasLineStart = m_xLbStartStyle->get_active() != 0;
1249 
1250  m_xBoxStart->set_sensitive(bHasLineStart && bHasLineStyle);
1251 
1252  const bool bHasLineEnd = m_xLbEndStyle->get_active() != 0;
1253 
1254  m_xBoxEnd->set_sensitive(bHasLineEnd && bHasLineStyle);
1255 }
1256 
1257 IMPL_LINK_NOARG(SvxLineTabPage, ChangeStartClickHdl_Impl, weld::Button&, void)
1258 {
1259  if (m_xCbxSynchronize->get_active())
1260  m_xTsbCenterEnd->set_state(m_xTsbCenterStart->get_state());
1261  ChangePreviewHdl_Impl(nullptr);
1262 }
1263 
1264 IMPL_LINK_NOARG(SvxLineTabPage, ChangeStartListBoxHdl_Impl, weld::ComboBox&, void)
1265 {
1266  if (m_xCbxSynchronize->get_active())
1267  m_xLbEndStyle->set_active(m_xLbStartStyle->get_active());
1268 
1269  ChangePreviewHdl_Impl(nullptr);
1270 }
1271 
1272 IMPL_LINK_NOARG(SvxLineTabPage, ChangeStartModifyHdl_Impl, weld::MetricSpinButton&, void)
1273 {
1274  if (m_xCbxSynchronize->get_active())
1275  m_xMtrEndWidth->set_value(m_xMtrStartWidth->get_value(FieldUnit::NONE), FieldUnit::NONE);
1276 
1277  ChangePreviewHdl_Impl(nullptr);
1278 }
1279 
1280 IMPL_LINK_NOARG(SvxLineTabPage, ChangeEdgeStyleHdl_Impl, weld::ComboBox&, void)
1281 {
1282  ChangePreviewHdl_Impl( nullptr );
1283 }
1284 
1285 // fdo#43209
1286 IMPL_LINK_NOARG(SvxLineTabPage, ChangeCapStyleHdl_Impl, weld::ComboBox&, void)
1287 {
1288  ChangePreviewHdl_Impl( nullptr );
1289 }
1290 
1291 IMPL_LINK_NOARG(SvxLineTabPage, ClickInvisibleHdl_Impl, weld::ComboBox&, void)
1292 {
1293  ClickInvisibleHdl_Impl();
1294 }
1295 
1297 {
1298  if( m_xLbLineStyle->get_active() == 0 ) // invisible
1299  {
1300  if(!m_bSymbols)
1301  m_xBoxColor->set_sensitive(false);
1302 
1303  m_xBoxWidth->set_sensitive(false);
1304 
1305  if( m_xFlLineEnds->get_sensitive() )
1306  {
1307  m_xBoxStart->set_sensitive(false);
1308  m_xBoxArrowStyles->set_sensitive(false);
1309  m_xGridEdgeCaps->set_sensitive(false);
1310  }
1311  }
1312  else
1313  {
1314  m_xBoxColor->set_sensitive(true);
1315  m_xBoxWidth->set_sensitive(true);
1316 
1317  if (m_xFlLineEnds->get_sensitive())
1318  {
1319  m_xBoxArrowStyles->set_sensitive(true);
1320  m_xGridEdgeCaps->set_sensitive(true);
1321  }
1322  }
1323  ChangePreviewHdl_Impl( nullptr );
1324 }
1325 
1326 IMPL_LINK_NOARG(SvxLineTabPage, ChangeEndClickHdl_Impl, weld::Button&, void)
1327 {
1328  if (m_xCbxSynchronize->get_active())
1329  m_xTsbCenterStart->set_state(m_xTsbCenterEnd->get_state());
1330 
1331  ChangePreviewHdl_Impl(nullptr);
1332 }
1333 
1334 IMPL_LINK_NOARG(SvxLineTabPage, ChangeEndListBoxHdl_Impl, weld::ComboBox&, void)
1335 {
1336  if (m_xCbxSynchronize->get_active())
1337  m_xLbStartStyle->set_active(m_xLbEndStyle->get_active());
1338 
1339  ChangePreviewHdl_Impl(nullptr);
1340 }
1341 
1342 IMPL_LINK_NOARG(SvxLineTabPage, ChangeEndModifyHdl_Impl, weld::MetricSpinButton&, void)
1343 {
1344  if (m_xCbxSynchronize->get_active())
1345  m_xMtrStartWidth->set_value(m_xMtrEndWidth->get_value(FieldUnit::NONE), FieldUnit::NONE);
1346 
1347  ChangePreviewHdl_Impl(nullptr);
1348 }
1349 
1350 IMPL_LINK_NOARG(SvxLineTabPage, ChangeTransparentHdl_Impl, weld::MetricSpinButton&, void)
1351 {
1352  sal_uInt16 nVal = m_xMtrTransparent->get_value(FieldUnit::PERCENT);
1353 
1354  m_rXLSet.Put(XLineTransparenceItem(nVal));
1355 
1356  FillXLSet_Impl();
1357 
1358  m_aCtlPreview.Invalidate();
1359 }
1360 
1362 {
1363  // Write the synched value to the INI file
1364  OUString aStrUserData = OUString::boolean(m_xCbxSynchronize->get_active());
1365  SetUserData( aStrUserData );
1366 }
1367 
1368 // #58425# Symbols on a list (e.g. StarChart)
1369 // Handler for the symbol selection's popup menu (NumMenueButton)
1370 // The following link originates from SvxNumOptionsTabPage
1372 {
1374 
1375  // Initialize popup
1376  if (!m_xGalleryMenu)
1377  {
1378  m_xGalleryMenu = m_xBuilder->weld_menu("gallerysubmenu");
1379  weld::WaitObject aWait(GetFrameWeld());
1380  // Get gallery entries
1382 
1383  sal_uInt32 i = 0;
1384  for (auto const& grfName : m_aGrfNames)
1385  {
1386  const OUString *pUIName = &grfName;
1387 
1388  // Convert URL encodings to UI characters (e.g. %20 for spaces)
1389  OUString aPhysicalName;
1390  if (osl::FileBase::getSystemPathFromFileURL(grfName, aPhysicalName)
1391  == osl::FileBase::E_None)
1392  {
1393  pUIName = &aPhysicalName;
1394  }
1395 
1396  SvxBmpItemInfo* pInfo = new SvxBmpItemInfo;
1397  pInfo->pBrushItem.reset(new SvxBrushItem(grfName, "", GPOS_AREA, SID_ATTR_BRUSH));
1398  pInfo->sItemId = "gallery" + OUString::number(i);
1399  m_aGalleryBrushItems.emplace_back(pInfo);
1400  const Graphic* pGraphic = pInfo->pBrushItem->GetGraphic();
1401 
1402  if(pGraphic)
1403  {
1404  BitmapEx aBitmap(pGraphic->GetBitmapEx());
1405  Size aSize(aBitmap.GetSizePixel());
1406  if(aSize.Width() > MAX_BMP_WIDTH || aSize.Height() > MAX_BMP_HEIGHT)
1407  {
1408  bool bWidth = aSize.Width() > aSize.Height();
1409  double nScale = bWidth ?
1410  double(MAX_BMP_WIDTH) / static_cast<double>(aSize.Width()):
1411  double(MAX_BMP_HEIGHT) / static_cast<double>(aSize.Height());
1412  aBitmap.Scale(nScale, nScale);
1413 
1414  }
1415  pVD->SetOutputSizePixel(aBitmap.GetSizePixel());
1416  pVD->DrawBitmapEx(Point(), aBitmap);
1417  m_xGalleryMenu->append(pInfo->sItemId, *pUIName, *pVD);
1418  }
1419  else
1420  {
1421  m_xGalleryMenu->append(pInfo->sItemId, *pUIName);
1422  }
1423  ++i;
1424  }
1425 
1426  if (m_aGrfNames.empty())
1427  m_xSymbolMB->set_item_sensitive("gallery", false);
1428  }
1429 
1430  if (m_xSymbolsMenu || !m_pSymbolList)
1431  return;
1432 
1433  m_xSymbolsMenu = m_xBuilder->weld_menu("symbolssubmenu");
1435  pVDev->SetMapMode(MapMode(MapUnit::Map100thMM));
1436  std::unique_ptr<SdrModel> pModel(
1437  new SdrModel(nullptr, nullptr, true));
1438  pModel->GetItemPool().FreezeIdRanges();
1439  // Page
1440  SdrPage* pPage = new SdrPage( *pModel, false );
1441  pPage->SetSize(Size(1000,1000));
1442  pModel->InsertPage( pPage, 0 );
1443  {
1444  // 3D View
1445  std::unique_ptr<SdrView> pView(new SdrView( *pModel, pVDev ));
1446  pView->hideMarkHandles();
1447  pView->ShowSdrPage(pPage);
1448 
1449  // Generate invisible square to give all symbols a
1450  // bitmap size, which is independent from specific glyph
1451  SdrObject *pInvisibleSquare=m_pSymbolList->GetObj(0);
1452 
1453  // directly clone to target SdrModel
1454  pInvisibleSquare = pInvisibleSquare->CloneSdrObject(*pModel);
1455 
1456  pPage->NbcInsertObject(pInvisibleSquare);
1457  pInvisibleSquare->SetMergedItem(XFillTransparenceItem(100));
1458  pInvisibleSquare->SetMergedItem(XLineTransparenceItem(100));
1459 
1460  for(size_t i=0; i < m_pSymbolList->GetObjCount(); ++i)
1461  {
1462  SdrObject *pObj=m_pSymbolList->GetObj(i);
1463  assert(pObj);
1464 
1465  // directly clone to target SdrModel
1466  pObj = pObj->CloneSdrObject(*pModel);
1467 
1468  m_aGrfNames.emplace_back("");
1469  pPage->NbcInsertObject(pObj);
1470  if(m_pSymbolAttr)
1471  {
1472  pObj->SetMergedItemSet(*m_pSymbolAttr);
1473  }
1474  else
1475  {
1476  pObj->SetMergedItemSet(m_rOutAttrs);
1477  }
1478  pView->MarkAll();
1479  BitmapEx aBitmapEx(pView->GetMarkedObjBitmapEx());
1480  GDIMetaFile aMeta(pView->GetMarkedObjMetaFile());
1481  pView->UnmarkAll();
1482  pObj=pPage->RemoveObject(1);
1483  SdrObject::Free(pObj);
1484 
1485  SvxBmpItemInfo* pInfo = new SvxBmpItemInfo;
1486  pInfo->pBrushItem.reset(new SvxBrushItem(Graphic(aMeta), GPOS_AREA, SID_ATTR_BRUSH));
1487  pInfo->sItemId = "symbol" + OUString::number(i);
1488  m_aSymbolBrushItems.emplace_back(pInfo);
1489 
1490  Size aSize(aBitmapEx.GetSizePixel());
1491  if(aSize.Width() > MAX_BMP_WIDTH || aSize.Height() > MAX_BMP_HEIGHT)
1492  {
1493  bool bWidth = aSize.Width() > aSize.Height();
1494  double nScale = bWidth ?
1495  double(MAX_BMP_WIDTH) / static_cast<double>(aSize.Width()):
1496  double(MAX_BMP_HEIGHT) / static_cast<double>(aSize.Height());
1497  aBitmapEx.Scale(nScale, nScale);
1498  }
1499  pVD->SetOutputSizePixel(aBitmapEx.GetSizePixel());
1500  pVD->DrawBitmapEx(Point(), aBitmapEx);
1501  m_xSymbolsMenu->append(pInfo->sItemId, "", *pVD);
1502  }
1503  pInvisibleSquare=pPage->RemoveObject(0);
1504  SdrObject::Free(pInvisibleSquare);
1505 
1506  if (m_aGrfNames.empty())
1507  m_xSymbolMB->set_item_sensitive("symbols", false);
1508  }
1509 }
1510 
1511 // #58425# Symbols on a list (e.g. StarChart)
1512 // Handler for menu button
1513 IMPL_LINK(SvxLineTabPage, GraphicHdl_Impl, const OString&, rIdent, void)
1514 {
1515  const Graphic* pGraphic = nullptr;
1516  Graphic aGraphic;
1517  bool bResetSize = false;
1518  bool bEnable = true;
1519  tools::Long nPreviousSymbolType = m_nSymbolType;
1520 
1521  OString sNumber;
1522  if (rIdent.startsWith("gallery", &sNumber))
1523  {
1524  SvxBmpItemInfo* pInfo = m_aGalleryBrushItems[sNumber.toUInt32()].get();
1525  pGraphic = pInfo->pBrushItem->GetGraphic();
1526  m_nSymbolType = SVX_SYMBOLTYPE_BRUSHITEM;
1527  }
1528  else if (rIdent.startsWith("symbol", &sNumber))
1529  {
1530  m_nSymbolType = sNumber.toUInt32();
1531  SvxBmpItemInfo* pInfo = m_aSymbolBrushItems[m_nSymbolType].get();
1532  pGraphic = pInfo->pBrushItem->GetGraphic();
1533  }
1534  else if (rIdent == "automatic")
1535  {
1536  pGraphic=&m_aAutoSymbolGraphic;
1537  m_aAutoSymbolGraphic.SetPrefSize( Size(253,253) );
1538  m_nSymbolType=SVX_SYMBOLTYPE_AUTO;
1539  }
1540  else if (rIdent == "none")
1541  {
1542  m_nSymbolType=SVX_SYMBOLTYPE_NONE;
1543  pGraphic=nullptr;
1544  bEnable = false;
1545  }
1546  else if (rIdent == "file")
1547  {
1548  SvxOpenGraphicDialog aGrfDlg(CuiResId(RID_SVXSTR_EDIT_GRAPHIC), GetFrameWeld());
1549  aGrfDlg.EnableLink(false);
1550  aGrfDlg.AsLink(false);
1551  if( !aGrfDlg.Execute() )
1552  {
1553  // Remember selected filters
1554  if( !aGrfDlg.GetGraphic(aGraphic) )
1555  {
1556  m_nSymbolType=SVX_SYMBOLTYPE_BRUSHITEM;
1557  pGraphic = &aGraphic;
1558  bResetSize = true;
1559  }
1560  }
1561  if( !pGraphic )
1562  return;
1563  }
1564 
1565  if (pGraphic)
1566  {
1567  Size aSize = SvxNumberFormat::GetGraphicSizeMM100(pGraphic);
1568  aSize = OutputDevice::LogicToLogic(aSize, MapMode(MapUnit::Map100thMM), MapMode(m_ePoolUnit));
1569  m_aSymbolGraphic=*pGraphic;
1570  if( bResetSize )
1571  {
1572  m_aSymbolSize=aSize;
1573  }
1574  else if( nPreviousSymbolType == SVX_SYMBOLTYPE_BRUSHITEM )
1575  { //#i31097# Data Point Symbol size changes when a different symbol is chosen(maoyg)
1576  if( m_aSymbolSize.Width() != m_aSymbolSize.Height() )
1577  {
1578  aSize.setWidth( static_cast<tools::Long>( m_aSymbolSize.Width() + m_aSymbolSize.Height() )/2 );
1579  aSize.setHeight( static_cast<tools::Long>( m_aSymbolSize.Width() + m_aSymbolSize.Height() )/2 );
1580  m_aSymbolSize = aSize;
1581  }
1582  }
1583  m_aCtlPreview.SetSymbol(&m_aSymbolGraphic,m_aSymbolSize);
1584  }
1585  else
1586  {
1587  m_aSymbolGraphic=Graphic();
1588  m_aCtlPreview.SetSymbol(nullptr,m_aSymbolSize);
1589  bEnable = false;
1590  }
1591  m_aSymbolLastSize=m_aSymbolSize;
1592  SetMetricValue(*m_xSymbolWidthMF, m_aSymbolSize.Width(), m_ePoolUnit);
1593  SetMetricValue(*m_xSymbolHeightMF, m_aSymbolSize.Height(), m_ePoolUnit);
1594 
1595  m_xGridIconSize->set_sensitive(bEnable);
1596  m_aCtlPreview.Invalidate();
1597 }
1598 
1599 IMPL_LINK( SvxLineTabPage, SizeHdl_Impl, weld::MetricSpinButton&, rField, void)
1600 {
1601  m_bNewSize = true;
1602  bool bWidth = &rField == m_xSymbolWidthMF.get();
1603  m_bLastWidthModified = bWidth;
1604  bool bRatio = m_xSymbolRatioCB->get_active();
1605  tools::Long nWidthVal = static_cast<tools::Long>(m_xSymbolWidthMF->denormalize(m_xSymbolWidthMF->get_value(FieldUnit::MM_100TH)));
1606  tools::Long nHeightVal= static_cast<tools::Long>(m_xSymbolHeightMF->denormalize(m_xSymbolHeightMF->get_value(FieldUnit::MM_100TH)));
1607  nWidthVal = OutputDevice::LogicToLogic(nWidthVal,MapUnit::Map100thMM, m_ePoolUnit );
1608  nHeightVal = OutputDevice::LogicToLogic(nHeightVal,MapUnit::Map100thMM, m_ePoolUnit);
1609  m_aSymbolSize = Size(nWidthVal,nHeightVal);
1610  double fSizeRatio = double(1);
1611 
1612  if(bRatio)
1613  {
1614  if (m_aSymbolLastSize.Height() && m_aSymbolLastSize.Width())
1615  fSizeRatio = static_cast<double>(m_aSymbolLastSize.Width()) / m_aSymbolLastSize.Height();
1616  }
1617 
1618  if (bWidth)
1619  {
1620  tools::Long nDelta = nWidthVal - m_aSymbolLastSize.Width();
1621  m_aSymbolSize.setWidth( nWidthVal );
1622  if (bRatio)
1623  {
1624  m_aSymbolSize.setHeight( m_aSymbolLastSize.Height() + static_cast<tools::Long>(static_cast<double>(nDelta) / fSizeRatio) );
1625  m_aSymbolSize.setHeight( OutputDevice::LogicToLogic( m_aSymbolSize.Height(), m_ePoolUnit, MapUnit::Map100thMM ) );
1626 //TODO m_xSymbolHeightMF->SetUserValue(m_xSymbolHeightMF->normalize(m_aSymbolSize.Height()), FieldUnit::MM_100TH);
1627  m_xSymbolHeightMF->set_value(m_xSymbolHeightMF->normalize(m_aSymbolSize.Height()), FieldUnit::MM_100TH);
1628  }
1629  }
1630  else
1631  {
1632  tools::Long nDelta = nHeightVal - m_aSymbolLastSize.Height();
1633  m_aSymbolSize.setHeight( nHeightVal );
1634  if (bRatio)
1635  {
1636  m_aSymbolSize.setWidth( m_aSymbolLastSize.Width() + static_cast<tools::Long>(static_cast<double>(nDelta) * fSizeRatio) );
1637  m_aSymbolSize.setWidth( OutputDevice::LogicToLogic( m_aSymbolSize.Width(), m_ePoolUnit, MapUnit::Map100thMM ) );
1638 //TODO m_xSymbolWidthMF->SetUserValue(m_xSymbolWidthMF->normalize(m_aSymbolSize.Width()), FieldUnit::MM_100TH);
1639  m_xSymbolWidthMF->set_value(m_xSymbolWidthMF->normalize(m_aSymbolSize.Width()), FieldUnit::MM_100TH);
1640  }
1641  }
1642  m_aCtlPreview.ResizeSymbol(m_aSymbolSize);
1643  m_aSymbolLastSize=m_aSymbolSize;
1644 }
1645 
1646 IMPL_LINK(SvxLineTabPage, RatioHdl_Impl, weld::ToggleButton&, rBox, void)
1647 {
1648  if (rBox.get_active())
1649  {
1650  if (m_bLastWidthModified)
1651  SizeHdl_Impl(*m_xSymbolWidthMF);
1652  else
1653  SizeHdl_Impl(*m_xSymbolHeightMF);
1654  }
1655 }
1656 
1658 {
1659  const SvxDashListItem* pDashListItem = aSet.GetItem<SvxDashListItem>(SID_DASH_LIST, false);
1660  const SvxLineEndListItem* pLineEndListItem = aSet.GetItem<SvxLineEndListItem>(SID_LINEEND_LIST, false);
1661  const SfxUInt16Item* pPageTypeItem = aSet.GetItem<SfxUInt16Item>(SID_PAGE_TYPE, false);
1662  const SfxUInt16Item* pDlgTypeItem = aSet.GetItem<SfxUInt16Item>(SID_DLG_TYPE, false);
1663  const OfaPtrItem* pSdrObjListItem = aSet.GetItem<OfaPtrItem>(SID_OBJECT_LIST, false);
1664  const SfxTabDialogItem* pSymbolAttrItem = aSet.GetItem<SfxTabDialogItem>(SID_ATTR_SET, false);
1665  const SvxGraphicItem* pGraphicItem = aSet.GetItem<SvxGraphicItem>(SID_GRAPHIC, false);
1666 
1667  if (pDashListItem)
1668  SetDashList(pDashListItem->GetDashList());
1669  if (pLineEndListItem)
1670  SetLineEndList(pLineEndListItem->GetLineEndList());
1671  if (pPageTypeItem)
1672  SetPageType(static_cast<PageType>(pPageTypeItem->GetValue()));
1673  if (pDlgTypeItem)
1674  SetDlgType(pDlgTypeItem->GetValue());
1675  Construct();
1676 
1677  if(pSdrObjListItem) //symbols
1678  {
1679  ShowSymbolControls(true);
1680  m_pSymbolList = static_cast<SdrObjList*>(pSdrObjListItem->GetValue());
1681  if (pSymbolAttrItem)
1682  m_pSymbolAttr = new SfxItemSet(pSymbolAttrItem->GetItemSet());
1683  if(pGraphicItem)
1684  m_aAutoSymbolGraphic = pGraphicItem->GetGraphic();
1685  }
1686 }
1687 
1688 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
tools::Long m_nSymbolType
Definition: cuitabline.hxx:98
SdrObjList * m_pSymbolList
a list of symbols to be shown in menu.
Definition: cuitabline.hxx:94
std::unique_ptr< SvxBrushItem > pBrushItem
Definition: cuitabline.hxx:83
void SetFieldUnit(weld::MetricSpinButton &rField, FieldUnit eUnit, bool bAll)
std::pair< Color, OUString > NamedColor
sal_Int32 m_nActLineWidth
Definition: cuitabline.hxx:132
FieldUnit
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:126
constexpr TypedWhichId< XLineStartItem > XATTR_LINESTART(XATTR_LINE_FIRST+4)
void SetUserData(const OUString &rString)
void setWidth(tools::Long nWidth)
constexpr TypedWhichId< XLineJointItem > XATTR_LINEJOINT(XATTR_LINE_FIRST+11)
sal_Int32 * m_pPosDashLb
Definition: cuitabline.hxx:127
std::unique_ptr< weld::Widget > m_xFlLineEnds
Definition: cuitabline.hxx:142
std::string GetValue
Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
SvxXLinePreview m_aCtlPreview
Definition: cuitabline.hxx:134
std::unique_ptr< weld::Widget > m_xBoxWidth
Definition: cuitabline.hxx:138
virtual void PageCreated(const SfxAllItemSet &aSet) override
Definition: tpline.cxx:1657
std::unique_ptr< weld::Widget > m_xFlSymbol
Definition: cuitabline.hxx:162
constexpr OUStringLiteral sNone
std::unique_ptr< weld::MenuButton > m_xSymbolMB
Definition: cuitabline.hxx:164
long Long
virtual void NbcInsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
virtual void FillUserData() override
Definition: tpline.cxx:1361
std::unique_ptr< weld::Widget > m_xBoxEnd
Definition: cuitabline.hxx:148
std::unique_ptr< SvxLineLB > m_xLbLineStyle
Definition: cuitabline.hxx:136
constexpr TypedWhichId< XLineWidthItem > XATTR_LINEWIDTH(XATTR_LINE_FIRST+2)
std::unique_ptr< weld::MetricSpinButton > m_xMtrLineWidth
Definition: cuitabline.hxx:139
constexpr OUStringLiteral PERCENT(u"Percent")
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:109
std::unique_ptr< weld::MetricSpinButton > m_xMtrEndWidth
Definition: cuitabline.hxx:150
std::unique_ptr< weld::MetricSpinButton > m_xMtrTransparent
Definition: cuitabline.hxx:141
MapUnit m_ePoolUnit
Definition: cuitabline.hxx:130
constexpr TypedWhichId< XLineStyleItem > XATTR_LINESTYLE(XATTR_LINE_FIRST)
PageType
void SetPageType(PageType nInType)
Definition: cuitabline.hxx:222
std::unique_ptr< weld::Widget > m_xBoxArrowStyles
Definition: cuitabline.hxx:143
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:119
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:151
#define MAX_BMP_HEIGHT
Definition: tpline.cxx:68
std::unique_ptr< ColorListBox > m_xLbColor
Definition: cuitabline.hxx:137
Graphic m_aAutoSymbolGraphic
a graphic to be displayed in the preview in case that an automatic symbol is chosen ...
Definition: cuitabline.hxx:97
virtual bool FillItemSet(SfxItemSet *) override
Definition: tpline.cxx:381
OUString SvxResId(const char *pId)
std::unique_ptr< weld::Widget > m_xBoxTransparency
Definition: cuitabline.hxx:140
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
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:156
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
Definition: tpline.cxx:362
std::unique_ptr< weld::Widget > m_xBoxStart
Definition: cuitabline.hxx:145
void ShowSymbol(bool b)
std::unique_ptr< weld::Widget > m_xFLEdgeStyle
Definition: cuitabline.hxx:155
TRISTATE_INDET
std::unique_ptr< SvxLineEndLB > m_xLbStartStyle
Definition: cuitabline.hxx:144
std::unique_ptr< weld::MetricSpinButton > m_xSymbolHeightMF
Definition: cuitabline.hxx:168
ChangeType * m_pnLineEndListState
Definition: cuitabline.hxx:122
void ShowSymbolControls(bool bOn)
Definition: tpline.cxx:199
IMPL_LINK_NOARG(SvxLineTabPage, ChangePreviewListBoxHdl_Impl, ColorListBox &, void)
Definition: tpline.cxx:1188
SfxItemSet * m_pSymbolAttr
attributes for the shown symbols; only necessary if not equal to line properties
Definition: cuitabline.hxx:100
XLineEndListRef m_pLineEndList
Definition: cuitabline.hxx:120
const SfxPoolItem * GetOldItem(const SfxItemSet &rSet, sal_uInt16 nSlot, bool bDeep=true)
const XDashListRef & GetDashList() const
SfxItemSet & m_rXLSet
Definition: cuitabline.hxx:117
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:124
void SetDlgType(sal_uInt16 nInType)
Definition: cuitabline.hxx:223
XLineAttrSetItem m_aXLineAttr
Definition: cuitabline.hxx:116
void ChangePreviewHdl_Impl(const weld::MetricSpinButton *)
Definition: tpline.cxx:1198
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:1182
TRISTATE_FALSE
int GetCoreValue(const weld::MetricSpinButton &rField, MapUnit eUnit)
void FillXLSet_Impl()
Definition: tpline.cxx:666
tools::Long Width() const
std::unique_ptr< weld::MetricSpinButton > m_xSymbolWidthMF
Definition: cuitabline.hxx:167
void SetDashList(XDashListRef const &pDshLst)
Definition: cuitabline.hxx:218
const SfxItemSet * GetItemSet(const SfxPoolItem &rAttr)
std::vector< std::unique_ptr< SvxBmpItemInfo > > m_aSymbolBrushItems
Definition: cuitabline.hxx:106
GPOS_MM
void ClickInvisibleHdl_Impl()
Definition: tpline.cxx:1296
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:157
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:219
std::unique_ptr< weld::CheckButton > m_xSymbolRatioCB
Definition: cuitabline.hxx:169
const SfxItemSet & m_rOutAttrs
Definition: cuitabline.hxx:113
Size GetPrefSize() const
const basegfx::B2DPolyPolygon & GetLineEnd() const
static const sal_uInt16 pLineRanges[]
Definition: cuitabline.hxx:89
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
weld::Entry & rEdit
std::unique_ptr< weld::MetricSpinButton > m_xMtrStartWidth
Definition: cuitabline.hxx:146
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:163
std::unique_ptr< weld::ComboBox > m_xLBCapStyle
Definition: cuitabline.hxx:160
virtual SdrObject * CloneSdrObject(SdrModel &rTargetModel) const
ChangeType * m_pnDashListState
Definition: cuitabline.hxx:123
tools::Long Height() const
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:1193
std::unique_ptr< weld::CustomWeld > m_xCtlPreview
Definition: cuitabline.hxx:153
void SetPrefSize(const Size &rPrefSize)
std::unique_ptr< weld::Widget > m_xBoxColor
Definition: cuitabline.hxx:135
DeactivateRC
void setHeight(tools::Long nHeight)
PageType m_nPageType
Definition: cuitabline.hxx:125
Size m_aSymbolLastSize
Definition: cuitabline.hxx:108
std::unique_ptr< weld::CheckButton > m_xCbxSynchronize
Definition: cuitabline.hxx:152
std::vector< std::unique_ptr< SvxBmpItemInfo > > m_aGalleryBrushItems
Definition: cuitabline.hxx:104
TriState
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
constexpr TypedWhichId< XLineColorItem > XATTR_LINECOLOR(XATTR_LINE_FIRST+3)
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
aStr
std::unique_ptr< SvxLineEndLB > m_xLbEndStyle
Definition: cuitabline.hxx:149
OUString sItemId
Definition: cuitabline.hxx:84
static bool FillObjList(std::u16string_view rThemeName, std::vector< OUString > &rObjList)
sal_Int32 * m_pPosLineEndLb
Definition: cuitabline.hxx:128
sal_uInt16 nPos
std::unique_ptr< weld::CheckButton > m_xTsbCenterStart
Definition: cuitabline.hxx:147