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