[Libreoffice-commits] core.git: sc/source sc/uiconfig solenv/sanitizers
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Wed Apr 17 06:59:00 UTC 2019
sc/source/ui/dbgui/sfiltdlg.cxx | 262 +++++++++++----------------
sc/source/ui/inc/filtdlg.hxx | 65 +++---
sc/source/ui/inc/reffact.hxx | 2
sc/source/ui/view/reffact.cxx | 4
sc/source/ui/view/tabvwshc.cxx | 57 ++---
sc/uiconfig/scalc/ui/advancedfilterdialog.ui | 23 +-
solenv/sanitizers/ui/modules/scalc.suppr | 4
7 files changed, 194 insertions(+), 223 deletions(-)
New commits:
commit 73482f5e8742cc9fce32de1fc660059aae2a9583
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Apr 16 15:44:33 2019 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Apr 17 08:58:11 2019 +0200
weld ScSpecialFilterDlg
Change-Id: Iecf88c5720f2407654d85a1a70a04faed43fd690
Reviewed-on: https://gerrit.libreoffice.org/70832
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sc/source/ui/dbgui/sfiltdlg.cxx b/sc/source/ui/dbgui/sfiltdlg.cxx
index 919632c577fd..8438dcf2f563 100644
--- a/sc/source/ui/dbgui/sfiltdlg.cxx
+++ b/sc/source/ui/dbgui/sfiltdlg.cxx
@@ -51,44 +51,45 @@ namespace
// class ScSpecialFilterDialog
-ScSpecialFilterDlg::ScSpecialFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent,
+ScSpecialFilterDlg::ScSpecialFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pParent,
const SfxItemSet& rArgSet )
- : ScAnyRefDlg ( pB, pCW, pParent, "AdvancedFilterDialog", "modules/scalc/ui/advancedfilterdialog.ui" ),
-
- aStrUndefined ( ScResId(SCSTR_UNDEFINED) ),
- nWhichQuery ( rArgSet.GetPool()->GetWhich( SID_QUERY ) ),
- theQueryData ( static_cast<const ScQueryItem&>(
- rArgSet.Get( nWhichQuery )).GetQueryData() ),
- pViewData ( nullptr ),
- pDoc ( nullptr ),
- pRefInputEdit ( nullptr ),
- bRefInputMode ( false )
+ : ScAnyRefDlgController(pB, pCW, pParent, "modules/scalc/ui/advancedfilterdialog.ui", "AdvancedFilterDialog")
+ , aStrUndefined ( ScResId(SCSTR_UNDEFINED) )
+ , nWhichQuery ( rArgSet.GetPool()->GetWhich( SID_QUERY ) )
+ , theQueryData ( static_cast<const ScQueryItem&>(
+ rArgSet.Get( nWhichQuery )).GetQueryData() )
+ , pViewData(nullptr)
+ , pDoc(nullptr)
+ , bRefInputMode(false)
+ , m_pRefInputEdit(nullptr)
+ , m_xLbFilterArea(m_xBuilder->weld_combo_box("lbfilterarea"))
+ , m_xEdFilterArea(new formula::WeldRefEdit(m_xBuilder->weld_entry("edfilterarea")))
+ , m_xRbFilterArea(new formula::WeldRefButton(m_xBuilder->weld_button("rbfilterarea")))
+ , m_xExpander(m_xBuilder->weld_expander("more"))
+ , m_xBtnCase(m_xBuilder->weld_check_button("case"))
+ , m_xBtnRegExp(m_xBuilder->weld_check_button("regexp"))
+ , m_xBtnHeader(m_xBuilder->weld_check_button("header"))
+ , m_xBtnUnique(m_xBuilder->weld_check_button("unique"))
+ , m_xBtnCopyResult(m_xBuilder->weld_check_button("copyresult"))
+ , m_xLbCopyArea(m_xBuilder->weld_combo_box("lbcopyarea"))
+ , m_xEdCopyArea(new formula::WeldRefEdit(m_xBuilder->weld_entry("edcopyarea")))
+ , m_xRbCopyArea(new formula::WeldRefButton(m_xBuilder->weld_button("rbcopyarea")))
+ , m_xBtnDestPers(m_xBuilder->weld_check_button("destpers"))
+ , m_xFtDbAreaLabel(m_xBuilder->weld_label("dbarealabel"))
+ , m_xFtDbArea(m_xBuilder->weld_label("dbarea"))
+ , m_xBtnOk(m_xBuilder->weld_button("ok"))
+ , m_xBtnCancel(m_xBuilder->weld_button("cancel"))
+ , m_xFilterFrame(m_xBuilder->weld_frame("filterframe"))
+ , m_xFilterLabel(m_xFilterFrame->weld_label_widget())
{
- get(pLbFilterArea,"lbfilterarea");
- get(pEdFilterArea,"edfilterarea");
- pEdFilterArea->SetReferences(this, get<VclFrame>("filterframe")->get_label_widget());
- get(pRbFilterArea,"rbfilterarea");
- pRbFilterArea->SetReferences(this, pEdFilterArea);
- get(pBtnCase,"case");
- get(pBtnRegExp,"regexp");
- get(pBtnHeader,"header");
- get(pBtnUnique,"unique");
- get(pBtnCopyResult,"copyresult");
- get(pLbCopyArea,"lbcopyarea");
- get(pEdCopyArea,"edcopyarea");
- pEdCopyArea->SetReferences(this, pBtnCopyResult);
- get(pRbCopyArea,"rbcopyarea");
- pRbCopyArea->SetReferences(this, pEdCopyArea);
- get(pBtnDestPers,"destpers");
- get(pFtDbAreaLabel,"dbarealabel");
- get(pFtDbArea,"dbarea");
- get(pBtnOk,"ok");
- get(pBtnCancel,"cancel");
- get(pExpander,"more");
+ m_xEdFilterArea->SetReferences(this, m_xFilterLabel.get());
+ m_xRbFilterArea->SetReferences(this, m_xEdFilterArea.get());
+ m_xEdCopyArea->SetReferences(this, m_xFtDbAreaLabel.get());
+ m_xRbCopyArea->SetReferences(this, m_xEdCopyArea.get());
Init( rArgSet );
- pEdFilterArea->GrabFocus();
+ m_xEdFilterArea->GrabFocus();
// hack: control of RefInput
pIdle.reset( new Idle("Special Filter Dialog") );
@@ -100,16 +101,6 @@ ScSpecialFilterDlg::ScSpecialFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, vc
ScSpecialFilterDlg::~ScSpecialFilterDlg()
{
- disposeOnce();
-}
-
-void ScSpecialFilterDlg::dispose()
-{
- const sal_Int32 nEntries = pLbFilterArea->GetEntryCount();
-
- for ( sal_Int32 i=1; i<nEntries; ++i )
- delete static_cast<OUString*>(pLbFilterArea->GetEntryData( i ));
-
pOptionsMgr.reset();
pOutItem.reset();
@@ -117,26 +108,6 @@ void ScSpecialFilterDlg::dispose()
// hack: control of RefInput
pIdle->Stop();
pIdle.reset();
-
- pLbFilterArea.clear();
- pEdFilterArea.clear();
- pRbFilterArea.clear();
- pExpander.clear();
- pBtnCase.clear();
- pBtnRegExp.clear();
- pBtnHeader.clear();
- pBtnUnique.clear();
- pBtnCopyResult.clear();
- pLbCopyArea.clear();
- pEdCopyArea.clear();
- pRbCopyArea.clear();
- pBtnDestPers.clear();
- pFtDbAreaLabel.clear();
- pFtDbArea.clear();
- pBtnOk.clear();
- pBtnCancel.clear();
- pRefInputEdit.clear();
- ScAnyRefDlg::dispose();
}
void ScSpecialFilterDlg::Init( const SfxItemSet& rArgSet )
@@ -144,33 +115,32 @@ void ScSpecialFilterDlg::Init( const SfxItemSet& rArgSet )
const ScQueryItem& rQueryItem = static_cast<const ScQueryItem&>(
rArgSet.Get( nWhichQuery ));
- pBtnOk->SetClickHdl ( LINK( this, ScSpecialFilterDlg, EndDlgHdl ) );
- pBtnCancel->SetClickHdl ( LINK( this, ScSpecialFilterDlg, EndDlgHdl ) );
- pLbFilterArea->SetSelectHdl ( LINK( this, ScSpecialFilterDlg, FilterAreaSelHdl ) );
- pEdFilterArea->SetModifyHdl ( LINK( this, ScSpecialFilterDlg, FilterAreaModHdl ) );
+ m_xBtnOk->connect_clicked( LINK( this, ScSpecialFilterDlg, EndDlgHdl ) );
+ m_xBtnCancel->connect_clicked( LINK( this, ScSpecialFilterDlg, EndDlgHdl ) );
+ m_xLbFilterArea->connect_changed( LINK( this, ScSpecialFilterDlg, FilterAreaSelHdl ) );
+ m_xEdFilterArea->SetModifyHdl ( LINK( this, ScSpecialFilterDlg, FilterAreaModHdl ) );
pViewData = rQueryItem.GetViewData();
pDoc = pViewData ? pViewData->GetDocument() : nullptr;
- pEdFilterArea->SetText( EMPTY_OUSTRING ); // may be overwritten below
+ m_xEdFilterArea->SetText( EMPTY_OUSTRING ); // may be overwritten below
if ( pViewData && pDoc )
{
- if(pDoc->GetChangeTrack()!=nullptr) pBtnCopyResult->Disable();
+ if(pDoc->GetChangeTrack()!=nullptr) m_xBtnCopyResult->set_sensitive(false);
ScRangeName* pRangeNames = pDoc->GetRangeName();
- pLbFilterArea->Clear();
- pLbFilterArea->InsertEntry( aStrUndefined, 0 );
+ m_xLbFilterArea->clear();
+ m_xLbFilterArea->append_text(aStrUndefined);
for (const auto& rEntry : *pRangeNames)
{
if (!rEntry.second->HasType(ScRangeData::Type::Criteria))
continue;
- const sal_Int32 nInsert = pLbFilterArea->InsertEntry(rEntry.second->GetName());
OUString aSymbol;
rEntry.second->GetSymbol(aSymbol);
- pLbFilterArea->SetEntryData(nInsert, new OUString(aSymbol));
+ m_xLbFilterArea->append(aSymbol, rEntry.second->GetName());
}
// is there a stored source range?
@@ -179,33 +149,33 @@ void ScSpecialFilterDlg::Init( const SfxItemSet& rArgSet )
if (rQueryItem.GetAdvancedQuerySource(aAdvSource))
{
OUString aRefStr(aAdvSource.Format(ScRefFlags::RANGE_ABS_3D, pDoc, pDoc->GetAddressConvention()));
- pEdFilterArea->SetRefString( aRefStr );
+ m_xEdFilterArea->SetRefString( aRefStr );
}
}
- pLbFilterArea->SelectEntryPos( 0 );
+ m_xLbFilterArea->set_active( 0 );
// let options be initialized:
- pOptionsMgr.reset( new ScFilterOptionsMgr(
+ pOptionsMgr.reset( new FilterOptionsMgr(
pViewData,
theQueryData,
- pBtnCase,
- pBtnRegExp,
- pBtnHeader,
- pBtnUnique,
- pBtnCopyResult,
- pBtnDestPers,
- pLbCopyArea,
- pEdCopyArea,
- pRbCopyArea,
- pFtDbAreaLabel,
- pFtDbArea,
+ m_xBtnCase.get(),
+ m_xBtnRegExp.get(),
+ m_xBtnHeader.get(),
+ m_xBtnUnique.get(),
+ m_xBtnCopyResult.get(),
+ m_xBtnDestPers.get(),
+ m_xLbCopyArea.get(),
+ m_xEdCopyArea.get(),
+ m_xRbCopyArea.get(),
+ m_xFtDbAreaLabel.get(),
+ m_xFtDbArea.get(),
aStrUndefined ) );
// special filter always needs column headers
- pBtnHeader->Check();
- pBtnHeader->Disable();
+ m_xBtnHeader->set_active(true);
+ m_xBtnHeader->set_sensitive(false);
// turn on modal mode
// SetDispatcherLock( true );
@@ -213,12 +183,12 @@ void ScSpecialFilterDlg::Init( const SfxItemSet& rArgSet )
//SFX_APPWINDOW->Disable(false); //! general method in ScAnyRefDlg
}
-bool ScSpecialFilterDlg::Close()
+void ScSpecialFilterDlg::Close()
{
if (pViewData)
pViewData->GetDocShell()->CancelAutoDBRange();
- return DoClose( ScSpecialFilterDlgWrapper::GetChildWindowId() );
+ DoClose( ScSpecialFilterDlgWrapper::GetChildWindowId() );
}
// Transfer of a table area selected with the mouse, which is then displayed
@@ -226,20 +196,20 @@ bool ScSpecialFilterDlg::Close()
void ScSpecialFilterDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
{
- if ( bRefInputMode && pRefInputEdit ) // only possible if in the reference edit mode
+ if ( bRefInputMode && m_pRefInputEdit ) // only possible if in the reference edit mode
{
if ( rRef.aStart != rRef.aEnd )
- RefInputStart( pRefInputEdit );
+ RefInputStart( m_pRefInputEdit );
OUString aRefStr;
const formula::FormulaGrammar::AddressConvention eConv = pDocP->GetAddressConvention();
- if ( pRefInputEdit == pEdCopyArea)
+ if (m_pRefInputEdit == m_xEdCopyArea.get())
aRefStr = rRef.aStart.Format(ScRefFlags::ADDR_ABS_3D, pDocP, eConv);
- else if ( pRefInputEdit == pEdFilterArea)
+ else if (m_pRefInputEdit == m_xEdFilterArea.get())
aRefStr = rRef.Format(ScRefFlags::RANGE_ABS_3D, pDocP, eConv);
- pRefInputEdit->SetRefString( aRefStr );
+ m_pRefInputEdit->SetRefString( aRefStr );
}
}
@@ -247,19 +217,19 @@ void ScSpecialFilterDlg::SetActive()
{
if ( bRefInputMode )
{
- if ( pRefInputEdit == pEdCopyArea )
+ if (m_pRefInputEdit == m_xEdCopyArea.get())
{
- pEdCopyArea->GrabFocus();
- pEdCopyArea->GetModifyHdl().Call( *pEdCopyArea );
+ m_xEdCopyArea->GrabFocus();
+ m_xEdCopyArea->GetModifyHdl().Call( *m_xEdCopyArea );
}
- else if ( pRefInputEdit == pEdFilterArea )
+ else if (m_pRefInputEdit == m_xEdFilterArea.get())
{
- pEdFilterArea->GrabFocus();
- FilterAreaModHdl( *pEdFilterArea );
+ m_xEdFilterArea->GrabFocus();
+ FilterAreaModHdl( *m_xEdFilterArea );
}
}
else
- GrabFocus();
+ m_xDialog->grab_focus();
RefInputDone();
}
@@ -279,14 +249,14 @@ bool ScSpecialFilterDlg::IsRefInputMode() const
// Handler:
-IMPL_LINK( ScSpecialFilterDlg, EndDlgHdl, Button*, pBtn, void )
+IMPL_LINK(ScSpecialFilterDlg, EndDlgHdl, weld::Button&, rBtn, void)
{
OSL_ENSURE( pDoc && pViewData, "Document or ViewData not found. :-/" );
- if ( (pBtn == pBtnOk) && pDoc && pViewData )
+ if (&rBtn == m_xBtnOk.get() && pDoc && pViewData)
{
- OUString theCopyStr( pEdCopyArea->GetText() );
- OUString theAreaStr( pEdFilterArea->GetText() );
+ OUString theCopyStr( m_xEdCopyArea->GetText() );
+ OUString theAreaStr( m_xEdFilterArea->GetText() );
ScQueryParam theOutParam( theQueryData );
ScAddress theAdrCopy;
bool bEditInputOk = true;
@@ -294,7 +264,7 @@ IMPL_LINK( ScSpecialFilterDlg, EndDlgHdl, Button*, pBtn, void )
ScRange theFilterArea;
const formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
- if ( pBtnCopyResult->IsChecked() )
+ if ( m_xBtnCopyResult->get_active() )
{
sal_Int32 nColonPos = theCopyStr.indexOf( ':' );
@@ -305,11 +275,11 @@ IMPL_LINK( ScSpecialFilterDlg, EndDlgHdl, Button*, pBtn, void )
if ( (nResult & ScRefFlags::VALID) == ScRefFlags::ZERO )
{
- if (!pExpander->get_expanded())
- pExpander->set_expanded(true);
+ if (!m_xExpander->get_expanded())
+ m_xExpander->set_expanded(true);
- ERRORBOX(GetFrameWeld(), STR_INVALID_TABREF);
- pEdCopyArea->GrabFocus();
+ ERRORBOX(m_xDialog.get(), STR_INVALID_TABREF);
+ m_xEdCopyArea->GrabFocus();
bEditInputOk = false;
}
}
@@ -320,8 +290,8 @@ IMPL_LINK( ScSpecialFilterDlg, EndDlgHdl, Button*, pBtn, void )
if ( (nResult & ScRefFlags::VALID) == ScRefFlags::ZERO )
{
- ERRORBOX(GetFrameWeld(), STR_INVALID_TABREF);
- pEdFilterArea->GrabFocus();
+ ERRORBOX(m_xDialog.get(), STR_INVALID_TABREF);
+ m_xEdFilterArea->GrabFocus();
bEditInputOk = false;
}
}
@@ -340,7 +310,7 @@ IMPL_LINK( ScSpecialFilterDlg, EndDlgHdl, Button*, pBtn, void )
ScAddress& rStart = theFilterArea.aStart;
ScAddress& rEnd = theFilterArea.aEnd;
- if ( pBtnCopyResult->IsChecked() )
+ if ( m_xBtnCopyResult->get_active() )
{
theOutParam.bInplace = false;
theOutParam.nDestTab = theAdrCopy.Tab();
@@ -355,13 +325,13 @@ IMPL_LINK( ScSpecialFilterDlg, EndDlgHdl, Button*, pBtn, void )
theOutParam.nDestRow = 0;
}
- theOutParam.bHasHeader = pBtnHeader->IsChecked();
+ theOutParam.bHasHeader = m_xBtnHeader->get_active();
theOutParam.bByRow = true;
- theOutParam.bCaseSens = pBtnCase->IsChecked();
- theOutParam.eSearchType = pBtnRegExp->IsChecked() ? utl::SearchParam::SearchType::Regexp :
+ theOutParam.bCaseSens = m_xBtnCase->get_active();
+ theOutParam.eSearchType = m_xBtnRegExp->get_active() ? utl::SearchParam::SearchType::Regexp :
utl::SearchParam::SearchType::Normal;
- theOutParam.bDuplicate = !pBtnUnique->IsChecked();
- theOutParam.bDestPers = pBtnDestPers->IsChecked();
+ theOutParam.bDuplicate = !m_xBtnUnique->get_active();
+ theOutParam.bDestPers = m_xBtnDestPers->get_active();
bQueryOk = pDoc->CreateQueryParam(ScRange(rStart,rEnd), theOutParam);
}
@@ -374,39 +344,38 @@ IMPL_LINK( ScSpecialFilterDlg, EndDlgHdl, Button*, pBtn, void )
GetBindings().GetDispatcher()->ExecuteList(FID_FILTER_OK,
SfxCallMode::SLOT | SfxCallMode::RECORD,
{ GetOutputItem(theOutParam, theFilterArea) });
- Close();
+ response(RET_OK);
}
else
{
- ERRORBOX(GetFrameWeld(), STR_INVALID_QUERYAREA);
- pEdFilterArea->GrabFocus();
+ ERRORBOX(m_xDialog.get(), STR_INVALID_QUERYAREA);
+ m_xEdFilterArea->GrabFocus();
}
}
- else if ( pBtn == pBtnCancel )
+ else if (&rBtn == m_xBtnCancel.get())
{
- Close();
+ response(RET_CANCEL);
}
}
IMPL_LINK( ScSpecialFilterDlg, TimeOutHdl, Timer*, _pIdle, void )
{
// every 50ms check whether RefInputMode is still true
-
- if( (_pIdle == pIdle.get()) && IsActive() )
+ if (_pIdle == pIdle.get() && m_xDialog->has_toplevel_focus())
{
- if( pEdCopyArea->HasFocus() || pRbCopyArea->HasFocus() )
+ if( m_xEdCopyArea->GetWidget()->has_focus() || m_xRbCopyArea->GetWidget()->has_focus() )
{
- pRefInputEdit = pEdCopyArea;
+ m_pRefInputEdit = m_xEdCopyArea.get();
bRefInputMode = true;
}
- else if( pEdFilterArea->HasFocus() || pRbFilterArea->HasFocus() )
+ else if( m_xEdFilterArea->GetWidget()->has_focus() || m_xRbFilterArea->GetWidget()->has_focus() )
{
- pRefInputEdit = pEdFilterArea;
+ m_pRefInputEdit = m_xEdFilterArea.get();
bRefInputMode = true;
}
else if( bRefInputMode )
{
- pRefInputEdit = nullptr;
+ m_pRefInputEdit = nullptr;
bRefInputMode = false;
}
}
@@ -414,23 +383,23 @@ IMPL_LINK( ScSpecialFilterDlg, TimeOutHdl, Timer*, _pIdle, void )
pIdle->Start();
}
-IMPL_LINK( ScSpecialFilterDlg, FilterAreaSelHdl, ListBox&, rLb, void )
+IMPL_LINK(ScSpecialFilterDlg, FilterAreaSelHdl, weld::ComboBox&, rLb, void)
{
- if ( &rLb == pLbFilterArea )
+ if (&rLb == m_xLbFilterArea.get())
{
OUString aString;
- const sal_Int32 nSelPos = pLbFilterArea->GetSelectedEntryPos();
+ const sal_Int32 nSelPos = m_xLbFilterArea->get_active();
if ( nSelPos > 0 )
- aString = *static_cast<OUString*>(pLbFilterArea->GetEntryData( nSelPos ));
+ aString = m_xLbFilterArea->get_id(nSelPos);
- pEdFilterArea->SetText( aString );
+ m_xEdFilterArea->SetText( aString );
}
}
-IMPL_LINK( ScSpecialFilterDlg, FilterAreaModHdl, Edit&, rEd, void )
+IMPL_LINK( ScSpecialFilterDlg, FilterAreaModHdl, formula::WeldRefEdit&, rEd, void )
{
- if ( &rEd == pEdFilterArea )
+ if (&rEd == m_xEdFilterArea.get())
{
if ( pDoc && pViewData )
{
@@ -439,22 +408,21 @@ IMPL_LINK( ScSpecialFilterDlg, FilterAreaModHdl, Edit&, rEd, void )
if ( (nResult & ScRefFlags::VALID) == ScRefFlags::VALID )
{
- const sal_Int32 nCount = pLbFilterArea->GetEntryCount();
-
- for ( sal_Int32 i=1; i<nCount; ++i )
+ const sal_Int32 nCount = m_xLbFilterArea->get_count();
+ for (sal_Int32 i = 1; i < nCount; ++i)
{
- OUString* pStr = static_cast<OUString*>(pLbFilterArea->GetEntryData( i ));
- if (theCurAreaStr == *pStr)
+ OUString aStr = m_xLbFilterArea->get_id(i);
+ if (theCurAreaStr == aStr)
{
- pLbFilterArea->SelectEntryPos( i );
+ m_xLbFilterArea->set_active( i );
return;
}
}
- pLbFilterArea->SelectEntryPos( 0 );
+ m_xLbFilterArea->set_active( 0 );
}
}
else
- pLbFilterArea->SelectEntryPos( 0 );
+ m_xLbFilterArea->set_active( 0 );
}
}
diff --git a/sc/source/ui/inc/filtdlg.hxx b/sc/source/ui/inc/filtdlg.hxx
index 74e87b1cf12b..6e14a2444167 100644
--- a/sc/source/ui/inc/filtdlg.hxx
+++ b/sc/source/ui/inc/filtdlg.hxx
@@ -33,7 +33,6 @@
#include <vector>
#include <map>
-class ScFilterOptionsMgr;
class FilterOptionsMgr;
class ScViewData;
class ScDocument;
@@ -158,44 +157,24 @@ private:
DECL_LINK( TimeOutHdl, Timer*, void );
};
-class ScSpecialFilterDlg : public ScAnyRefDlg
+class ScSpecialFilterDlg : public ScAnyRefDlgController
{
public:
- ScSpecialFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent,
- const SfxItemSet& rArgSet );
- virtual ~ScSpecialFilterDlg() override;
- virtual void dispose() override;
+ ScSpecialFilterDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pParent,
+ const SfxItemSet& rArgSet);
+ virtual ~ScSpecialFilterDlg() override;
virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) override;
virtual bool IsRefInputMode() const override;
virtual void SetActive() override;
- virtual bool Close() override;
+ virtual void Close() override;
private:
- VclPtr<ListBox> pLbFilterArea;
- VclPtr<formula::RefEdit> pEdFilterArea;
- VclPtr<formula::RefButton> pRbFilterArea;
-
- VclPtr<VclExpander> pExpander;
- VclPtr<CheckBox> pBtnCase;
- VclPtr<CheckBox> pBtnRegExp;
- VclPtr<CheckBox> pBtnHeader;
- VclPtr<CheckBox> pBtnUnique;
- VclPtr<CheckBox> pBtnCopyResult;
- VclPtr<ListBox> pLbCopyArea;
- VclPtr<formula::RefEdit> pEdCopyArea;
- VclPtr<formula::RefButton> pRbCopyArea;
- VclPtr<CheckBox> pBtnDestPers;
- VclPtr<FixedText> pFtDbAreaLabel;
- VclPtr<FixedText> pFtDbArea;
const OUString aStrUndefined;
- VclPtr<OKButton> pBtnOk;
- VclPtr<CancelButton> pBtnCancel;
-
- std::unique_ptr<ScFilterOptionsMgr> pOptionsMgr;
+ std::unique_ptr<FilterOptionsMgr> pOptionsMgr;
const sal_uInt16 nWhichQuery;
const ScQueryParam theQueryData;
@@ -203,21 +182,45 @@ private:
ScViewData* pViewData;
ScDocument* pDoc;
- VclPtr<formula::RefEdit> pRefInputEdit;
bool bRefInputMode;
// Hack: RefInput control
std::unique_ptr<Idle> pIdle;
+ formula::WeldRefEdit* m_pRefInputEdit;
+
+ std::unique_ptr<weld::ComboBox> m_xLbFilterArea;
+ std::unique_ptr<formula::WeldRefEdit> m_xEdFilterArea;
+ std::unique_ptr<formula::WeldRefButton> m_xRbFilterArea;
+
+ std::unique_ptr<weld::Expander> m_xExpander;
+ std::unique_ptr<weld::CheckButton> m_xBtnCase;
+ std::unique_ptr<weld::CheckButton> m_xBtnRegExp;
+ std::unique_ptr<weld::CheckButton> m_xBtnHeader;
+ std::unique_ptr<weld::CheckButton> m_xBtnUnique;
+ std::unique_ptr<weld::CheckButton> m_xBtnCopyResult;
+ std::unique_ptr<weld::ComboBox> m_xLbCopyArea;
+ std::unique_ptr<formula::WeldRefEdit> m_xEdCopyArea;
+ std::unique_ptr<formula::WeldRefButton> m_xRbCopyArea;
+ std::unique_ptr<weld::CheckButton> m_xBtnDestPers;
+ std::unique_ptr<weld::Label> m_xFtDbAreaLabel;
+ std::unique_ptr<weld::Label> m_xFtDbArea;
+
+ std::unique_ptr<weld::Button> m_xBtnOk;
+ std::unique_ptr<weld::Button> m_xBtnCancel;
+
+ std::unique_ptr<weld::Frame> m_xFilterFrame;
+ std::unique_ptr<weld::Label> m_xFilterLabel;
+
private:
void Init( const SfxItemSet& rArgSet );
ScQueryItem* GetOutputItem( const ScQueryParam& rParam,
const ScRange& rSource );
// Handler
- DECL_LINK( FilterAreaSelHdl, ListBox&, void );
- DECL_LINK( FilterAreaModHdl, Edit&, void );
- DECL_LINK( EndDlgHdl, Button*, void );
+ DECL_LINK( FilterAreaSelHdl, weld::ComboBox&, void );
+ DECL_LINK( FilterAreaModHdl, formula::WeldRefEdit&, void );
+ DECL_LINK( EndDlgHdl, weld::Button&, void );
// Hack: RefInput control
DECL_LINK( TimeOutHdl, Timer*, void );
diff --git a/sc/source/ui/inc/reffact.hxx b/sc/source/ui/inc/reffact.hxx
index 3d44627c9e6d..09c83aaf5632 100644
--- a/sc/source/ui/inc/reffact.hxx
+++ b/sc/source/ui/inc/reffact.hxx
@@ -52,7 +52,7 @@ DECL_WRAPPER_WITHID(ScXMLSourceDlgWrapper)
DECL_WRAPPER_WITHID(ScPivotLayoutWrapper)
DECL_WRAPPER_WITHID_CONTROLLER(ScTabOpDlgWrapper)
DECL_WRAPPER_WITHID_CONTROLLER(ScFilterDlgWrapper)
-DECL_WRAPPER_WITHID(ScSpecialFilterDlgWrapper)
+DECL_WRAPPER_WITHID_CONTROLLER(ScSpecialFilterDlgWrapper)
DECL_WRAPPER_WITHID_CONTROLLER(ScDbNameDlgWrapper)
DECL_WRAPPER_WITHID_CONTROLLER(ScConsolidateDlgWrapper)
DECL_WRAPPER_WITHID_CONTROLLER(ScPrintAreasDlgWrapper)
diff --git a/sc/source/ui/view/reffact.cxx b/sc/source/ui/view/reffact.cxx
index 445de338882d..02c89d153321 100644
--- a/sc/source/ui/view/reffact.cxx
+++ b/sc/source/ui/view/reffact.cxx
@@ -40,7 +40,7 @@ SFX_IMPL_MODELESSDIALOG_WITHID(ScXMLSourceDlgWrapper, SID_MANAGE_XML_SOURCE)
SFX_IMPL_MODELESSDIALOG_WITHID(ScPivotLayoutWrapper, SID_OPENDLG_PIVOTTABLE )
SFX_IMPL_CHILDWINDOW_WITHID(ScTabOpDlgWrapper, SID_OPENDLG_TABOP )
SFX_IMPL_CHILDWINDOW_WITHID(ScFilterDlgWrapper, SID_FILTER )
-SFX_IMPL_MODELESSDIALOG_WITHID(ScSpecialFilterDlgWrapper, SID_SPECIAL_FILTER )
+SFX_IMPL_CHILDWINDOW_WITHID(ScSpecialFilterDlgWrapper, SID_SPECIAL_FILTER )
SFX_IMPL_CHILDWINDOW_WITHID(ScDbNameDlgWrapper, SID_DEFINE_DBNAME )
SFX_IMPL_CHILDWINDOW_WITHID(ScConsolidateDlgWrapper, SID_OPENDLG_CONSOLIDATE)
SFX_IMPL_CHILDWINDOW_WITHID(ScPrintAreasDlgWrapper, SID_OPENDLG_EDIT_PRINTAREA )
@@ -137,7 +137,7 @@ IMPL_CONTROLLER_CHILD_CTOR( ScTabOpDlgWrapper, SID_OPENDLG_TABOP )
IMPL_CONTROLLER_CHILD_CTOR( ScFilterDlgWrapper, SID_FILTER )
-IMPL_CHILD_CTOR( ScSpecialFilterDlgWrapper, SID_SPECIAL_FILTER )
+IMPL_CONTROLLER_CHILD_CTOR( ScSpecialFilterDlgWrapper, SID_SPECIAL_FILTER )
IMPL_CONTROLLER_CHILD_CTOR( ScDbNameDlgWrapper, SID_DEFINE_DBNAME )
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 40d6a9744ea6..a13c875d776d 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -144,35 +144,6 @@ VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog(
switch( nSlotId )
{
- case SID_SPECIAL_FILTER:
- {
- ScQueryParam aQueryParam;
- SfxItemSet aArgSet( GetPool(),
- svl::Items<SCITEM_QUERYDATA,
- SCITEM_QUERYDATA>{} );
-
- ScDBData* pDBData = GetDBData(false, SC_DB_MAKE, ScGetDBSelection::RowDown);
- pDBData->ExtendDataArea(pDoc);
- pDBData->GetQueryParam( aQueryParam );
-
- ScRange aArea;
- pDBData->GetArea(aArea);
- MarkRange(aArea, false);
-
- ScQueryItem aItem( SCITEM_QUERYDATA, &GetViewData(), &aQueryParam );
- ScRange aAdvSource;
- if (pDBData->GetAdvancedQuerySource(aAdvSource))
- aItem.SetAdvancedQuerySource( &aAdvSource );
-
- aArgSet.Put( aItem );
-
- // mark current sheet (due to RefInput in dialog)
- GetViewData().SetRefTabNo( GetViewData().GetTabNo() );
-
- pResult = VclPtr<ScSpecialFilterDlg>::Create( pB, pCW, pParent, aArgSet );
- }
- break;
-
case SID_OPENDLG_OPTSOLVER:
{
ScViewData& rViewData = GetViewData();
@@ -485,6 +456,34 @@ std::unique_ptr<SfxModelessDialogController> ScTabViewShell::CreateRefDialogCont
xResult.reset(new ScFilterDlg(pB, pCW, pParent, aArgSet));
break;
}
+ case SID_SPECIAL_FILTER:
+ {
+ ScQueryParam aQueryParam;
+ SfxItemSet aArgSet( GetPool(),
+ svl::Items<SCITEM_QUERYDATA,
+ SCITEM_QUERYDATA>{} );
+
+ ScDBData* pDBData = GetDBData(false, SC_DB_MAKE, ScGetDBSelection::RowDown);
+ pDBData->ExtendDataArea(pDoc);
+ pDBData->GetQueryParam( aQueryParam );
+
+ ScRange aArea;
+ pDBData->GetArea(aArea);
+ MarkRange(aArea, false);
+
+ ScQueryItem aItem( SCITEM_QUERYDATA, &GetViewData(), &aQueryParam );
+ ScRange aAdvSource;
+ if (pDBData->GetAdvancedQuerySource(aAdvSource))
+ aItem.SetAdvancedQuerySource( &aAdvSource );
+
+ aArgSet.Put( aItem );
+
+ // mark current sheet (due to RefInput in dialog)
+ GetViewData().SetRefTabNo( GetViewData().GetTabNo() );
+
+ xResult.reset(new ScSpecialFilterDlg(pB, pCW, pParent, aArgSet));
+ break;
+ }
}
if (xResult)
diff --git a/sc/uiconfig/scalc/ui/advancedfilterdialog.ui b/sc/uiconfig/scalc/ui/advancedfilterdialog.ui
index fc3d8d4ceaa1..7701e3c3ae61 100644
--- a/sc/uiconfig/scalc/ui/advancedfilterdialog.ui
+++ b/sc/uiconfig/scalc/ui/advancedfilterdialog.ui
@@ -1,14 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.0 -->
+<!-- Generated with glade 3.22.1 -->
<interface domain="sc">
<requires lib="gtk+" version="3.18"/>
- <requires lib="LibreOffice" version="1.0"/>
<object class="GtkDialog" id="AdvancedFilterDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes" context="advancedfilterdialog|AdvancedFilterDialog">Advanced Filter</property>
<property name="resizable">False</property>
+ <property name="default_width">0</property>
+ <property name="default_height">0</property>
<property name="type_hint">dialog</property>
+ <child>
+ <placeholder/>
+ </child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="visible">True</property>
@@ -101,7 +105,7 @@
<property name="vexpand">True</property>
<property name="column_spacing">12</property>
<child>
- <object class="foruilo-RefButton" id="rbfilterarea">
+ <object class="GtkButton" id="rbfilterarea">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
@@ -118,9 +122,6 @@
<object class="GtkComboBoxText" id="lbfilterarea">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="width_chars">20</property>
- <property name="entry_text_column">0</property>
- <property name="id_column">1</property>
</object>
<packing>
<property name="left_attach">0</property>
@@ -128,10 +129,11 @@
</packing>
</child>
<child>
- <object class="foruilo-RefEdit" id="edfilterarea">
+ <object class="GtkEntry" id="edfilterarea">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
+ <property name="activates_default">True</property>
<property name="width_chars">30</property>
</object>
<packing>
@@ -303,9 +305,6 @@
<object class="GtkComboBoxText" id="lbcopyarea">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="width_chars">20</property>
- <property name="entry_text_column">0</property>
- <property name="id_column">1</property>
<accessibility>
<relation type="labelled-by" target="copyresult"/>
</accessibility>
@@ -321,7 +320,7 @@
</packing>
</child>
<child>
- <object class="foruilo-RefEdit" id="edcopyarea">
+ <object class="GtkEntry" id="edcopyarea">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="margin_bottom">1</property>
@@ -342,7 +341,7 @@
</packing>
</child>
<child>
- <object class="foruilo-RefButton" id="rbcopyarea">
+ <object class="GtkButton" id="rbcopyarea">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
diff --git a/solenv/sanitizers/ui/modules/scalc.suppr b/solenv/sanitizers/ui/modules/scalc.suppr
index f1998440ad95..6eecccc9cd70 100644
--- a/solenv/sanitizers/ui/modules/scalc.suppr
+++ b/solenv/sanitizers/ui/modules/scalc.suppr
@@ -1,4 +1,6 @@
-sc/uiconfig/scalc/ui/advancedfilterdialog.ui://foruilo-RefEdit[@id='edfilterarea'] no-labelled-by
+sc/uiconfig/scalc/ui/advancedfilterdialog.ui://GtkEntry[@id='edfilterarea'] no-labelled-by
+sc/uiconfig/scalc/ui/advancedfilterdialog.ui://GtkButton[@id='rbfilterarea'] button-no-label
+sc/uiconfig/scalc/ui/advancedfilterdialog.ui://GtkButton[@id='rbcopyarea'] button-no-label
sc/uiconfig/scalc/ui/advancedfilterdialog.ui://GtkLabel[@id='dbarealabel'] orphan-label
sc/uiconfig/scalc/ui/advancedfilterdialog.ui://GtkLabel[@id='dbarea'] orphan-label
sc/uiconfig/scalc/ui/aggregatefunctionentry.ui:GtkGrid[@id='grid']/GtkBox/GtkLabel orphan-label
More information about the Libreoffice-commits
mailing list