25#include <svx/strings.hrc>
27#include <com/sun/star/awt/XControl.hpp>
28#include <com/sun/star/form/runtime/XFormController.hpp>
29#include <com/sun/star/util/NumberFormatter.hpp>
30#include <com/sun/star/sdb/SQLContext.hpp>
44#include <svx/svxids.hrc>
53#include <bitmaps.hlst>
63 using ::com::sun::star::uno::Reference;
64 using ::com::sun::star::container::XIndexAccess;
65 using ::com::sun::star::uno::UNO_QUERY;
67 using ::com::sun::star::form::runtime::XFormController;
68 using ::com::sun::star::form::runtime::XFilterController;
69 using ::com::sun::star::form::runtime::XFilterControllerListener;
70 using ::com::sun::star::form::runtime::FilterEvent;
71 using ::com::sun::star::lang::EventObject;
72 using ::com::sun::star::form::XForm;
73 using ::com::sun::star::container::XChild;
74 using ::com::sun::star::awt::XControl;
75 using ::com::sun::star::sdbc::XConnection;
76 using ::com::sun::star::util::XNumberFormatsSupplier;
77 using ::com::sun::star::util::XNumberFormatter;
78 using ::com::sun::star::util::NumberFormatter;
79 using ::com::sun::star::sdbc::XRowSet;
80 using ::com::sun::star::lang::Locale;
81 using ::com::sun::star::sdb::SQLContext;
82 using ::com::sun::star::uno::XInterface;
83 using ::com::sun::star::uno::UNO_QUERY_THROW;
84 using ::com::sun::star::uno::UNO_SET_THROW;
85 using ::com::sun::star::uno::Exception;
86 using ::com::sun::star::uno::Sequence;
90 : m_pFormItem(nullptr)
123 return RID_SVXBMP_FORM;
139 return RID_SVXBMP_FILTER;
144 const OUString& aText,
145 const sal_Int32 _nComponentIndex )
147 ,m_aFieldName(
std::move(aFieldName))
148 ,m_nComponentIndex( _nComponentIndex )
154 return RID_SVXBMP_FIELD;
161class FmFilterHint :
public SfxHint
166 explicit FmFilterHint(FmFilterData* pData):
m_pData(
pData){}
170class FmFilterInsertedHint :
public FmFilterHint
175 FmFilterInsertedHint(FmFilterData* pData,
size_t nRelPos)
179 size_t GetPos()
const {
return m_nPos; }
182class FmFilterRemovedHint :
public FmFilterHint
185 explicit FmFilterRemovedHint(FmFilterData* pData)
186 :FmFilterHint(
pData){}
190class FmFilterTextChangedHint :
public FmFilterHint
193 explicit FmFilterTextChangedHint(FmFilterData* pData)
194 :FmFilterHint(
pData){}
197class FilterClearingHint :
public SfxHint
200 FilterClearingHint(){}
203class FmFilterCurrentChangedHint :
public SfxHint
206 FmFilterCurrentChangedHint(){}
221 virtual void SAL_CALL
disposing(
const EventObject& Source)
override;
232 void AddOrRemoveListener(
const Reference< XIndexAccess >& _rxControllers,
const bool _bAdd );
234 static void setText(sal_Int32 nPos,
236 const OUString& rText);
242 ,m_xControllers( xControllers )
256 for (sal_Int32
i = 0, nLen = _rxControllers->getCount();
i < nLen; ++
i)
258 Reference< XIndexAccess > xElement( _rxControllers->getByIndex(
i), UNO_QUERY );
264 Reference< XFilterController >
xController( xElement, UNO_QUERY );
265 OSL_ENSURE(
xController.is(),
"FmFilterAdapter::InsertElements: no XFilterController, cannot sync data!" );
271 xController->removeFilterControllerListener(
this );
279 const OUString& rText)
304 OUString lcl_getLabelName_nothrow(
const Reference< XControl >& _rxControl )
309 Reference< XPropertySet >
xModel( _rxControl->getModel(), UNO_QUERY_THROW );
312 catch(
const Exception& )
319 Reference< XPropertySet > lcl_getBoundField_nothrow(
const Reference< XControl >& _rxControl )
321 Reference< XPropertySet > xField;
324 Reference< XPropertySet > xModelProps( _rxControl->getModel(), UNO_QUERY_THROW );
327 catch(
const Exception& )
344 Reference< XFormController >
xController( Event.Source, UNO_QUERY_THROW );
345 Reference< XFilterController > xFilterController( Event.Source, UNO_QUERY_THROW );
346 Reference< XForm > xForm(
xController->getModel(), UNO_QUERY_THROW );
349 OSL_ENSURE( pFormItem,
"FmFilterAdapter::predicateExpressionChanged: don't know this form!" );
353 const sal_Int32 nActiveTerm( xFilterController->getActiveTerm() );
360 if ( !Event.PredicateExpression.isEmpty())
362 pFilterItem->
SetText( Event.PredicateExpression );
364 FmFilterTextChangedHint aChangeHint(pFilterItem);
376 OUString aFieldName( lcl_getLabelName_nothrow( xFilterController->getFilterComponent( Event.FilterComponent ) ) );
378 std::unique_ptr<FmFilterItem> pNewFilterItem(
new FmFilterItem(&rFilter, aFieldName, Event.PredicateExpression, Event.FilterComponent));
391 Reference< XFormController >
xController( Event.Source, UNO_QUERY_THROW );
392 Reference< XFilterController > xFilterController( Event.Source, UNO_QUERY_THROW );
393 Reference< XForm > xForm(
xController->getModel(), UNO_QUERY_THROW );
396 OSL_ENSURE( pFormItem,
"FmFilterAdapter::disjunctiveTermRemoved: don't know this form!" );
401 const bool bValidIndex = ( Event.DisjunctiveTerm >= 0 ) && (
o3tl::make_unsigned(Event.DisjunctiveTerm) < rTermItems.size() );
402 OSL_ENSURE( bValidIndex,
"FmFilterAdapter::disjunctiveTermRemoved: invalid term index!" );
407 if ( Event.DisjunctiveTerm == 0 )
409 rTermItems[1]->SetText(
SvxResId(RID_STR_FILTER_FILTER_FOR));
410 FmFilterTextChangedHint aChangeHint( rTermItems[1].
get() );
426 Reference< XFormController >
xController( Event.Source, UNO_QUERY_THROW );
427 Reference< XFilterController > xFilterController( Event.Source, UNO_QUERY_THROW );
428 Reference< XForm > xForm(
xController->getModel(), UNO_QUERY_THROW );
431 OSL_ENSURE( pFormItem,
"FmFilterAdapter::disjunctiveTermAdded: don't know this form!" );
435 const sal_Int32 nInsertPos = Event.DisjunctiveTerm;
439 OSL_FAIL(
"FmFilterAdapter::disjunctiveTermAdded: invalid index!" );
443 auto insertPos = pFormItem->
GetChildren().begin() + nInsertPos;
446 std::unique_ptr<FmFilterItems> pFilterItems(
new FmFilterItems(pFormItem, (nInsertPos?
SvxResId(RID_STR_FILTER_FILTER_OR):
SvxResId(RID_STR_FILTER_FILTER_FOR))));
454 ,m_pCurrentItems(nullptr)
468 FilterClearingHint aClearedHint;
486void FmFilterModel::Update(
const Reference< XIndexAccess > & xControllers,
const Reference< XFormController > & xCurrent)
491 if (!xControllers.is())
505 DBG_ASSERT(xCurrent.is(),
"FmFilterModel::Update(...) no current controller");
522 sal_Int32
nCount = xControllers->getCount();
523 for ( sal_Int32 i = 0;
i <
nCount; ++
i )
525 Reference< XFormController >
xController( xControllers->getByIndex(i), UNO_QUERY_THROW );
527 Reference< XPropertySet > xFormProperties(
xController->getModel(), UNO_QUERY_THROW );
529 OSL_VERIFY( xFormProperties->getPropertyValue(
FM_PROP_NAME ) >>= aName );
532 FmFormItem* pFormItem =
new FmFormItem( pParent, xController, aName );
533 Insert( pParent->GetChildren().end(), std::unique_ptr<FmFilterData>(pFormItem) );
535 Reference< XFilterController > xFilterController( pFormItem->GetFilterController(), UNO_SET_THROW );
538 OUString aTitle(
SvxResId(RID_STR_FILTER_FILTER_FOR));
540 const Sequence< Sequence< OUString > > aExpressions = xFilterController->getPredicateExpressions();
541 for (
auto const & conjunctionTerm : aExpressions )
544 FmFilterItems* pFilterItems =
new FmFilterItems( pFormItem, aTitle );
545 Insert( pFormItem->GetChildren().end(), std::unique_ptr<FmFilterData>(pFilterItems) );
547 const Sequence< OUString >& rDisjunction( conjunctionTerm );
548 sal_Int32 nComponentIndex = -1;
549 for (
const OUString& rDisjunctiveTerm : rDisjunction )
553 if ( rDisjunctiveTerm.isEmpty() )
558 const Reference< XControl > xFilterControl( xFilterController->getFilterComponent( nComponentIndex ) );
559 const OUString
sDisplayName( lcl_getLabelName_nothrow( xFilterControl ) );
562 std::unique_ptr<FmFilterItem> pANDCondition(
new FmFilterItem( pFilterItems, sDisplayName, rDisjunctiveTerm, nComponentIndex ));
563 Insert( pFilterItems->GetChildren().end(), std::move(pANDCondition) );
567 aTitle =
SvxResId( RID_STR_FILTER_FILTER_OR );
571 Update( xController, pFormItem );
574 catch(
const Exception& )
581FmFormItem*
FmFilterModel::Find(const ::std::vector<std::unique_ptr<FmFilterData>>& rItems,
const Reference< XFormController > & xController)
const
583 for (
const auto& rItem : rItems)
585 FmFormItem* pForm =
dynamic_cast<FmFormItem*
>( rItem.get() );
588 if ( xController == pForm->GetController() )
592 pForm =
Find(pForm->GetChildren(), xController);
602FmFormItem*
FmFilterModel::Find(const ::std::vector<std::unique_ptr<FmFilterData>>& rItems,
const Reference< XForm >& xForm)
const
604 for (
const auto& rItem : rItems)
606 FmFormItem* pForm =
dynamic_cast<FmFormItem*
>( rItem.get() );
609 if (xForm == pForm->GetController()->getModel())
613 pForm =
Find(pForm->GetChildren(), xForm);
635 Reference< XFilterController > xFilterController(
m_xController, UNO_QUERY_THROW );
636 const sal_Int32 nActiveTerm( xFilterController->getActiveTerm() );
652 [](
const std::unique_ptr<FmFilterData>& rChild) { return dynamic_cast<const FmFilterItems*>(rChild.get()) != nullptr; });
654 sal_Int32 nInsertPos = iter.base() - _rFormItem.
GetChildren().begin();
658 Reference< XFilterController > xFilterController( _rFormItem.
GetFilterController(), UNO_SET_THROW );
659 if ( nInsertPos >= xFilterController->getDisjunctiveTerms() )
660 xFilterController->appendEmptyDisjunctiveTerm();
668void FmFilterModel::Insert(const ::std::vector<std::unique_ptr<FmFilterData>>::iterator& rPos, std::unique_ptr<FmFilterData> pData)
670 auto pTemp =
pData.get();
672 ::std::vector<std::unique_ptr<FmFilterData>>& rItems =
pData->GetParent()->GetChildren();
673 if (rPos == rItems.end())
675 nPos = rItems.size();
676 rItems.push_back(std::move(
pData));
680 nPos = rPos - rItems.begin();
681 rItems.insert(rPos, std::move(
pData));
685 FmFilterInsertedHint aInsertedHint(pTemp,
nPos);
692 ::std::vector<std::unique_ptr<FmFilterData>>& rItems = pParent->
GetChildren();
695 auto i = ::std::find_if(rItems.begin(), rItems.end(),
696 [&](
const std::unique_ptr<FmFilterData>&
p) { return p.get() == pData; } );
697 DBG_ASSERT(
i != rItems.end(),
"FmFilterModel::Remove(): unknown Item");
699 sal_Int32
nPos =
i - rItems.begin();
706 Reference< XFilterController > xFilterController( pFormItem->
GetFilterController(), UNO_SET_THROW );
708 bool bEmptyLastTerm = ( (
nPos == 0 ) && xFilterController->getDisjunctiveTerms() == 1 );
709 if ( bEmptyLastTerm )
712 ::std::vector< std::unique_ptr<FmFilterData> >& rChildren = pFilterItems->GetChildren();
713 while ( !rChildren.empty() )
715 auto removePos = rChildren.end() - 1;
725 xFilterController->removeDisjunctiveTerm(
nPos );
738 if (rItems.size() == 1)
743 ::std::vector<std::unique_ptr<FmFilterData>>& rParentParentItems =
pData->GetParent()->GetParent()->GetChildren();
744 auto j = ::std::find_if(rParentParentItems.begin(), rParentParentItems.end(),
745 [&](
const std::unique_ptr<FmFilterData>&
p) { return p.get() == rFilterItem.GetParent(); });
746 DBG_ASSERT(j != rParentParentItems.end(),
"FmFilterModel::Remove(): unknown Item");
747 sal_Int32 nParentPos = j - rParentParentItems.begin();
759 std::unique_ptr<FmFilterData>
pData = std::move(*rPos);
760 pData->GetParent()->GetChildren().erase( rPos );
763 FmFilterRemovedHint aRemoveHint(
pData.get() );
774 Reference< XFormController > xFormController( pFormItem->
GetController() );
776 Reference< XRowSet > xRowSet( xFormController->getModel(), UNO_QUERY_THROW );
777 Reference< XConnection > xConnection(
getConnection( xRowSet ) );
781 Reference< XNumberFormatsSupplier > xFormatSupplier =
getNumberFormats( xConnection,
true );
783 xFormatter->attachNumberFormatsSupplier( xFormatSupplier );
786 Reference< XFilterController > xFilterController( xFormController, UNO_QUERY_THROW );
787 Reference< XPropertySet > xField( lcl_getBoundField_nothrow( xFilterController->getFilterComponent( pItem->
GetComponentIndex() ) ), UNO_SET_THROW );
790 OUString aErr, aTxt( rText );
791 std::unique_ptr< OSQLParseNode > pParseNode = predicateTree( aErr, aTxt, xFormatter, xField );
794 if ( pParseNode !=
nullptr )
796 OUString aPreparedText;
798 pParseNode->parseNodeToPredicateStr(
799 aPreparedText, xConnection, xFormatter, xField, OUString(), aAppLocale, OUString(
"."), getParseContext() );
800 rText = aPreparedText;
822 auto i = ::std::find_if(rItems.begin(), rItems.end(),
823 [&](
const std::unique_ptr<FmFilterData>&
p) { return p.get() == pItem->GetParent(); });
824 sal_Int32 nParentPos =
i - rItems.begin();
834 FmFilterTextChangedHint aChangeHint(pItem);
849 ::std::vector<std::unique_ptr<FmFilterData>>& rItems = pFormItem->
GetChildren();
850 auto i = ::std::find_if(rItems.begin(), rItems.end(),
851 [&](
const std::unique_ptr<FmFilterData>&
p) { return p.get() == pCurrent; });
853 if (
i != rItems.end())
856 sal_Int32
nPos =
i - rItems.begin();
859 Reference< XFilterController > xFilterController( pFormItem->
GetFilterController(), UNO_SET_THROW );
860 xFilterController->setActiveTerm(
nPos );
881 FmFilterCurrentChangedHint aHint;
889 ::std::vector< std::unique_ptr<FmFilterData> >& rChildren = _rItem.
GetChildren();
890 bool bAppendLevel =
dynamic_cast<const FmFormItem*
>(&_rItem) !=
nullptr;
892 for (
const auto& rpChild : rChildren )
897 bAppendLevel =
false;
912 OSL_ENSURE( pFormItem,
"FmFilterModel::EnsureEmptyFilterRows: no FmFormItem, but a FmFilterItems child?" );
924 const OUString& rId = aPayload.second;
929 OUString sText =
pData->GetText();
938 OUString
sName = pItem->GetFieldName() +
": ";
941 rRenderContext.
Pop();
958 const ::tools::Rectangle& rRect = std::get<1>(aPayload);
960 bool bSelected = std::get<2>(aPayload);
961 const OUString& rId = std::get<3>(aPayload);
971 OUString sText =
pData->GetText();
982 OUString
sName = pFilter->GetFieldName() +
": ";
987 rRenderContext.
Pop();
989 rRenderContext.
DrawText(aPos, sText);
997 if (bIsCurrentFilter)
1003 Point aSecond(aFirst .
X() + 2, aFirst.
Y() + 3);
1005 rRenderContext.
DrawLine(aFirst, aSecond);
1012 rRenderContext.
DrawLine(aFirst, aSecond);
1013 rRenderContext.
Pop();
1019 rRenderContext.
DrawText(aPos, sText);
1021 rRenderContext.
Pop();
1025 : DropTargetHelper(rTreeView.get_widget().get_drop_target())
1026 , m_rTreeView(rTreeView)
1050 : m_xTopLevel(pTopLevel)
1051 , m_xTreeView(
std::move(xTreeView))
1052 , m_aDropTargetHelper(*this)
1053 , m_nAsyncRemoveEvent(nullptr)
1057 m_xTreeView->set_selection_mode(SelectionMode::Multiple);
1084 if (xCurrent ==
m_pModel->GetCurrentController())
1087 m_pModel->Update(xControllers, xCurrent);
1091 if (!xEntry ||
m_xTreeView->get_row_expanded(*xEntry))
1111 if (
dynamic_cast<const FmFilterItem*
>(weld::fromId<FmFilterData*>(m_xTreeView->get_id(rIter))))
1113 m_xEditingCurrently = m_xTreeView->make_iterator(&rIter);
1116 m_xEditingCurrently.reset();
1123 const OUString& rNewText = rIterString.second;
1125 assert(m_xEditingCurrently && m_xTreeView->iter_compare(rIter, *m_xEditingCurrently) == 0 &&
1126 "FmFilterNavigator::EditedEntry: suspicious entry!");
1127 m_xEditingCurrently.reset();
1132 "FmFilterNavigator::EditedEntry() wrong entry");
1135 if (aText.isEmpty())
1144 if (m_pModel->ValidateText(
static_cast<FmFilterItem*
>(
pData), aText, aErrorMsg))
1149 m_xTreeView->set_text(rIter, aText);
1155 aError.Message =
SvxResId(RID_STR_SYNTAXERROR);
1156 aError.Details = aErrorMsg;
1167 m_nAsyncRemoveEvent =
nullptr;
1185 std::unique_ptr<weld::TreeIter> xDropTarget(
m_xTreeView->make_iterator());
1187 if (!
m_xTreeView->get_dest_row_at_pos(aDropPos, xDropTarget.get(),
false))
1188 xDropTarget.reset();
1221 return pTargetItems;
1231 std::unique_ptr<weld::TreeIter> xDropTarget(
m_xTreeView->make_iterator());
1233 if (!
m_xTreeView->get_dest_row_at_pos(aDropPos, xDropTarget.get(),
false))
1234 xDropTarget.reset();
1241 std::unique_ptr<weld::TreeIter> xEntry =
FindEntry(pTargetItems);
1255 std::unique_ptr<weld::TreeIter> xIter(m_xTreeView->make_iterator());
1256 if (!m_xTreeView->get_selected(xIter.get()))
1263 pFormItem =
static_cast<FmFormItem*
>(pItem->GetParent()->GetParent());
1265 pFormItem =
static_cast<FmFormItem*
>(pItems->GetParent()->GetParent());
1273 m_pModel->SetCurrentItems(
static_cast<FmFilterItems*
>(pItem->GetParent()));
1275 m_pModel->SetCurrentItems(pItems);
1283 if (
const FmFilterInsertedHint* pInsertHint =
dynamic_cast<const FmFilterInsertedHint*
>(&rHint))
1285 Insert(pInsertHint->GetData(), pInsertHint->GetPos());
1287 else if(
dynamic_cast<const FilterClearingHint*
>(&rHint) )
1291 else if (
const FmFilterRemovedHint* pRemoveHint =
dynamic_cast<const FmFilterRemovedHint*
>(&rHint))
1293 Remove(pRemoveHint->GetData());
1295 else if (
const FmFilterTextChangedHint *pChangeHint =
dynamic_cast<const FmFilterTextChangedHint*
>(&rHint))
1297 std::unique_ptr<weld::TreeIter> xEntry =
FindEntry(pChangeHint->GetData());
1299 m_xTreeView->set_text(*xEntry, pChangeHint->GetData()->GetText());
1301 else if(
dynamic_cast<const FmFilterCurrentChangedHint*
>(&rHint) )
1311 std::unique_ptr<weld::TreeIter> xEntry =
m_xTreeView->make_iterator();
1317 if (pEntryItem == pItem)
1330 std::unique_ptr<weld::TreeIter> xParentEntry =
FindEntry(pParent);
1333 std::unique_ptr<weld::TreeIter> xRet(
m_xTreeView->make_iterator());
1335 nullptr,
nullptr,
false, xRet.get());
1356 std::unique_ptr<weld::TreeIter> xEntry =
FindEntry(pItem);
1371 bool bHandled =
true;
1372 bool bFoundSomething =
false;
1382 else if (!pFirstItem)
1384 else if (pFirstItem != pForm)
1389 _rItemList.push_back(pFilter);
1390 bFoundSomething =
true;
1396 if ( !bHandled || !bFoundSomething )
1397 pFirstItem =
nullptr;
1405 if ( pLookupItem->GetParent() == _pTargetItems )
1408 FmFilterItem* pFilterItem = _pTargetItems->
Find( pLookupItem->GetComponentIndex() );
1409 OUString aText = pLookupItem->
GetText();
1412 pFilterItem =
new FmFilterItem( _pTargetItems, pLookupItem->GetFieldName(), aText, pLookupItem->GetComponentIndex() );
1413 m_pModel->Append( _pTargetItems, std::unique_ptr<FmFilterItem>(pFilterItem) );
1420 m_pModel->SetTextForItem( pFilterItem, aText );
1428 rUnsetDragIcon =
false;
1431 m_aControlExchange.prepareDrag();
1433 ::std::vector<FmFilterItem*> aItemList;
1434 if (
FmFormItem* pFirstItem = getSelectedFilterItems(aItemList))
1436 m_aControlExchange->setDraggedEntries(std::move(aItemList));
1437 m_aControlExchange->setFormItem(pFirstItem);
1442 rExchange.setDragging(
true);
1451 bool bHandled =
false;
1452 switch (rEvt.GetCommand())
1454 case CommandEventId::ContextMenu:
1458 std::unique_ptr<weld::TreeIter> xClicked(m_xTreeView->make_iterator());
1459 if (rEvt.IsMouseEvent())
1461 aWhere = rEvt.GetMousePosPixel();
1462 if (!m_xTreeView->get_dest_row_at_pos(aWhere, xClicked.get(),
false))
1465 if (!m_xTreeView->is_selected(*xClicked))
1467 m_xTreeView->unselect_all();
1468 m_xTreeView->select(*xClicked);
1469 m_xTreeView->set_cursor(*xClicked);
1474 if (!m_xTreeView->get_cursor(xClicked.get()))
1476 aWhere = m_xTreeView->get_row_area(*xClicked).Center();
1479 ::std::vector<FmFilterData*> aSelectList;
1480 m_xTreeView->selected_foreach([
this, &aSelectList](
weld::TreeIter& rEntry) {
1481 FmFilterData* pFilterEntry = weld::fromId<FmFilterData*>(m_xTreeView->get_id(rEntry));
1486 aSelectList.push_back(pFilterEntry);
1491 if (aSelectList.size() == 1)
1495 if (pFilterItems && pFilterItems->
GetChildren().empty()
1497 aSelectList.clear();
1501 std::unique_ptr<weld::Menu> xContextMenu(xBuilder->weld_menu(
"menu"));
1504 bool bNoDelete =
false;
1505 if (aSelectList.empty())
1508 xContextMenu->remove(
"delete");
1511 FmFilterData* pFilterEntry = weld::fromId<FmFilterData*>(m_xTreeView->get_id(*xClicked));
1512 auto pFilterItem =
dynamic_cast<FmFilterItem*
>(pFilterEntry);
1513 bool bEdit = pFilterItem &&
1514 m_xTreeView->is_selected(*xClicked) && m_xTreeView->count_selected_rows() == 1;
1516 if (bNoDelete && !bEdit)
1524 xContextMenu->remove(
"edit");
1525 xContextMenu->remove(
"isnull");
1526 xContextMenu->remove(
"isnotnull");
1529 OUString sIdent = xContextMenu->popup_at_rect(m_xTreeView.get(),
tools::Rectangle(aWhere,
::Size(1, 1)));
1530 if (sIdent ==
"edit")
1532 m_xTreeView->start_editing(*xClicked);
1534 else if (sIdent ==
"isnull")
1537 OUString aText =
"IS NULL";
1538 assert(pFilterItem &&
"if item is null this menu entry was removed and unavailable");
1539 m_pModel->ValidateText(pFilterItem, aText, aErrorMsg);
1540 m_pModel->SetTextForItem(pFilterItem, aText);
1542 else if (sIdent ==
"isnotnull")
1545 OUString aText =
"IS NOT NULL";
1547 assert(pFilterItem &&
"if item is null this menu entry was removed and unavailable");
1548 m_pModel->ValidateText(pFilterItem, aText, aErrorMsg);
1549 m_pModel->SetTextForItem(pFilterItem, aText);
1551 else if (sIdent ==
"delete")
1572 std::unique_ptr<weld::TreeIter> xNext =
m_xTreeView->make_iterator(&rEntry);
1585 if (bEntry &&
m_xTreeView->iter_has_child(rEntry))
1589 if (bEntry &&
m_xTreeView->iter_has_child(rEntry))
1606 ::std::vector<FmFilterItem*> aItemList;
1607 if ( !getSelectedFilterItems( aItemList ) )
1611 std::vector<std::unique_ptr<weld::TreeIter>> aSelected;
1612 m_xTreeView->selected_foreach([
this, &aSelected](
weld::TreeIter& rEntry){
1613 aSelected.emplace_back(m_xTreeView->make_iterator(&rEntry));
1617 std::unique_ptr<weld::TreeIter>
xTarget;
1622 xTarget = m_xTreeView->make_iterator(aSelected.front().get());
1627 xTarget = m_xTreeView->make_iterator(aSelected.back().get());
1631 bool bTarget = getter(
this, *
xTarget);
1639 ::std::vector<FmFilterItem*>::const_iterator aEnd = aItemList.end();
1640 bool bNextTargetItem =
true;
1641 while ( bNextTargetItem )
1643 ::std::vector<FmFilterItem*>::const_iterator
i = aItemList.begin();
1644 for (;
i != aEnd; ++
i)
1646 if ( (*i)->GetParent() == pTargetItems )
1648 bTarget = getter(
this, *
xTarget);
1651 pTargetItems = getTargetItems(*m_xTreeView, *
xTarget);
1656 FmFilterItem* pFilterItem = pTargetItems->
Find( (*i)->GetComponentIndex() );
1660 bTarget = getter(
this, *
xTarget);
1664 pTargetItems = getTargetItems(*m_xTreeView, *
xTarget);
1669 bNextTargetItem =
i != aEnd && pTargetItems;
1674 insertFilterItem( aItemList, pTargetItems,
false );
1685 std::unique_ptr<weld::TreeIter> xEntry = m_xTreeView->make_iterator();
1686 if (m_xTreeView->get_iter_first(*xEntry) && !m_xTreeView->is_selected(*xEntry))
1700 std::vector<FmFilterData*> aEntryList;
1707 std::unique_ptr<weld::TreeIter> xParent(
m_xTreeView->make_iterator(&rEntry));
1714 aEntryList.emplace_back(pFilterEntry);
1722 for (
auto i = aEntryList.rbegin();
i != aEntryList.rend(); ++
i)
1728 :
SfxDockingWindow(_pBindings, _pMgr, _pParent,
"FilterNavigator",
"svx/ui/filternavigator.ui")
1730 , m_xNavigatorTree(new
FmFilterNavigator(this, m_xBuilder->weld_tree_view(
"treeview")))
1759 Reference<XFormController>
const xController(pFormShell->
GetImpl()->getActiveInternalController_Lock());
1760 Reference< XIndexAccess > xContainer;
1764 for (Reference< XInterface > xParent(xChild->getParent());
1766 xParent = xChild.is() ? xChild->getParent() : Reference< XInterface > ())
1768 xContainer.set(xParent, UNO_QUERY);
1769 xChild.set(xParent, UNO_QUERY);
1778 if( !pState || SID_FM_FILTER_NAVIGATOR_CONTROL != nSID )
1781 if( eState >= SfxItemState::DEFAULT )
1807 if ( ( eAlign == SfxChildAlignment::TOP ) || ( eAlign == SfxChildAlignment::BOTTOM ) )
1817 case SfxChildAlignment::LEFT:
1818 case SfxChildAlignment::RIGHT:
1819 case SfxChildAlignment::NOALIGNMENT:
1834 SfxDockingWindow::GetFocus();
const LanguageTag & GetUILanguageTag() const
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
static std::unique_ptr< weld::Builder > CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false, sal_uInt64 nLOKWindowId=0)
static void RemoveUserEvent(ImplSVEvent *nUserEvent)
const css::lang::Locale & getLocale(bool bResolveSystem=true) const
Size GetOutputSize() const
const vcl::Font & GetFont() const
void SetFont(const vcl::Font &rNewFont)
void DrawLine(const Point &rStartPt, const Point &rEndPt)
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::text::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
void SetTextColor(const Color &rColor)
const Color & GetTextColor() const
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
tools::Long GetTextHeight() const
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, std::vector< tools::Rectangle > *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
constexpr tools::Long Y() const
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
void Broadcast(const SfxHint &rHint)
virtual void FillInfo(SfxChildWinInfo &) const
virtual bool Close() override
void SetFloatingSize(const Size &rSize)
virtual Size CalcDockingSize(SfxChildAlignment)
virtual void dispose() override
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
tools::Long AdjustWidth(tools::Long n)
constexpr tools::Long Width() const
static SotClipboardFormatId RegisterFormatName(const OUString &rName)
const Color & GetDialogTextColor() const
const Color & GetHighlightTextColor() const
static css::uno::Reference< css::awt::XWindow > GetInterface(vcl::Window *pWindow)
void SetWeight(FontWeight)
sal_uInt16 GetCode() const
sal_uInt16 GetModifier() const
std::tuple< vcl::RenderContext &, const tools::Rectangle &, bool, const OUString & > render_args
virtual bool get_dest_row_at_pos(const Point &rPos, weld::TreeIter *pResult, bool bDnDMode, bool bAutoScroll=true)=0
std::pair< vcl::RenderContext &, const OUString & > get_size_args
virtual OUString get_id(int pos) const=0
#define DBG_ASSERT(sCon, aError)
#define DBG_UNHANDLED_EXCEPTION(...)
OUString SvxResId(TranslateId aId)
virtual void SetText(const OUString &rStr) override
virtual void SetHelpId(const OUString &) override
Reference< XInterface > xTarget
constexpr OUStringLiteral FM_PROP_BOUNDFIELD
constexpr OUStringLiteral FM_PROP_NAME
constexpr OUStringLiteral HID_FILTER_NAVIGATOR
constexpr OUStringLiteral HID_FILTER_NAVIGATOR_WIN
constexpr sal_uInt16 KEY_UP
constexpr sal_uInt16 KEY_DELETE
constexpr sal_uInt16 KEY_DOWN
#define LINK(Instance, Class, Member)
std::unique_ptr< sal_Int32[]> pData
class SAL_NO_VTABLE XPropertySet
OString strip(const OString &rIn, char c)
class SvxPropertySetInfoPool
Reference< XComponentContext > getProcessComponentContext()
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
OUString toId(const void *pValue)
SFX_IMPL_DOCKINGWINDOW(SwNavigatorWrapper, SID_NAVIGATOR)
Reference< XController > xController
Reference< XModel > xModel
#define DND_ACTION_COPYMOVE