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