LibreOffice Module svx (master)  1
linectrl.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 <tools/debug.hxx>
21 #include <vcl/settings.hxx>
22 #include <vcl/svapp.hxx>
23 #include <vcl/toolbox.hxx>
24 #include <vcl/virdev.hxx>
25 #include <sfx2/objsh.hxx>
26 
27 #include <svtools/toolbarmenu.hxx>
29 #include <svtools/valueset.hxx>
30 
31 #include <svx/strings.hrc>
32 #include <svx/svxids.hrc>
33 #include <helpids.h>
34 
35 #include <svx/drawitem.hxx>
36 #include <svx/xlineit0.hxx>
37 #include <svx/xlndsit.hxx>
38 #include <svx/xlnstit.hxx>
39 #include <svx/xlnedit.hxx>
40 #include <svx/xtable.hxx>
41 #include <svx/linectrl.hxx>
42 #include <svx/itemwin.hxx>
43 #include <svx/dialmgr.hxx>
44 #include <tbxcolorupdate.hxx>
45 
46 #include <memory>
47 
48 #include <comphelper/lok.hxx>
49 
50 using namespace ::com::sun::star::uno;
51 using namespace ::com::sun::star::beans;
52 using namespace ::com::sun::star::util;
53 using namespace ::com::sun::star::frame;
54 using namespace ::com::sun::star::lang;
55 using namespace ::com::sun::star;
56 
57 // For End Line Controller
58 #define MAX_LINES 12
59 
60 SvxLineStyleToolBoxControl::SvxLineStyleToolBoxControl( const css::uno::Reference<css::uno::XComponentContext>& rContext )
61  : svt::PopupWindowController( rContext, nullptr, OUString() )
62 {
63  addStatusListener(".uno:LineDash");
64 }
65 
67 {
68 }
69 
70 void SAL_CALL SvxLineStyleToolBoxControl::statusChanged( const frame::FeatureStateEvent& rEvent )
71 {
72  ToolBox* pToolBox = nullptr;
73  sal_uInt16 nId = 0;
74  if (!getToolboxId(nId, &pToolBox) && !m_pToolbar)
75  return;
76 
77  OString sId(m_aCommandURL.toUtf8());
78 
79  if ( rEvent.FeatureURL.Complete == m_aCommandURL )
80  {
81  if (m_pToolbar)
82  m_pToolbar->set_item_sensitive(sId, rEvent.IsEnabled);
83  else
84  pToolBox->EnableItem( nId, rEvent.IsEnabled );
85  }
86 
87  m_xBtnUpdater->Update(rEvent);
88 
90  if (!pSh)
91  return;
92 
93  const SvxDashListItem* pItem = pSh->GetItem( SID_DASH_LIST );
94  if (!pItem)
95  return;
96 
97  XDashListRef xList = pItem->GetDashList();
98  int nIndex = m_xBtnUpdater->GetStyleIndex();
99  switch (nIndex)
100  {
101  case -1:
102  case 0:
103  {
104  BitmapEx aEmpty(xList->GetBitmapForUISolidLine());
105  aEmpty.Erase(Application::GetSettings().GetStyleSettings().GetFieldColor());
106  if (m_pToolbar)
107  {
108  Graphic aGraf(aEmpty);
109  m_pToolbar->set_item_image(sId, aGraf.GetXGraphic());
110  }
111  else
112  pToolBox->SetItemImage(nId, Image(aEmpty));
113  break;
114  }
115  case 1:
116  if (m_pToolbar)
117  {
118  Graphic aGraf(xList->GetBitmapForUISolidLine());
119  m_pToolbar->set_item_image(sId, aGraf.GetXGraphic());
120  }
121  else
122  pToolBox->SetItemImage(nId, Image(xList->GetBitmapForUISolidLine()));
123  break;
124  default:
125  if (m_pToolbar)
126  {
127  Graphic aGraf(xList->GetUiBitmap(nIndex - 2));
128  m_pToolbar->set_item_image(sId, aGraf.GetXGraphic());
129  }
130  else
131  pToolBox->SetItemImage(nId, Image(xList->GetUiBitmap(nIndex - 2)));
132  break;
133  }
134 }
135 
136 void SAL_CALL SvxLineStyleToolBoxControl::execute(sal_Int16 /*KeyModifier*/)
137 {
138  if (m_pToolbar)
139  {
140  // Toggle the popup also when toolbutton is activated
141  const OString aId(m_aCommandURL.toUtf8());
142  m_pToolbar->set_menu_item_active(aId, !m_pToolbar->get_menu_item_active(aId));
143  }
144  else
145  {
146  // Open the popup also when Enter key is pressed.
148  }
149 }
150 
151 void SvxLineStyleToolBoxControl::initialize( const css::uno::Sequence<css::uno::Any>& rArguments )
152 {
153  svt::PopupWindowController::initialize( rArguments );
154 
155  if (m_pToolbar)
156  {
157  mxPopoverContainer.reset(new ToolbarPopupContainer(m_pToolbar));
158  m_pToolbar->set_item_popover(m_aCommandURL.toUtf8(), mxPopoverContainer->getTopLevel());
159  }
160 
161  ToolBox* pToolBox = nullptr;
162  sal_uInt16 nId = 0;
163  if ( getToolboxId( nId, &pToolBox ) )
164  {
165  pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) | ToolBoxItemBits::DROPDOWNONLY );
166  }
167 
169 }
170 
172 {
173  m_aLineStyleSelectFunction = rLineStyleSelectFunction;
174 }
175 
176 void SvxLineStyleToolBoxControl::dispatchLineStyleCommand(const OUString& rCommand, const Sequence<PropertyValue>& rArgs)
177 {
179  return;
180 
181  dispatchCommand(rCommand, rArgs);
182 }
183 
184 std::unique_ptr<WeldToolbarPopup> SvxLineStyleToolBoxControl::weldPopupWindow()
185 {
186  return std::make_unique<SvxLineBox>(this, m_pToolbar, m_xBtnUpdater->GetStyleIndex());
187 }
188 
190 {
191  mxInterimPopover = VclPtr<InterimToolbarPopup>::Create(getFrameInterface(), pParent,
192  std::make_unique<SvxLineBox>(this, pParent->GetFrameWeld(), m_xBtnUpdater->GetStyleIndex()));
193 
194  mxInterimPopover->Show();
195 
196  return mxInterimPopover;
197 }
198 
200 {
201  return "com.sun.star.comp.svx.LineStyleToolBoxControl";
202 }
203 
205 {
206  return { "com.sun.star.frame.ToolbarController" };
207 }
208 
209 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
211  css::uno::XComponentContext* rContext,
212  css::uno::Sequence<css::uno::Any> const & )
213 {
214  return cppu::acquire( new SvxLineStyleToolBoxControl( rContext ) );
215 }
216 
217 namespace {
218 
219 class SvxLineEndToolBoxControl final : public svt::PopupWindowController
220 {
221 public:
222  explicit SvxLineEndToolBoxControl( const css::uno::Reference<css::uno::XComponentContext>& rContext );
223 
224  // XInitialization
225  virtual void SAL_CALL initialize( const css::uno::Sequence<css::uno::Any>& rArguments ) override;
226 
227  // XServiceInfo
228  virtual OUString SAL_CALL getImplementationName() override;
229  virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
230 
231  virtual void SAL_CALL execute(sal_Int16 nKeyModifier) override;
232 
233 private:
234  virtual std::unique_ptr<WeldToolbarPopup> weldPopupWindow() override;
235  virtual VclPtr<vcl::Window> createVclPopupWindow( vcl::Window* pParent ) override;
236 };
237 
238 class SvxLineEndWindow final : public WeldToolbarPopup
239 {
240 private:
241  XLineEndListRef mpLineEndList;
243  std::unique_ptr<ValueSet> mxLineEndSet;
244  std::unique_ptr<weld::CustomWeld> mxLineEndSetWin;
245  sal_uInt16 mnLines;
246  Size maBmpSize;
247 
248  DECL_LINK( SelectHdl, ValueSet*, void );
249  void FillValueSet();
250  void SetSize();
251 
252  virtual void GrabFocus() override
253  {
254  mxLineEndSet->GrabFocus();
255  }
256 
257 public:
258  SvxLineEndWindow(SvxLineEndToolBoxControl* pControl, weld::Widget* pParent);
259  virtual void statusChanged( const css::frame::FeatureStateEvent& rEvent ) override;
260 };
261 
262 }
263 
264 constexpr sal_uInt16 gnCols = 2;
265 
266 SvxLineEndWindow::SvxLineEndWindow(SvxLineEndToolBoxControl* pControl, weld::Widget* pParent)
267  : WeldToolbarPopup(pControl->getFrameInterface(), pParent, "svx/ui/floatinglineend.ui", "FloatingLineEnd")
268  , mxControl(pControl)
269  , mxLineEndSet(new ValueSet(m_xBuilder->weld_scrolled_window("valuesetwin", true)))
270  , mxLineEndSetWin(new weld::CustomWeld(*m_xBuilder, "valueset", *mxLineEndSet))
271  , mnLines(12)
272 {
273  mxLineEndSet->SetStyle(mxLineEndSet->GetStyle() | WB_ITEMBORDER | WB_3DLOOK | WB_NO_DIRECTSELECT);
274  mxLineEndSet->SetHelpId(HID_POPUP_LINEEND_CTRL);
275  m_xTopLevel->set_help_id(HID_POPUP_LINEEND);
276 
278  if ( pDocSh )
279  {
280  const SfxPoolItem* pItem = pDocSh->GetItem( SID_LINEEND_LIST );
281  if( pItem )
282  mpLineEndList = static_cast<const SvxLineEndListItem*>( pItem )->GetLineEndList();
283  }
284  DBG_ASSERT( mpLineEndList.is(), "LineEndList not found" );
285 
286  mxLineEndSet->SetSelectHdl( LINK( this, SvxLineEndWindow, SelectHdl ) );
287  mxLineEndSet->SetColCount( gnCols );
288 
289  // ValueSet fill with entries of LineEndList
290  FillValueSet();
291 
292  AddStatusListener( ".uno:LineEndListState");
293 }
294 
295 IMPL_LINK_NOARG(SvxLineEndWindow, SelectHdl, ValueSet*, void)
296 {
297  std::unique_ptr<XLineEndItem> pLineEndItem;
298  std::unique_ptr<XLineStartItem> pLineStartItem;
299  sal_uInt16 nId = mxLineEndSet->GetSelectedItemId();
300 
301  if( nId == 1 )
302  {
303  pLineStartItem.reset(new XLineStartItem());
304  }
305  else if( nId == 2 )
306  {
307  pLineEndItem.reset(new XLineEndItem());
308  }
309  else if( nId % 2 ) // beginning of line
310  {
311  const XLineEndEntry* pEntry = mpLineEndList->GetLineEnd( (nId - 1) / 2 - 1 );
312  pLineStartItem.reset(new XLineStartItem(pEntry->GetName(), pEntry->GetLineEnd()));
313  }
314  else // end of line
315  {
316  const XLineEndEntry* pEntry = mpLineEndList->GetLineEnd( nId / 2 - 2 );
317  pLineEndItem.reset(new XLineEndItem(pEntry->GetName(), pEntry->GetLineEnd()));
318  }
319 
320  Sequence< PropertyValue > aArgs( 1 );
321  Any a;
322 
323  if ( pLineStartItem )
324  {
325  aArgs[0].Name = "LineStart";
326  pLineStartItem->QueryValue( a );
327  aArgs[0].Value = a;
328  }
329  else
330  {
331  aArgs[0].Name = "LineEnd";
332  pLineEndItem->QueryValue( a );
333  aArgs[0].Value = a;
334  }
335 
336  /* #i33380# DR 2004-09-03 Moved the following line above the Dispatch() call.
337  This instance may be deleted in the meantime (i.e. when a dialog is opened
338  while in Dispatch()), accessing members will crash in this case. */
339  mxLineEndSet->SetNoSelection();
340 
341  mxControl->dispatchCommand(mxControl->getCommandURL(), aArgs);
342 
343  mxControl->EndPopupMode();
344 }
345 
346 void SvxLineEndWindow::FillValueSet()
347 {
348  if( !mpLineEndList.is() )
349  return;
350 
352 
353  long nCount = mpLineEndList->Count();
354 
355  // First entry: no line end.
356  // An entry is temporarily added to get the UI bitmap
357  basegfx::B2DPolyPolygon aNothing;
358  mpLineEndList->Insert(std::make_unique<XLineEndEntry>(aNothing,
359  comphelper::LibreOfficeKit::isActive() ? SvxResId(RID_SVXSTR_INVISIBLE)
360  : SvxResId(RID_SVXSTR_NONE)));
361  const XLineEndEntry* pEntry = mpLineEndList->GetLineEnd(nCount);
362  BitmapEx aBmp = mpLineEndList->GetUiBitmap( nCount );
363  OSL_ENSURE( !aBmp.IsEmpty(), "UI bitmap was not created" );
364 
365  maBmpSize = aBmp.GetSizePixel();
366  pVD->SetOutputSizePixel( maBmpSize, false );
367  maBmpSize.setWidth( maBmpSize.Width() / 2 );
368  Point aPt0( 0, 0 );
369  Point aPt1( maBmpSize.Width(), 0 );
370 
371  pVD->DrawBitmapEx( Point(), aBmp );
372  mxLineEndSet->InsertItem(1, Image(pVD->GetBitmapEx(aPt0, maBmpSize)), pEntry->GetName());
373  mxLineEndSet->InsertItem(2, Image(pVD->GetBitmapEx(aPt1, maBmpSize)), pEntry->GetName());
374 
375  mpLineEndList->Remove(nCount);
376 
377  for( long i = 0; i < nCount; i++ )
378  {
379  pEntry = mpLineEndList->GetLineEnd( i );
380  DBG_ASSERT( pEntry, "Could not access LineEndEntry" );
381  aBmp = mpLineEndList->GetUiBitmap( i );
382  OSL_ENSURE( !aBmp.IsEmpty(), "UI bitmap was not created" );
383 
384  pVD->DrawBitmapEx( aPt0, aBmp );
385  mxLineEndSet->InsertItem(static_cast<sal_uInt16>((i+1)*2L+1),
386  Image(pVD->GetBitmapEx(aPt0, maBmpSize)), pEntry->GetName());
387  mxLineEndSet->InsertItem(static_cast<sal_uInt16>((i+2)*2L),
388  Image(pVD->GetBitmapEx(aPt1, maBmpSize)), pEntry->GetName());
389  }
390  mnLines = std::min( static_cast<sal_uInt16>(nCount + 1), sal_uInt16(MAX_LINES) );
391  mxLineEndSet->SetLineCount( mnLines );
392 
393  SetSize();
394 }
395 
396 void SvxLineEndWindow::statusChanged( const css::frame::FeatureStateEvent& rEvent )
397 {
398  if ( rEvent.FeatureURL.Complete != ".uno:LineEndListState" )
399  return;
400 
401  // The list of line ends (LineEndList) has changed
402  css::uno::Reference< css::uno::XWeak > xWeak;
403  if ( rEvent.State >>= xWeak )
404  {
405  mpLineEndList.set( static_cast< XLineEndList* >( xWeak.get() ) );
406  DBG_ASSERT( mpLineEndList.is(), "LineEndList not found" );
407 
408  mxLineEndSet->Clear();
409  FillValueSet();
410  }
411 }
412 
413 void SvxLineEndWindow::SetSize()
414 {
415  sal_uInt16 nItemCount = mxLineEndSet->GetItemCount();
416  sal_uInt16 nMaxLines = nItemCount / gnCols;
417 
418  WinBits nBits = mxLineEndSet->GetStyle();
419  if ( mnLines == nMaxLines )
420  nBits &= ~WB_VSCROLL;
421  else
422  nBits |= WB_VSCROLL;
423  mxLineEndSet->SetStyle( nBits );
424 
425  Size aSize( maBmpSize );
426  aSize.AdjustWidth(6 );
427  aSize.AdjustHeight(6 );
428  aSize = mxLineEndSet->CalcWindowSizePixel( aSize );
429  mxLineEndSet->GetDrawingArea()->set_size_request(aSize.Width(), aSize.Height());
430  mxLineEndSet->SetOutputSizePixel(aSize);
431 }
432 
433 SvxLineEndToolBoxControl::SvxLineEndToolBoxControl( const css::uno::Reference<css::uno::XComponentContext>& rContext )
434  : svt::PopupWindowController( rContext, nullptr, OUString() )
435 {
436 }
437 
438 void SAL_CALL SvxLineEndToolBoxControl::execute(sal_Int16 /*KeyModifier*/)
439 {
440  if (m_pToolbar)
441  {
442  // Toggle the popup also when toolbutton is activated
443  const OString aId(m_aCommandURL.toUtf8());
444  m_pToolbar->set_menu_item_active(aId, !m_pToolbar->get_menu_item_active(aId));
445  }
446  else
447  {
448  // Open the popup also when Enter key is pressed.
449  createPopupWindow();
450  }
451 }
452 
453 void SvxLineEndToolBoxControl::initialize( const css::uno::Sequence<css::uno::Any>& rArguments )
454 {
455  svt::PopupWindowController::initialize( rArguments );
456 
457  if (m_pToolbar)
458  {
459  mxPopoverContainer.reset(new ToolbarPopupContainer(m_pToolbar));
460  m_pToolbar->set_item_popover(m_aCommandURL.toUtf8(), mxPopoverContainer->getTopLevel());
461  }
462 
463  ToolBox* pToolBox = nullptr;
464  sal_uInt16 nId = 0;
465  if ( getToolboxId( nId, &pToolBox ) )
466  pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) | ToolBoxItemBits::DROPDOWNONLY );
467 }
468 
469 std::unique_ptr<WeldToolbarPopup> SvxLineEndToolBoxControl::weldPopupWindow()
470 {
471  return std::make_unique<SvxLineEndWindow>(this, m_pToolbar);
472 }
473 
474 VclPtr<vcl::Window> SvxLineEndToolBoxControl::createVclPopupWindow( vcl::Window* pParent )
475 {
476  mxInterimPopover = VclPtr<InterimToolbarPopup>::Create(getFrameInterface(), pParent,
477  std::make_unique<SvxLineEndWindow>(this, pParent->GetFrameWeld()));
478 
479  mxInterimPopover->Show();
480 
481  mxInterimPopover->SetText(SvxResId(RID_SVXSTR_LINEEND));
482 
483  return mxInterimPopover;
484 }
485 
486 OUString SvxLineEndToolBoxControl::getImplementationName()
487 {
488  return "com.sun.star.comp.svx.LineEndToolBoxControl";
489 }
490 
491 css::uno::Sequence<OUString> SvxLineEndToolBoxControl::getSupportedServiceNames()
492 {
493  return { "com.sun.star.frame.ToolbarController" };
494 }
495 
496 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
498  css::uno::XComponentContext* rContext,
499  css::uno::Sequence<css::uno::Any> const & )
500 {
501  return cppu::acquire( new SvxLineEndToolBoxControl( rContext ) );
502 }
503 
504 SvxLineBox::SvxLineBox(SvxLineStyleToolBoxControl* pControl, weld::Widget* pParent, int nInitialIndex)
505  : WeldToolbarPopup(pControl->getFrameInterface(), pParent, "svx/ui/floatinglinestyle.ui", "FloatingLineStyle")
506  , mxControl(pControl)
507  , mxLineStyleSet(new ValueSet(m_xBuilder->weld_scrolled_window("valuesetwin", true)))
508  , mxLineStyleSetWin(new weld::CustomWeld(*m_xBuilder, "valueset", *mxLineStyleSet))
509 {
511 
512  FillControl();
513 
514  mxLineStyleSet->SelectItem(nInitialIndex + 1);
515 
516  mxLineStyleSet->SetSelectHdl( LINK( this, SvxLineBox, SelectHdl ) );
517 }
518 
520 {
521  mxLineStyleSet->GrabFocus();
522 }
523 
525 {
526 }
527 
528 // Fills the listbox (provisional) with strings
529 
530 void SvxLineBox::Fill( const XDashListRef &pList )
531 {
532  mxLineStyleSet->Clear();
533 
534  if( !pList.is() )
535  return;
536 
537  // entry for 'none'
538  mxLineStyleSet->InsertItem(1, Image(), pList->GetStringForUiNoLine());
539 
540  // entry for solid line
541  auto aBmp = pList->GetBitmapForUISolidLine();
542  Size aBmpSize = aBmp.GetSizePixel();
543  mxLineStyleSet->InsertItem(2, Image(aBmp), pList->GetStringForUiSolidLine());
544 
545  // entries for dashed lines
546  long nCount = pList->Count();
547  for( long i = 0; i < nCount; i++ )
548  {
549  const XDashEntry* pEntry = pList->GetDash(i);
550  const BitmapEx aBitmap = pList->GetUiBitmap(i);
551 
552  mxLineStyleSet->InsertItem(i + 3, Image(aBitmap), pEntry->GetName());
553  }
554 
555  sal_uInt16 nLines = std::min( static_cast<sal_uInt16>(nCount + 2), sal_uInt16(MAX_LINES) );
556  mxLineStyleSet->SetLineCount(nLines);
557 
558  WinBits nBits = mxLineStyleSet->GetStyle();
559  if ( nLines == mxLineStyleSet->GetItemCount() )
560  nBits &= ~WB_VSCROLL;
561  else
562  nBits |= WB_VSCROLL;
563  mxLineStyleSet->SetStyle( nBits );
564 
565  Size aSize(aBmpSize);
566  aSize.AdjustWidth(6);
567  aSize.AdjustHeight(6);
568  aSize = mxLineStyleSet->CalcWindowSizePixel(aSize);
569  mxLineStyleSet->GetDrawingArea()->set_size_request(aSize.Width(), aSize.Height());
570  mxLineStyleSet->SetOutputSizePixel(aSize);
571 }
572 
574 {
575  drawing::LineStyle eXLS;
576  sal_Int32 nPos = mxLineStyleSet->GetSelectedItemId();
577  --nPos; // ids start at 1, get the pos of the id
578 
579  switch ( nPos )
580  {
581  case 0:
582  eXLS = drawing::LineStyle_NONE;
583  break;
584 
585  case 1:
586  eXLS = drawing::LineStyle_SOLID;
587  break;
588 
589  default:
590  {
591  eXLS = drawing::LineStyle_DASH;
592 
593  if ( nPos != -1 &&
595  SfxObjectShell::Current()->GetItem( SID_DASH_LIST ) )
596  {
597  // LineDashItem will only be sent if it also has a dash.
598  // Notify cares!
599  SvxDashListItem const * pItem = SfxObjectShell::Current()->GetItem( SID_DASH_LIST );
600  const XDashEntry* pEntry = pItem->GetDashList()->GetDash(nPos - 2);
601  XLineDashItem aLineDashItem(pEntry->GetName(), pEntry->GetDash());
602 
603  Any a;
604  Sequence< PropertyValue > aArgs( 1 );
605  aArgs[0].Name = "LineDash";
606  aLineDashItem.QueryValue ( a );
607  aArgs[0].Value = a;
608  mxControl->dispatchLineStyleCommand(".uno:LineDash", aArgs);
609  }
610  }
611  break;
612  }
613 
614  XLineStyleItem aLineStyleItem( eXLS );
615  Any a;
616  Sequence< PropertyValue > aArgs( 1 );
617  aArgs[0].Name = "XLineStyle";
618  aLineStyleItem.QueryValue ( a );
619  aArgs[0].Value = a;
620  mxControl->dispatchLineStyleCommand(".uno:XLineStyle", aArgs);
621 
622  mxControl->EndPopupMode();
623 }
624 
626 {
628  if (pSh)
629  {
630  const SvxDashListItem* pItem = pSh->GetItem( SID_DASH_LIST );
631  if (pItem)
632  Fill(pItem->GetDashList());
633  }
634 }
635 
636 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual ~SvxLineBox() override
Definition: linectrl.cxx:524
long Width() const
bool Erase(const Color &rFillColor)
sal_Int32 nIndex
LineStyleSelectFunction m_aLineStyleSelectFunction
Definition: linectrl.hxx:42
long AdjustWidth(long n)
long Height() const
virtual OUString SAL_CALL getImplementationName() override=0
const SfxPoolItem * GetItem(const SwTextAttr &rAttr, sal_uInt16 nWhich)
ToolBoxItemBits GetItemBits(sal_uInt16 nItemId) const
static const AllSettings & GetSettings()
std::unique_ptr< ToolbarPopupContainer > mxPopoverContainer
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override=0
sal_Int16 nId
OUString aId
static SfxObjectShell * Current()
WinBits const WB_VSCROLL
void Fill(const XDashListRef &pList)
Definition: linectrl.cxx:530
long AdjustHeight(long n)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: linectrl.cxx:204
css::uno::Reference< css::graphic::XGraphic > GetXGraphic() const
void FillControl()
Definition: linectrl.cxx:625
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_svx_LineEndToolBoxControl_get_implementation(css::uno::XComponentContext *rContext, css::uno::Sequence< css::uno::Any > const &)
Definition: linectrl.cxx:497
Value
weld::Window * GetFrameWeld() const
IMPL_LINK_NOARG(SvxLineEndWindow, SelectHdl, ValueSet *, void)
Definition: linectrl.cxx:295
sal_Int64 WinBits
OUString SvxResId(const char *pId)
Definition: dialmgr.cxx:28
#define WB_ITEMBORDER
bool dispatchCommand(const OUString &rCommand, const uno::Reference< css::frame::XFrame > &rFrame, const css::uno::Sequence< css::beans::PropertyValue > &rArguments, const uno::Reference< css::frame::XDispatchResultListener > &rListener)
int nCount
virtual void statusChanged(const css::frame::FeatureStateEvent &Event)
const XDash & GetDash() const
Definition: xtable.hxx:80
void EnableItem(sal_uInt16 nItemId, bool bEnable=true)
std::unique_ptr< svx::ToolboxButtonLineStyleUpdater > m_xBtnUpdater
Definition: linectrl.hxx:40
std::unique_ptr< ValueSet > mxLineStyleSet
Definition: itemwin.hxx:34
const OUString & GetName() const
#define HID_POPUP_LINEEND
Definition: helpids.h:37
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
bool IsEmpty() const
void setLineStyleSelectFunction(const LineStyleSelectFunction &aLineStyleSelectFunction)
Definition: linectrl.cxx:171
SvxLineStyleToolBoxControl(const css::uno::Reference< css::uno::XComponentContext > &rContext)
Definition: linectrl.cxx:60
const XDashListRef & GetDashList() const
Definition: drawitem.hxx:171
virtual std::unique_ptr< WeldToolbarPopup > weldPopupWindow()
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &rArguments) override
Definition: linectrl.cxx:151
#define DBG_ASSERT(sCon, aError)
int i
uno_Any a
#define MAX_LINES
Definition: linectrl.cxx:58
void SetItemBits(sal_uInt16 nItemId, ToolBoxItemBits nBits)
std::function< bool(const OUString &, const css::uno::Any &)> LineStyleSelectFunction
Definition: linectrl.hxx:32
virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createPopupWindow() override
virtual VclPtr< vcl::Window > createVclPopupWindow(vcl::Window *pParent)=0
DECL_LINK(FocusHdl, weld::Widget &, void)
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
Definition: xattr.cxx:375
SvxLineBox(SvxLineStyleToolBoxControl *pControl, weld::Widget *pParent, int nInitialIndex)
Definition: linectrl.cxx:504
VclPtr< InterimToolbarPopup > mxInterimPopover
virtual VclPtr< vcl::Window > createVclPopupWindow(vcl::Window *pParent) override
Definition: linectrl.cxx:189
#define HID_POPUP_LINEEND_CTRL
Definition: helpids.h:38
virtual void SAL_CALL statusChanged(const css::frame::FeatureStateEvent &rEvent) override
Definition: linectrl.cxx:70
WinBits const WB_3DLOOK
const basegfx::B2DPolyPolygon & GetLineEnd() const
Definition: xtable.hxx:65
constexpr sal_uInt16 gnCols
Definition: linectrl.cxx:264
virtual std::unique_ptr< WeldToolbarPopup > weldPopupWindow() override
Definition: linectrl.cxx:184
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_svx_LineStyleToolBoxControl_get_implementation(css::uno::XComponentContext *rContext, css::uno::Sequence< css::uno::Any > const &)
Definition: linectrl.cxx:210
#define WB_NO_DIRECTSELECT
virtual void GrabFocus() override
Definition: linectrl.cxx:519
void SetItemImage(sal_uInt16 nItemId, const Image &rImage)
static VclPtr< reference_type > Create(Arg &&...arg)
virtual void SAL_CALL execute(sal_Int16 nKeyModifier) override
Definition: linectrl.cxx:136
void dispatchLineStyleCommand(const OUString &rCommand, const css::uno::Sequence< css::beans::PropertyValue > &rArgs)
Definition: linectrl.cxx:176
OUString sId
virtual OUString SAL_CALL getImplementationName() override
Definition: linectrl.cxx:199
#define WB_FLATVALUESET
const Size & GetSizePixel() const
virtual void GrabFocus()=0
sal_uInt16 nPos
virtual ~SvxLineStyleToolBoxControl() override
Definition: linectrl.cxx:66