26#include <document.hxx>
46 VclMessageType::Warning, VclButtonsType::Ok,
56 :
ScAnyRefDlgController(pB, pCW, pParent,
"modules/scalc/ui/advancedfilterdialog.ui",
"AdvancedFilterDialog")
57 , aStrUndefined (
ScResId(SCSTR_UNDEFINED) )
58 , nWhichQuery ( rArgSet.GetPool()->
GetWhich( SID_QUERY ) )
60 rArgSet.
Get( nWhichQuery )).GetQueryData() )
63 , bRefInputMode(false)
64 , m_pRefInputEdit(nullptr)
65 , m_xLbFilterArea(m_xBuilder->weld_combo_box(
"lbfilterarea"))
66 , m_xEdFilterArea(new
formula::RefEdit(m_xBuilder->weld_entry(
"edfilterarea")))
67 , m_xRbFilterArea(new
formula::RefButton(m_xBuilder->weld_button(
"rbfilterarea")))
68 , m_xExpander(m_xBuilder->weld_expander(
"more"))
69 , m_xBtnCase(m_xBuilder->weld_check_button(
"case"))
70 , m_xBtnRegExp(m_xBuilder->weld_check_button(
"regexp"))
71 , m_xBtnHeader(m_xBuilder->weld_check_button(
"header"))
72 , m_xBtnUnique(m_xBuilder->weld_check_button(
"unique"))
73 , m_xBtnCopyResult(m_xBuilder->weld_check_button(
"copyresult"))
74 , m_xLbCopyArea(m_xBuilder->weld_combo_box(
"lbcopyarea"))
75 , m_xEdCopyArea(new
formula::RefEdit(m_xBuilder->weld_entry(
"edcopyarea")))
76 , m_xRbCopyArea(new
formula::RefButton(m_xBuilder->weld_button(
"rbcopyarea")))
77 , m_xBtnDestPers(m_xBuilder->weld_check_button(
"destpers"))
78 , m_xFtDbAreaLabel(m_xBuilder->weld_label(
"dbarealabel"))
79 , m_xFtDbArea(m_xBuilder->weld_label(
"dbarea"))
80 , m_xBtnOk(m_xBuilder->weld_button(
"ok"))
81 , m_xBtnCancel(m_xBuilder->weld_button(
"cancel"))
82 , m_xFilterFrame(m_xBuilder->weld_frame(
"filterframe"))
83 , m_xFilterLabel(m_xFilterFrame->weld_label_widget())
136 for (
const auto& rEntry : *pRangeNames)
141 OUString aSymbol = rEntry.second->GetSymbol();
190 DoClose( ScSpecialFilterDlgWrapper::GetChildWindowId() );
240 pOutItem->SetAdvancedQuerySource( &rSource );
253 OSL_ENSURE( pDoc && pViewData,
"Document or ViewData not found. :-/" );
255 if (&rBtn == m_xBtnOk.get() && pDoc && pViewData)
257 OUString theCopyStr( m_xEdCopyArea->GetText() );
258 OUString theAreaStr( m_xEdFilterArea->GetText() );
261 bool bEditInputOk =
true;
262 bool bQueryOk =
false;
266 if ( m_xBtnCopyResult->get_active() )
268 sal_Int32 nColonPos = theCopyStr.indexOf(
':' );
270 if ( -1 != nColonPos )
271 theCopyStr = theCopyStr.copy( 0, nColonPos );
277 if (!m_xExpander->get_expanded())
278 m_xExpander->set_expanded(
true);
281 m_xEdCopyArea->GrabFocus();
282 bEditInputOk =
false;
293 m_xEdFilterArea->GrabFocus();
294 bEditInputOk =
false;
312 if ( m_xBtnCopyResult->get_active() )
327 theOutParam.
bHasHeader = m_xBtnHeader->get_active();
328 theOutParam.
bByRow =
true;
329 theOutParam.
bCaseSens = m_xBtnCase->get_active();
332 theOutParam.
bDuplicate = !m_xBtnUnique->get_active();
333 theOutParam.
bDestPers = m_xBtnDestPers->get_active();
335 bQueryOk = pDoc->CreateQueryParam(
ScRange(rStart,rEnd), theOutParam);
341 SetDispatcherLock(
false );
344 SfxCallMode::SLOT | SfxCallMode::RECORD,
345 { GetOutputItem(theOutParam, theFilterArea) });
351 m_xEdFilterArea->GrabFocus();
354 else if (&rBtn == m_xBtnCancel.get())
394 if (&rLb == m_xLbFilterArea.get())
397 const sal_Int32 nSelPos = m_xLbFilterArea->get_active();
400 aString = m_xLbFilterArea->get_id(nSelPos);
402 m_xEdFilterArea->SetText( aString );
408 if (&rEd != m_xEdFilterArea.get())
411 if ( pDoc && pViewData )
413 OUString theCurAreaStr = rEd.GetText();
418 const sal_Int32
nCount = m_xLbFilterArea->get_count();
421 OUString
aStr = m_xLbFilterArea->get_id(
i);
422 if (theCurAreaStr ==
aStr)
424 m_xLbFilterArea->set_active(
i );
428 m_xLbFilterArea->set_active( 0 );
432 m_xLbFilterArea->set_active( 0 );
Reference< XExecutableDialog > m_xDialog
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
SC_DLLPUBLIC void Format(OStringBuffer &r, ScRefFlags nFlags, const ScDocument *pDocument=nullptr, const Details &rDetails=detailsOOOa1) const
SC_DLLPUBLIC ScRefFlags Parse(const OUString &, const ScDocument &, const Details &rDetails=detailsOOOa1, ExternalInfo *pExtInfo=nullptr, const css::uno::Sequence< css::sheet::ExternalLinkInfo > *pExternalLinks=nullptr, sal_Int32 *pSheetEndPos=nullptr, const OUString *pErrRef=nullptr)
SC_DLLPUBLIC formula::FormulaGrammar::AddressConvention GetAddressConvention() const
SC_DLLPUBLIC ScRangeName * GetRangeName(SCTAB nTab) const
ScChangeTrack * GetChangeTrack() const
ScViewData * GetViewData() const
bool GetAdvancedQuerySource(ScRange &rSource) const
OUString Format(const ScDocument &rDocument, ScRefFlags nFlags=ScRefFlags::ZERO, const ScAddress::Details &rDetails=ScAddress::detailsOOOa1, bool bFullAddressNotation=false) const
Returns string with formatted cell range from aStart to aEnd, according to provided address conventio...
ScRefFlags Parse(const OUString &, const ScDocument &, const ScAddress::Details &rDetails=ScAddress::detailsOOOa1, ScAddress::ExternalInfo *pExtInfo=nullptr, const css::uno::Sequence< css::sheet::ExternalLinkInfo > *pExternalLinks=nullptr, const OUString *pErrRef=nullptr)
virtual void RefInputStart(formula::RefEdit *pEdit, formula::RefButton *pButton=nullptr) override
virtual void RefInputDone(bool bForced=false) override
bool DoClose(sal_uInt16 nId)
virtual bool IsRefInputMode() const override
std::unique_ptr< formula::RefEdit > m_xEdFilterArea
std::unique_ptr< weld::Button > m_xBtnCancel
ScQueryItem * GetOutputItem(const ScQueryParam &rParam, const ScRange &rSource)
std::unique_ptr< weld::ComboBox > m_xLbCopyArea
std::unique_ptr< formula::RefButton > m_xRbFilterArea
virtual void Close() override
virtual void SetReference(const ScRange &rRef, ScDocument &rDoc) override
void Init(const SfxItemSet &rArgSet)
virtual void SetActive() override
std::unique_ptr< ScQueryItem > pOutItem
std::unique_ptr< formula::RefButton > m_xRbCopyArea
std::unique_ptr< weld::ComboBox > m_xLbFilterArea
const ScQueryParam theQueryData
ScSpecialFilterDlg(SfxBindings *pB, SfxChildWindow *pCW, weld::Window *pParent, const SfxItemSet &rArgSet)
std::unique_ptr< formula::RefEdit > m_xEdCopyArea
std::unique_ptr< weld::Label > m_xFtDbAreaLabel
std::unique_ptr< weld::CheckButton > m_xBtnRegExp
formula::RefEdit * m_pRefInputEdit
std::unique_ptr< weld::Label > m_xFtDbArea
std::unique_ptr< weld::CheckButton > m_xBtnUnique
const OUString aStrUndefined
std::unique_ptr< weld::Button > m_xBtnOk
std::unique_ptr< ScFilterOptionsMgr > pOptionsMgr
std::unique_ptr< weld::CheckButton > m_xBtnCopyResult
std::unique_ptr< weld::CheckButton > m_xBtnDestPers
virtual ~ScSpecialFilterDlg() override
std::unique_ptr< weld::CheckButton > m_xBtnCase
const sal_uInt16 nWhichQuery
std::unique_ptr< weld::Label > m_xFilterLabel
std::unique_ptr< weld::CheckButton > m_xBtnHeader
ScDocument & GetDocument() const
ScDocShell * GetDocShell() const
SfxDispatcher * GetDispatcher() const
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
virtual SfxBindings & GetBindings() override
#define LINK(Instance, Class, Member)
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
OUString ScResId(TranslateId aId)
IMPL_LINK(ScSpecialFilterDlg, EndDlgHdl, weld::Button &, rBtn, void)
IMPL_LINK_NOARG(ScSpecialFilterDlg, RefInputEditHdl, formula::RefEdit &, void)
utl::SearchParam::SearchType eSearchType