tdf#164803 sw: Fix SwTextSizeInfo applying grid metrics without grid
[LibreOffice.git] / forms / source / solar / control / navtoolbar.cxx
blobf637ca3154d5807293555785a7738031475d6978
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 #include <navtoolbar.hxx>
22 #include <frm_resource.hxx>
23 #include <featuredispatcher.hxx>
24 #include <strings.hrc>
25 #include <commandimageprovider.hxx>
27 #include <com/sun/star/uno/Any.hxx>
28 #include <com/sun/star/form/runtime/FormFeature.hpp>
30 #include <svx/labelitemwindow.hxx>
32 #include <utility>
33 #include <vcl/commandinfoprovider.hxx>
34 #include <vcl/toolbox.hxx>
36 #include <sal/macros.h>
37 #include <osl/diagnose.h>
38 #include <tools/debug.hxx>
40 #define LID_RECORD_LABEL 1000
41 #define LID_RECORD_FILLER 1001
44 namespace frm
48 using ::com::sun::star::uno::Any;
49 namespace FormFeature = ::com::sun::star::form::runtime::FormFeature;
52 namespace
54 bool isArtificialItem( sal_Int16 _nFeatureId )
56 return ( _nFeatureId == LID_RECORD_LABEL )
57 || ( _nFeatureId == LID_RECORD_FILLER );
60 OUString getLabelString(TranslateId pResId)
62 OUString sLabel( " " + ResourceManager::loadString(pResId) + " " );
63 return sLabel;
66 OUString lcl_getCommandURL( const sal_Int16 _nFormFeature )
68 const char* pAsciiCommandName = nullptr;
69 switch ( _nFormFeature )
71 case FormFeature::MoveAbsolute : pAsciiCommandName = "AbsoluteRecord"; break;
72 case FormFeature::TotalRecords : pAsciiCommandName = "RecTotal"; break;
73 case FormFeature::MoveToFirst : pAsciiCommandName = "FirstRecord"; break;
74 case FormFeature::MoveToPrevious : pAsciiCommandName = "PrevRecord"; break;
75 case FormFeature::MoveToNext : pAsciiCommandName = "NextRecord"; break;
76 case FormFeature::MoveToLast : pAsciiCommandName = "LastRecord"; break;
77 case FormFeature::SaveRecordChanges : pAsciiCommandName = "RecSave"; break;
78 case FormFeature::UndoRecordChanges : pAsciiCommandName = "RecUndo"; break;
79 case FormFeature::MoveToInsertRow : pAsciiCommandName = "NewRecord"; break;
80 case FormFeature::DeleteRecord : pAsciiCommandName = "DeleteRecord"; break;
81 case FormFeature::ReloadForm : pAsciiCommandName = "Refresh"; break;
82 case FormFeature::RefreshCurrentControl : pAsciiCommandName = "RefreshFormControl"; break;
83 case FormFeature::SortAscending : pAsciiCommandName = "Sortup"; break;
84 case FormFeature::SortDescending : pAsciiCommandName = "SortDown"; break;
85 case FormFeature::InteractiveSort : pAsciiCommandName = "OrderCrit"; break;
86 case FormFeature::AutoFilter : pAsciiCommandName = "AutoFilter"; break;
87 case FormFeature::InteractiveFilter : pAsciiCommandName = "FilterCrit"; break;
88 case FormFeature::ToggleApplyFilter : pAsciiCommandName = "FormFiltered"; break;
89 case FormFeature::RemoveFilterAndSort : pAsciiCommandName = "RemoveFilterSort"; break;
91 if ( pAsciiCommandName != nullptr )
92 return ".uno:" + OUString::createFromAscii( pAsciiCommandName );
94 return OUString();
98 class ImplNavToolBar : public ToolBox
100 protected:
101 const IFeatureDispatcher* m_pDispatcher;
103 public:
104 explicit ImplNavToolBar( vcl::Window* _pParent )
105 :ToolBox( _pParent, WB_3DLOOK )
106 ,m_pDispatcher( nullptr )
110 void setDispatcher( const IFeatureDispatcher* _pDispatcher )
112 m_pDispatcher = _pDispatcher;
115 protected:
116 // ToolBox overridables
117 virtual void Select() override;
122 void ImplNavToolBar::Select()
124 if ( m_pDispatcher )
126 sal_Int16 nFeatureId = sal_uInt16(GetCurItemId());
127 if ( !m_pDispatcher->isEnabled( nFeatureId ) )
128 // the toolbox is a little bit buggy: With ToolBoxItemBits::REPEAT, it sometimes
129 // happens that a select is reported, even though the respective
130 // item has just been disabled.
131 return;
132 m_pDispatcher->dispatch( nFeatureId );
136 NavigationToolBar::NavigationToolBar( vcl::Window* _pParent, WinBits _nStyle,
137 PCommandImageProvider _pImageProvider,
138 OUString sModuleId )
139 :Window( _pParent, _nStyle )
140 ,m_pDispatcher( nullptr )
141 ,m_pImageProvider(std::move( _pImageProvider ))
142 ,m_eImageSize( eSmall )
143 ,m_pToolbar( nullptr )
144 ,m_sModuleId(std::move( sModuleId ))
146 implInit( );
149 NavigationToolBar::~NavigationToolBar( )
151 disposeOnce();
154 void NavigationToolBar::dispose()
156 for (auto & childWin : m_aChildWins)
157 childWin.disposeAndClear();
158 m_aChildWins.clear();
159 m_pToolbar.disposeAndClear();
160 vcl::Window::dispose();
163 void NavigationToolBar::setDispatcher( const IFeatureDispatcher* _pDispatcher )
165 m_pDispatcher = _pDispatcher;
167 m_pToolbar->setDispatcher( _pDispatcher );
169 RecordPositionInput* pPositionWindow = static_cast< RecordPositionInput* >( m_pToolbar->GetItemWindow( ToolBoxItemId(FormFeature::MoveAbsolute) ) );
170 OSL_ENSURE( pPositionWindow, "NavigationToolBar::setDispatcher: can't forward the dispatcher to the position window!" );
171 if ( pPositionWindow )
172 pPositionWindow->setDispatcher( _pDispatcher );
174 // update feature states
175 for ( ToolBox::ImplToolItems::size_type nPos = 0; nPos < m_pToolbar->GetItemCount(); ++nPos )
177 sal_uInt16 nItemId = sal_uInt16(m_pToolbar->GetItemId( nPos ));
179 if ( ( nItemId == LID_RECORD_LABEL ) || ( nItemId == LID_RECORD_FILLER ) )
180 continue;
182 // is this item enabled?
183 bool bEnabled = m_pDispatcher && m_pDispatcher->isEnabled( nItemId );
184 implEnableItem( nItemId, bEnabled );
188 void NavigationToolBar::implEnableItem( sal_uInt16 _nItemId, bool _bEnabled )
190 m_pToolbar->EnableItem( ToolBoxItemId(_nItemId), _bEnabled );
192 if ( _nItemId == FormFeature::MoveAbsolute )
193 m_pToolbar->EnableItem( ToolBoxItemId(LID_RECORD_LABEL), _bEnabled );
195 if ( _nItemId == FormFeature::TotalRecords )
196 m_pToolbar->EnableItem( ToolBoxItemId(LID_RECORD_FILLER), _bEnabled );
199 void NavigationToolBar::enableFeature( sal_Int16 _nFeatureId, bool _bEnabled )
201 DBG_ASSERT( m_pToolbar->GetItemPos( ToolBoxItemId(_nFeatureId) ) != ToolBox::ITEM_NOTFOUND,
202 "NavigationToolBar::enableFeature: invalid id!" );
204 implEnableItem( static_cast<sal_uInt16>(_nFeatureId), _bEnabled );
207 void NavigationToolBar::checkFeature( sal_Int16 _nFeatureId, bool _bEnabled )
209 DBG_ASSERT( m_pToolbar->GetItemPos( ToolBoxItemId(_nFeatureId) ) != ToolBox::ITEM_NOTFOUND,
210 "NavigationToolBar::checkFeature: invalid id!" );
212 m_pToolbar->CheckItem( ToolBoxItemId(_nFeatureId), _bEnabled );
215 void NavigationToolBar::setFeatureText( sal_Int16 _nFeatureId, const OUString& _rText )
217 DBG_ASSERT( m_pToolbar->GetItemPos( ToolBoxItemId(_nFeatureId) ) != ToolBox::ITEM_NOTFOUND,
218 "NavigationToolBar::checkFeature: invalid id!" );
220 vcl::Window* pItemWindow = m_pToolbar->GetItemWindow( ToolBoxItemId(_nFeatureId) );
221 if ( pItemWindow )
223 if (_nFeatureId == FormFeature::TotalRecords)
224 static_cast<LabelItemWindow*>(pItemWindow)->set_label(_rText);
225 else if (_nFeatureId == FormFeature::MoveAbsolute)
226 static_cast<RecordPositionInput*>(pItemWindow)->set_text(_rText);
228 else
229 m_pToolbar->SetItemText( ToolBoxItemId(_nFeatureId), _rText );
232 void NavigationToolBar::implInit( )
234 m_pToolbar = VclPtr<ImplNavToolBar>::Create( this );
235 m_pToolbar->Show();
237 // need the SfxApplication for retrieving information about our
238 // items. We could duplicate all the information here in our lib
239 // (such as the item text and the image), but why should we?
241 static struct FeatureDescription
243 sal_uInt16 nId;
244 bool bRepeat;
245 bool bItemWindow;
246 } const aSupportedFeatures[] =
248 { LID_RECORD_LABEL, false, true },
249 { FormFeature::MoveAbsolute, false, true },
250 { LID_RECORD_FILLER, false, true },
251 { FormFeature::TotalRecords, false, true },
252 { FormFeature::MoveToFirst, true, false },
253 { FormFeature::MoveToPrevious, true, false },
254 { FormFeature::MoveToNext, true, false },
255 { FormFeature::MoveToLast, true, false },
256 { FormFeature::MoveToInsertRow, false, false },
257 { 0, false, false },
258 { FormFeature::SaveRecordChanges, false, false },
259 { FormFeature::UndoRecordChanges, false, false },
260 { FormFeature::DeleteRecord, false, false },
261 { FormFeature::ReloadForm, false, false },
262 { FormFeature::RefreshCurrentControl, false, false },
263 { 0, false, false },
264 { FormFeature::SortAscending, false, false },
265 { FormFeature::SortDescending, false, false },
266 { FormFeature::InteractiveSort, false, false },
267 { FormFeature::AutoFilter, false, false },
268 { FormFeature::InteractiveFilter, false, false },
269 { FormFeature::ToggleApplyFilter, false, false },
270 { FormFeature::RemoveFilterAndSort, false, false },
273 FeatureDescription const * pSupportedFeatures = aSupportedFeatures;
274 FeatureDescription const * pSupportedFeaturesEnd = aSupportedFeatures + SAL_N_ELEMENTS( aSupportedFeatures );
275 for ( ; pSupportedFeatures < pSupportedFeaturesEnd; ++pSupportedFeatures )
277 if ( pSupportedFeatures->nId )
278 { // it's _not_ a separator
280 // insert the entry
281 OUString sCommandURL( lcl_getCommandURL( pSupportedFeatures->nId ) );
282 m_pToolbar->InsertItem( ToolBoxItemId(pSupportedFeatures->nId), OUString(), sCommandURL, pSupportedFeatures->bRepeat ? ToolBoxItemBits::REPEAT : ToolBoxItemBits::NONE );
283 m_pToolbar->SetQuickHelpText( ToolBoxItemId(pSupportedFeatures->nId), OUString() ); // TODO
285 if ( !isArtificialItem( pSupportedFeatures->nId ) )
287 auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(sCommandURL, m_sModuleId);
288 m_pToolbar->SetQuickHelpText(ToolBoxItemId(pSupportedFeatures->nId),
289 vcl::CommandInfoProvider::GetLabelForCommand(aProperties));
292 if ( pSupportedFeatures->bItemWindow )
294 vcl::Window* pItemWindow = nullptr;
295 if ( FormFeature::MoveAbsolute == pSupportedFeatures->nId )
297 pItemWindow = VclPtr<RecordPositionInput>::Create( m_pToolbar );
298 static_cast< RecordPositionInput* >( pItemWindow )->setDispatcher( m_pDispatcher );
300 else if (pSupportedFeatures->nId == LID_RECORD_FILLER)
301 pItemWindow = VclPtr<LabelItemWindow>::Create(m_pToolbar, getLabelString(RID_STR_LABEL_OF));
302 else if (pSupportedFeatures->nId == LID_RECORD_LABEL)
303 pItemWindow = VclPtr<LabelItemWindow>::Create(m_pToolbar, getLabelString(RID_STR_LABEL_RECORD));
304 else if (pSupportedFeatures->nId == FormFeature::TotalRecords)
305 pItemWindow = VclPtr<LabelItemWindow>::Create(m_pToolbar, "");
307 m_aChildWins.emplace_back(pItemWindow );
308 m_pToolbar->SetItemWindow( ToolBoxItemId(pSupportedFeatures->nId), pItemWindow );
311 else
312 { // a separator
313 m_pToolbar->InsertSeparator( );
317 forEachItemWindow( &NavigationToolBar::adjustItemWindowWidth );
319 implUpdateImages();
323 void NavigationToolBar::implUpdateImages()
325 OSL_ENSURE( m_pImageProvider, "NavigationToolBar::implUpdateImages: no image provider => no images!" );
326 if ( !m_pImageProvider )
327 return;
329 const ToolBox::ImplToolItems::size_type nItemCount = m_pToolbar->GetItemCount();
331 // collect the FormFeatures in the toolbar
332 std::vector<sal_Int16> aFormFeatures;
333 aFormFeatures.reserve( nItemCount );
335 for ( ToolBox::ImplToolItems::size_type i=0; i<nItemCount; ++i )
337 ToolBoxItemId nId = m_pToolbar->GetItemId( i );
338 if ( ( ToolBoxItemType::BUTTON == m_pToolbar->GetItemType( i ) ) && !isArtificialItem( sal_uInt16(nId) ) )
339 aFormFeatures.push_back( sal_uInt16(nId) );
342 // translate them into command URLs
343 css::uno::Sequence< OUString > aCommandURLs( aFormFeatures.size() );
344 auto aCommandURLsRange = asNonConstRange(aCommandURLs);
345 size_t i = 0;
346 for (auto const& formFeature : aFormFeatures)
348 aCommandURLsRange[i++] = lcl_getCommandURL(formFeature);
351 // retrieve the images for the command URLs
352 std::vector<Image> aCommandImages = m_pImageProvider->getCommandImages( aCommandURLs, m_eImageSize == eLarge );
354 // and set them at the toolbar
355 auto commandImage = aCommandImages.begin();
356 for (sal_Int16 formFeature : aFormFeatures)
358 m_pToolbar->SetItemImage( ToolBoxItemId(formFeature), *commandImage );
359 ++commandImage;
362 // parts of our layout is dependent on the size of our icons
363 Resize();
367 void NavigationToolBar::implSetImageSize( ImageSize _eSize )
369 if ( _eSize != m_eImageSize )
371 m_eImageSize = _eSize;
372 implUpdateImages();
377 void NavigationToolBar::SetImageSize( ImageSize _eSize )
379 implSetImageSize( _eSize );
383 void NavigationToolBar::ShowFunctionGroup( FunctionGroup _eGroup, bool _bShow )
385 const sal_uInt16* pGroupIds = nullptr;
387 switch ( _eGroup )
389 case ePosition:
391 static const sal_uInt16 aPositionIds[] = {
392 LID_RECORD_LABEL, FormFeature::MoveAbsolute, LID_RECORD_FILLER, FormFeature::TotalRecords, 0
394 pGroupIds = aPositionIds;
396 break;
397 case eNavigation:
399 static const sal_uInt16 aNavigationIds[] = {
400 FormFeature::MoveToFirst, FormFeature::MoveToPrevious, FormFeature::MoveToNext, FormFeature::MoveToLast, FormFeature::MoveToInsertRow, 0
402 pGroupIds = aNavigationIds;
404 break;
405 case eRecordActions:
407 static const sal_uInt16 aActionIds[] = {
408 FormFeature::SaveRecordChanges, FormFeature::UndoRecordChanges, FormFeature::DeleteRecord, FormFeature::ReloadForm, FormFeature::RefreshCurrentControl, 0
410 pGroupIds = aActionIds;
412 break;
413 case eFilterSort:
415 static const sal_uInt16 aFilterSortIds[] = {
416 FormFeature::SortAscending, FormFeature::SortDescending, FormFeature::InteractiveSort, FormFeature::AutoFilter, FormFeature::InteractiveFilter, FormFeature::ToggleApplyFilter, FormFeature::RemoveFilterAndSort, 0
418 pGroupIds = aFilterSortIds;
420 break;
421 default:
422 OSL_FAIL( "NavigationToolBar::ShowFunctionGroup: invalid group id!" );
425 if ( pGroupIds )
426 while ( *pGroupIds )
427 m_pToolbar->ShowItem( ToolBoxItemId(*pGroupIds++), _bShow );
431 bool NavigationToolBar::IsFunctionGroupVisible( FunctionGroup _eGroup )
433 sal_uInt16 nIndicatorItem = 0;
434 switch ( _eGroup )
436 case ePosition : nIndicatorItem = LID_RECORD_LABEL; break;
437 case eNavigation : nIndicatorItem = FormFeature::MoveToFirst; break;
438 case eRecordActions : nIndicatorItem = FormFeature::SaveRecordChanges; break;
439 case eFilterSort : nIndicatorItem = FormFeature::SortAscending; break;
440 default:
441 OSL_FAIL( "NavigationToolBar::IsFunctionGroupVisible: invalid group id!" );
444 return m_pToolbar->IsItemVisible( ToolBoxItemId(nIndicatorItem) );
448 void NavigationToolBar::StateChanged( StateChangedType nType )
450 Window::StateChanged( nType );
452 switch ( nType )
454 case StateChangedType::Zoom:
455 // m_pToolbar->SetZoom( GetZoom() );
456 // forEachItemWindow( setItemWindowZoom, NULL );
457 // the ToolBox class is not zoomable at the moment, so
458 // we better have no zoom at all instead of only half a zoom ...
459 break;
461 case StateChangedType::ControlFont:
462 forEachItemWindow( &NavigationToolBar::setItemControlFont );
463 forEachItemWindow( &NavigationToolBar::adjustItemWindowWidth );
464 break;
466 case StateChangedType::ControlForeground:
467 forEachItemWindow( &NavigationToolBar::setItemControlForeground );
468 break;
470 case StateChangedType::Mirroring:
472 sal_Bool bIsRTLEnabled( IsRTLEnabled() );
473 m_pToolbar->EnableRTL( bIsRTLEnabled );
474 forEachItemWindow( &NavigationToolBar::enableItemRTL, &bIsRTLEnabled );
475 Resize();
477 break;
478 default:;
482 void NavigationToolBar::Resize()
484 // resize/position the toolbox as a whole
485 sal_Int32 nToolbarHeight = m_pToolbar->CalcWindowSizePixel().Height();
487 sal_Int32 nMyHeight = GetOutputSizePixel().Height();
488 m_pToolbar->SetPosSizePixel( Point( 0, ( nMyHeight - nToolbarHeight ) / 2 ),
489 Size( GetSizePixel().Width(), nToolbarHeight ) );
491 Window::Resize();
494 void NavigationToolBar::SetControlBackground()
496 Window::SetControlBackground();
497 m_pToolbar->SetControlBackground();
498 forEachItemWindow( &NavigationToolBar::setItemBackground, nullptr );
500 implUpdateImages();
503 void NavigationToolBar::SetControlBackground( const Color& _rColor )
505 Window::SetControlBackground( _rColor );
506 m_pToolbar->SetControlBackground( _rColor );
507 forEachItemWindow( &NavigationToolBar::setItemBackground, &_rColor );
509 implUpdateImages();
512 void NavigationToolBar::SetTextLineColor( )
514 Window::SetTextLineColor( );
515 m_pToolbar->SetTextLineColor( );
516 forEachItemWindow( &NavigationToolBar::setTextLineColor, nullptr );
519 void NavigationToolBar::SetTextLineColor( const Color& _rColor )
521 Window::SetTextLineColor( _rColor );
522 m_pToolbar->SetTextLineColor( _rColor );
523 forEachItemWindow( &NavigationToolBar::setTextLineColor, &_rColor );
526 void NavigationToolBar::forEachItemWindow( ItemWindowHandler _handler )
528 for ( ToolBox::ImplToolItems::size_type item = 0; item < m_pToolbar->GetItemCount(); ++item )
530 ToolBoxItemId nItemId = m_pToolbar->GetItemId( item );
531 vcl::Window* pItemWindow = m_pToolbar->GetItemWindow( nItemId );
532 if ( pItemWindow )
533 (this->*_handler)( sal_uInt16(nItemId), pItemWindow );
537 void NavigationToolBar::forEachItemWindow( ItemWindowHandler2 _handler, const void* _pParam )
539 for ( ToolBox::ImplToolItems::size_type item = 0; item < m_pToolbar->GetItemCount(); ++item )
541 ToolBoxItemId nItemId = m_pToolbar->GetItemId( item );
542 vcl::Window* pItemWindow = m_pToolbar->GetItemWindow( nItemId );
543 if ( pItemWindow )
544 (*_handler)( sal_uInt16(nItemId), pItemWindow, _pParam );
548 void NavigationToolBar::setItemBackground( sal_uInt16 /* _nItemId */, vcl::Window* _pItemWindow, const void* _pColor )
550 if ( _pColor )
551 _pItemWindow->SetControlBackground( *static_cast< const Color* >( _pColor ) );
552 else
553 _pItemWindow->SetControlBackground();
556 void NavigationToolBar::setTextLineColor( sal_uInt16 /* _nItemId */, vcl::Window* _pItemWindow, const void* _pColor )
558 if ( _pColor )
559 _pItemWindow->SetTextLineColor( *static_cast< const Color* >( _pColor ) );
560 else
561 _pItemWindow->SetTextLineColor();
564 void NavigationToolBar::setItemControlFont( sal_uInt16 /* _nItemId */, vcl::Window* _pItemWindow ) const
566 if ( IsControlFont() )
567 _pItemWindow->SetControlFont( GetControlFont() );
568 else
569 _pItemWindow->SetControlFont( );
572 void NavigationToolBar::setItemControlForeground( sal_uInt16 /* _nItemId */, vcl::Window* _pItemWindow ) const
574 if ( IsControlForeground() )
575 _pItemWindow->SetControlForeground( GetControlForeground() );
576 else
577 _pItemWindow->SetControlForeground( );
578 _pItemWindow->SetTextColor( GetTextColor() );
581 void NavigationToolBar::adjustItemWindowWidth( sal_uInt16 _nItemId, vcl::Window* _pItemWindow ) const
583 int nHeight = 0;
585 OUString sItemText;
586 switch ( _nItemId )
588 case LID_RECORD_LABEL:
589 sItemText = getLabelString( RID_STR_LABEL_RECORD );
590 break;
592 case LID_RECORD_FILLER:
593 sItemText = getLabelString( RID_STR_LABEL_OF );
594 break;
596 case FormFeature::MoveAbsolute:
597 sItemText = "12345678";
598 nHeight = _pItemWindow->get_preferred_size().Height();
599 break;
601 case FormFeature::TotalRecords:
602 sItemText = "123456";
603 break;
606 if (nHeight == 0)
607 nHeight = _pItemWindow->GetTextHeight() + 4;
609 Size aSize(_pItemWindow->GetTextWidth(sItemText), nHeight);
610 aSize.AdjustWidth(6 );
611 _pItemWindow->SetSizePixel( aSize );
613 m_pToolbar->SetItemWindow( ToolBoxItemId(_nItemId), _pItemWindow );
616 void NavigationToolBar::enableItemRTL( sal_uInt16 /*_nItemId*/, vcl::Window* _pItemWindow, const void* _pIsRTLEnabled )
618 _pItemWindow->EnableRTL( *static_cast< const sal_Bool* >( _pIsRTLEnabled ) );
621 RecordPositionInput::RecordPositionInput(vcl::Window* pParent)
622 : RecordItemWindow(pParent)
623 , m_pDispatcher( nullptr )
627 void RecordPositionInput::setDispatcher( const IFeatureDispatcher* _pDispatcher )
629 m_pDispatcher = _pDispatcher;
632 void RecordPositionInput::PositionFired(sal_Int64 nRecord)
634 if (!m_pDispatcher)
635 return;
636 m_pDispatcher->dispatchWithArgument( FormFeature::MoveAbsolute, u"Position"_ustr, Any( static_cast<sal_Int32>(nRecord) ) );
639 } // namespace frm
641 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */