Kaydet (Commit) 56dd851c authored tarafından Caolán McNamara's avatar Caolán McNamara

weld cluster of change tracking dialogs

Change-Id: I42ca7acb41699df91b91a9f59fc68cd30972a397
Reviewed-on: https://gerrit.libreoffice.org/70988
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 6afbe153
......@@ -33,7 +33,7 @@
// class SvxPostItDialog -------------------------------------------------
SvxPostItDialog::SvxPostItDialog(weld::Window* pParent, const SfxItemSet& rCoreSet,
SvxPostItDialog::SvxPostItDialog(weld::Widget* pParent, const SfxItemSet& rCoreSet,
bool bPrevNext)
: SfxDialogController(pParent, "cui/ui/comment.ui", "CommentDialog")
, m_rSet(rCoreSet)
......
......@@ -1315,9 +1315,9 @@ VclPtr<SfxAbstractDialog> AbstractDialogFactory_Impl::CreateSfxDialog(weld::Wind
return nullptr;
}
VclPtr<AbstractSvxPostItDialog> AbstractDialogFactory_Impl::CreateSvxPostItDialog( weld::Window* pParent,
const SfxItemSet& rCoreSet,
bool bPrevNext )
VclPtr<AbstractSvxPostItDialog> AbstractDialogFactory_Impl::CreateSvxPostItDialog(weld::Widget* pParent,
const SfxItemSet& rCoreSet,
bool bPrevNext)
{
return VclPtr<AbstractSvxPostItDialog_Impl>::Create(std::make_unique<SvxPostItDialog>(pParent, rCoreSet, bPrevNext));
}
......
......@@ -804,9 +804,9 @@ public:
SdrModel* pModel,
const SdrObject* pObj,
bool bHasObj ) override;
virtual VclPtr<AbstractSvxPostItDialog> CreateSvxPostItDialog( weld::Window* pParent,
const SfxItemSet& rCoreSet,
bool bPrevNext = false ) override;
virtual VclPtr<AbstractSvxPostItDialog> CreateSvxPostItDialog(weld::Widget* pParent,
const SfxItemSet& rCoreSet,
bool bPrevNext = false) override;
// For TabPage
virtual CreateTabPage GetTabPageCreatorFunc( sal_uInt16 nId ) override;
......
......@@ -37,8 +37,8 @@
class SvxPostItDialog : public SfxDialogController
{
public:
SvxPostItDialog(weld::Window* pParent, const SfxItemSet& rCoreSet,
bool bPrevNext);
SvxPostItDialog(weld::Widget* pParent, const SfxItemSet& rCoreSet,
bool bPrevNext);
virtual ~SvxPostItDialog() override;
static const sal_uInt16* GetRanges();
......
......@@ -831,7 +831,7 @@ void SvxNumberFormatTabPage::FillFormatListBox_Impl( std::vector<OUString>& rEnt
OUString aPreviewString( GetExpColorString( pPreviewColor, aEntry, aPrivCat ) );
m_xLbFormat->append_text(aPreviewString);
if (pPreviewColor)
m_xLbFormat->set_font_color(m_xLbFormat->n_children() -1, *pPreviewColor);
m_xLbFormat->set_font_color(m_xLbFormat->n_children() - 1, *pPreviewColor);
}
else
{
......
......@@ -143,6 +143,7 @@ public:
virtual void Activate() override;
virtual void Deactivate() override;
virtual void ChildWinDispose() override;
virtual void FillInfo(SfxChildWinInfo&) const;
SfxBindings& GetBindings() { return *m_pBindings; }
};
......
......@@ -163,6 +163,7 @@ public:
void SetController(std::shared_ptr<SfxDialogController> controller) { xController = controller; }
void ClearController() { xController.reset(); }
std::shared_ptr<SfxDialogController>& GetController() { return xController; }
const std::shared_ptr<SfxDialogController>& GetController() const { return xController; }
vcl::Window* GetParent() const
{ return pParent; }
SfxChildAlignment GetAlignment() const
......@@ -297,6 +298,13 @@ public:
static_cast<SfxModelessDialog*>(GetWindow())->FillInfo( aInfo ); \
return aInfo; }
#define SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(Class, MyID) \
SFX_IMPL_CHILDWINDOW_WITHID(Class, MyID) \
SfxChildWinInfo Class::GetInfo() const \
{ \
SfxChildWinInfo aInfo = SfxChildWindow::GetInfo(); \
static_cast<const SfxModelessDialogController*>(GetController().get())->FillInfo( aInfo ); \
return aInfo; }
#define SFX_IMPL_DOCKINGWINDOW(Class, MyID) \
SFX_IMPL_CHILDWINDOW(Class, MyID) \
......
......@@ -300,9 +300,14 @@ public:
void set_date(const Date& rDate);
Date get_date() const { return m_xCalendar->get_date(); }
void set_label(const OUString& rLabel) { m_xControl->set_label(rLabel); }
OUString get_label() const { return m_xControl->get_label(); }
void set_sensitive(bool bSensitive) { m_xControl->set_sensitive(bSensitive); }
bool get_sensitive() const { return m_xControl->get_sensitive(); }
void grab_focus() { m_xControl->grab_focus(); }
void connect_activated(const Link<SvtCalendarBox&, void>& rActivatedHdl) { m_aActivatedHdl = rActivatedHdl; }
private:
DECL_LINK(SelectHdl, weld::Calendar&, void);
DECL_LINK(ActivateHdl, weld::Calendar&, void);
......@@ -311,6 +316,10 @@ private:
std::unique_ptr<weld::Builder> m_xBuilder;
std::unique_ptr<weld::Widget> m_xTopLevel;
std::unique_ptr<weld::Calendar> m_xCalendar;
Link<SvtCalendarBox&, void> m_aActivatedHdl;
void set_label_from_date();
};
class SVT_DLLPUBLIC FontNameBox : public ComboBox
......
This diff is collapsed.
......@@ -17,6 +17,7 @@
#include <vcl/timer.hxx>
#include <vcl/idle.hxx>
#include <vcl/vclptr.hxx>
#include <vcl/weld.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/frame/XFrame.hpp>
......@@ -24,6 +25,10 @@
/// This class is the base for the Widget Layout-based sidebar panels.
class SVX_DLLPUBLIC PanelLayout : public Control, public VclBuilderContainer
{
protected:
std::unique_ptr<weld::Builder> m_xBuilder;
std::unique_ptr<weld::Container> m_xContainer;
private:
Idle m_aPanelLayoutIdle;
bool m_bInClose;
......@@ -33,7 +38,7 @@ private:
public:
PanelLayout(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription,
const css::uno::Reference<css::frame::XFrame> &rFrame);
const css::uno::Reference<css::frame::XFrame> &rFrame, bool bInterimBuilder = false);
virtual ~PanelLayout() override;
virtual void dispose() override;
......
......@@ -428,7 +428,7 @@ public:
virtual VclPtr<SfxAbstractDialog> CreateCharMapDialog(weld::Window* pParent, const SfxItemSet& rAttr, bool bInsert) = 0;
virtual VclPtr<SfxAbstractDialog> CreateEventConfigDialog(weld::Window* pParent, const SfxItemSet& rAttr,
const css::uno::Reference< css::frame::XFrame >& _rxFrame) = 0;
virtual VclPtr<AbstractSvxPostItDialog> CreateSvxPostItDialog(weld::Window* pParent, const SfxItemSet& rCoreSet, bool bPrevNext = false) = 0;
virtual VclPtr<AbstractSvxPostItDialog> CreateSvxPostItDialog(weld::Widget* pParent, const SfxItemSet& rCoreSet, bool bPrevNext = false) = 0;
virtual VclPtr<VclAbstractDialog> CreateSvxScriptOrgDialog(weld::Window* pParent, const OUString& rLanguage) override = 0;
virtual DialogGetRanges GetDialogGetRangesFunc() = 0;
......
......@@ -208,6 +208,7 @@ class VCL_DLLPUBLIC SvTreeListBox
Link<SvTreeListBox*,bool> aExpandingHdl;
Link<SvTreeListBox*,void> aSelectHdl;
Link<SvTreeListBox*,void> aDeselectHdl;
Link<const CommandEvent&, bool> aPopupMenuHdl;
Image aPrevInsertedExpBmp;
Image aPrevInsertedColBmp;
......@@ -441,6 +442,7 @@ public:
const Link<SvTreeListBox*,bool>& GetDoubleClickHdl() const { return aDoubleClickHdl; }
void SetExpandingHdl(const Link<SvTreeListBox*,bool>& rNewHdl){aExpandingHdl=rNewHdl;}
void SetExpandedHdl(const Link<SvTreeListBox*,void>& rNewHdl){aExpandedHdl=rNewHdl;}
void SetPopupMenuHdl(const Link<const CommandEvent&, bool>& rLink) { aPopupMenuHdl = rLink; }
virtual void ExpandedHdl();
virtual bool ExpandingHdl();
......
......@@ -552,6 +552,8 @@ protected:
Link<const TreeIter&, bool> m_aExpandingHdl;
Link<TreeView&, void> m_aVisibleRangeChangedHdl;
Link<TreeView&, void> m_aModelChangedHdl;
Link<const CommandEvent&, bool> m_aPopupMenuHdl;
std::function<int(const weld::TreeIter&, const weld::TreeIter&)> m_aCustomSort;
std::vector<int> m_aRadioIndexes;
......@@ -673,6 +675,7 @@ public:
virtual OUString get_id(int pos) const = 0;
virtual int find_id(const OUString& rId) const = 0;
void select_id(const OUString& rId) { select(find_id(rId)); }
void remove_id(const OUString& rText) { remove(find_id(rText)); }
//via iter
virtual std::unique_ptr<TreeIter> make_iterator(const TreeIter* pOrig = nullptr) const = 0;
......@@ -702,6 +705,11 @@ public:
virtual bool iter_parent(TreeIter& rIter) const = 0;
virtual int get_iter_depth(const TreeIter& rIter) const = 0;
virtual int get_iter_index_in_parent(const TreeIter& rIter) const = 0;
/* Compares two paths. If a appears before b in a tree, then -1 is returned.
If b appears before a , then 1 is returned. If the two nodes are equal,
then 0 is returned.
*/
virtual int iter_compare(const TreeIter& a, const TreeIter& b) const = 0;
virtual bool iter_has_child(const TreeIter& rIter) const = 0;
virtual void remove(const TreeIter& rIter) = 0;
virtual void select(const TreeIter& rIter) = 0;
......@@ -721,12 +729,15 @@ public:
virtual void set_image(const TreeIter& rIter,
const css::uno::Reference<css::graphic::XGraphic>& rImage, int col)
= 0;
virtual void set_font_color(const TreeIter& rIter, const Color& rColor) const = 0;
virtual void scroll_to_row(const TreeIter& rIter) = 0;
virtual bool is_selected(const TreeIter& rIter) const = 0;
virtual void move_subtree(TreeIter& rNode, const TreeIter* pNewParent, int nIndexInNewParent)
= 0;
//calling func on each element until func returns true or we run out of elements
virtual void all_foreach(const std::function<bool(TreeIter&)>& func) = 0;
//calling func on each selected element until func returns true or we run out of elements
virtual void selected_foreach(const std::function<bool(TreeIter&)>& func) = 0;
//calling func on each visible element until func returns true or we run out of elements
......@@ -740,6 +751,11 @@ public:
m_aVisibleRangeChangedHdl = rLink;
}
virtual void connect_popup_menu(const Link<const CommandEvent&, bool>& rLink)
{
m_aPopupMenuHdl = rLink;
}
//all of them
void select_all() { unselect(-1); }
void unselect_all() { select(-1); }
......@@ -759,6 +775,12 @@ public:
virtual int get_sort_column() const = 0;
virtual void set_sort_column(int nColumn) = 0;
virtual void
set_sort_func(const std::function<int(const weld::TreeIter&, const weld::TreeIter&)>& func)
{
m_aCustomSort = func;
}
virtual void clear() = 0;
virtual int get_height_rows(int nRows) const = 0;
......@@ -1434,6 +1456,8 @@ public:
return m_xSpinButton->get_value_changed_from_saved();
}
void set_position(int nCursorPos) { m_xSpinButton->set_position(nCursorPos); }
void set_text(const OUString& rText) { m_xSpinButton->set_text(rText); }
OUString get_text() const { return m_xSpinButton->get_text(); }
weld::SpinButton& get_widget() { return *m_xSpinButton; }
};
......
......@@ -1199,10 +1199,10 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell )
while ( bLoop )
{
bLoop = false;
ScopedVclPtrInstance< ScConflictsDlg > aDlg( GetActiveDialogParent(), GetViewData(), &rSharedDoc, aConflictsList );
if ( aDlg->Execute() == RET_CANCEL )
vcl::Window* pWin = GetActiveDialogParent();
ScConflictsDlg aDlg(pWin ? pWin->GetFrameWeld() : nullptr, GetViewData(), &rSharedDoc, aConflictsList);
if (aDlg.run() == RET_CANCEL)
{
vcl::Window* pWin = GetActiveDialogParent();
std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
VclMessageType::Question, VclButtonsType::YesNo,
ScResId(STR_DOC_WILLNOTBESAVED)));
......
......@@ -45,17 +45,12 @@ public:
bool bIsAcceptable;
};
class ScAcceptChgDlg final : public SfxModelessDialog
class ScAcceptChgDlg final : public SfxModelessDialogController
{
Idle aSelectionIdle;
Idle aReOpenIdle;
VclPtr<PopupMenu> m_xPopup;
VclPtr<SvxAcceptChgCtr> m_pAcceptChgCtr;
ScViewData* pViewData;
ScDocument* pDoc;
VclPtr<SvxTPFilter> pTPFilter;
VclPtr<SvxTPView> pTPView;
VclPtr<SvxRedlinTable> pTheView; // #i48648 now SvHeaderTabListBox
ScRangeList aRangeList;
ScChangeViewSettings aChangeViewSet;
OUString aStrInsertCols;
......@@ -82,6 +77,14 @@ class ScAcceptChgDlg final : public SfxModelessDialog
bool bHasFilterEntry:1;
bool bUseColor:1;
SvxTPFilter* pTPFilter;
SvxTPView* pTPView;
SvxRedlinTable* pTheView; // #i48648 now SvHeaderTabListBox
std::unique_ptr<weld::Container> m_xContentArea;
std::unique_ptr<weld::Menu> m_xPopup;
std::unique_ptr<SvxAcceptChgCtr> m_xAcceptChgCtr;
void Init();
DECL_LINK( FilterHandle, SvxTPFilter*, void );
......@@ -90,15 +93,16 @@ class ScAcceptChgDlg final : public SfxModelessDialog
DECL_LINK( AcceptHandle, SvxTPView*, void );
DECL_LINK( RejectAllHandle, SvxTPView*, void );
DECL_LINK( AcceptAllHandle, SvxTPView*, void );
DECL_LINK( ExpandingHandle, SvTreeListBox*, bool );
DECL_LINK( SelectHandle, SvTreeListBox*, void );
DECL_LINK( ExpandingHandle, const weld::TreeIter&, bool );
DECL_LINK( SelectHandle, weld::TreeView&, void );
DECL_LINK( RefInfoHandle, const OUString*, void );
DECL_LINK( UpdateSelectionHdl, Timer*, void );
DECL_LINK( ChgTrackModHdl, ScChangeTrack&, void );
DECL_LINK( CommandHdl, SvSimpleTable*, void );
DECL_LINK( CommandHdl, const CommandEvent&, bool );
DECL_LINK( ReOpenTimerHdl, Timer*, void );
DECL_LINK( ColCompareHdl, const SvSortData*, sal_Int32 );
int ColCompareHdl(const weld::TreeIter& rLeft, const weld::TreeIter& rRight) const;
void RejectFiltered();
void AcceptFiltered();
......@@ -107,31 +111,32 @@ class ScAcceptChgDlg final : public SfxModelessDialog
OUString* MakeTypeString(ScChangeActionType eType);
SvTreeListEntry* AppendChangeAction(
const ScChangeAction* pScChangeAction,
SvTreeListEntry* pParent=nullptr,bool bDelMaster = false,
std::unique_ptr<weld::TreeIter> AppendChangeAction(
const ScChangeAction* pScChangeAction, bool bCreateOnDamend,
const weld::TreeIter* pParent = nullptr, bool bDelMaster = false,
bool bDisabled = false);
SvTreeListEntry* AppendFilteredAction(
std::unique_ptr<weld::TreeIter> AppendFilteredAction(
const ScChangeAction* pScChangeAction,ScChangeActionState eState,
SvTreeListEntry* pParent = nullptr,bool bDelMaster = false,
bool bCreateOnDemand,
const weld::TreeIter* pParent = nullptr, bool bDelMaster = false,
bool bDisabled = false);
SvTreeListEntry* InsertChangeActionContent(const ScChangeActionContent* pScChangeAction,
SvTreeListEntry* pParent,sal_uLong nSpecial);
std::unique_ptr<weld::TreeIter> InsertChangeActionContent(const ScChangeActionContent* pScChangeAction,
const weld::TreeIter& rParent, sal_uLong nSpecial);
void GetDependents( const ScChangeAction* pScChangeAction,
ScChangeActionMap& aActionMap,
SvTreeListEntry* pEntry);
void GetDependents(const ScChangeAction* pScChangeAction,
ScChangeActionMap& aActionMap,
const weld::TreeIter& rEntry);
bool InsertContentChildren( ScChangeActionMap* pActionMap, SvTreeListEntry* pParent );
bool InsertContentChildren(ScChangeActionMap* pActionMap, const weld::TreeIter& rParent);
bool InsertAcceptedORejected(SvTreeListEntry* pParent);
bool InsertAcceptedORejected(const weld::TreeIter& rParent);
bool InsertDeletedChildren( const ScChangeAction* pChangeAction, ScChangeActionMap* pActionMap,
SvTreeListEntry* pParent);
bool InsertDeletedChildren(const ScChangeAction* pChangeAction, ScChangeActionMap* pActionMap,
const weld::TreeIter& rParent);
bool InsertChildren( ScChangeActionMap* pActionMap, SvTreeListEntry* pParent );
bool InsertChildren(ScChangeActionMap* pActionMap, const weld::TreeIter& rParent);
void AppendChanges(const ScChangeTrack* pChanges,sal_uLong nStartAction, sal_uLong nEndAction);
......@@ -142,20 +147,17 @@ class ScAcceptChgDlg final : public SfxModelessDialog
void ClearView();
bool Expand(const ScChangeTrack* pChanges,const ScChangeAction* pScChangeAction,
SvTreeListEntry* pEntry, bool bFilter = false);
const weld::TreeIter& rEntry, bool bFilter = false);
public:
ScAcceptChgDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent,
ScViewData* ptrViewData);
virtual ~ScAcceptChgDlg() override;
virtual void dispose() override;
ScAcceptChgDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pParent,
ScViewData* ptrViewData);
virtual ~ScAcceptChgDlg() override;
void ReInit(ScViewData* ptrViewData);
void Initialize (SfxChildWinInfo* pInfo);
virtual void FillInfo(SfxChildWinInfo&) const override;
};
#endif // INCLUDED_SC_SOURCE_UI_INC_ACREDLIN_HXX
......
......@@ -111,50 +111,46 @@ public:
// class ScConflictsDlg
class ScConflictsDlg : public ModalDialog
class ScConflictsDlg : public weld::GenericDialogController
{
private:
VclPtr<SvSimpleTableContainer> m_pLbConflictsContainer;
VclPtr<SvxRedlinTable> m_pLbConflicts;
VclPtr<PushButton> m_pBtnKeepMine;
VclPtr<PushButton> m_pBtnKeepOther;
VclPtr<PushButton> m_pBtnKeepAllMine;
VclPtr<PushButton> m_pBtnKeepAllOthers;
OUString const maStrTitleConflict;
OUString const maStrUnknownUser;
OUString const maStrTitleConflict;
OUString const maStrUnknownUser;
ScViewData* const mpViewData;
ScViewData* const mpViewData;
ScDocument* mpOwnDoc;
ScChangeTrack* mpOwnTrack;
ScDocument* const mpSharedDoc;
ScDocument* const mpSharedDoc;
ScChangeTrack* mpSharedTrack;
ScConflictsList& mrConflictsList;
Idle maSelectionIdle;
bool mbInSelectHdl;
bool mbInDeselectHdl;
std::unique_ptr<weld::Button> m_xBtnKeepMine;
std::unique_ptr<weld::Button> m_xBtnKeepOther;
std::unique_ptr<weld::Button> m_xBtnKeepAllMine;
std::unique_ptr<weld::Button> m_xBtnKeepAllOthers;
std::unique_ptr<SvxRedlinTable> m_xLbConflicts;
OUString GetConflictString( const ScConflictsListEntry& rConflictEntry );
OUString GetActionString( const ScChangeAction* pAction, ScDocument* pDoc );
void HandleListBoxSelection( bool bSelectHandle );
void SetActionString(const ScChangeAction* pAction, ScDocument* pDoc, weld::TreeIter& rEntry);
void HandleListBoxSelection();
static void SetConflictAction( const SvTreeListEntry* pRootEntry, ScConflictAction eConflictAction );
void SetConflictAction(const weld::TreeIter& rRootEntry, ScConflictAction eConflictAction);
void KeepHandler( bool bMine );
void KeepAllHandler( bool bMine );
DECL_LINK( SelectHandle, SvTreeListBox*, void );
DECL_LINK( DeselectHandle, SvTreeListBox*, void );
DECL_LINK( SelectHandle, weld::TreeView&, void );
DECL_LINK( UpdateSelectionHdl, Timer*, void );
DECL_LINK( KeepMineHandle, Button*, void );
DECL_LINK( KeepOtherHandle, Button*, void );
DECL_LINK( KeepAllMineHandle, Button*, void );
DECL_LINK( KeepAllOthersHandle, Button*, void );
DECL_LINK( KeepMineHandle, weld::Button&, void );
DECL_LINK( KeepOtherHandle, weld::Button&, void );
DECL_LINK( KeepAllMineHandle, weld::Button&, void );
DECL_LINK( KeepAllOthersHandle, weld::Button&, void );
public:
ScConflictsDlg( vcl::Window* pParent, ScViewData* pViewData, ScDocument* pSharedDoc, ScConflictsList& rConflictsList );
virtual ~ScConflictsDlg() override;
virtual void dispose() override;
ScConflictsDlg(weld::Window* pParent, ScViewData* pViewData, ScDocument* pSharedDoc, ScConflictsList& rConflictsList);
virtual ~ScConflictsDlg() override;
void UpdateView();
};
......
......@@ -29,42 +29,44 @@ class ScViewData;
class ScDocument;
class ScHighlightChgDlg : public ScAnyRefDlg
class ScHighlightChgDlg : public ScAnyRefDlgController
{
private:
VclPtr<CheckBox> m_pHighlightBox;
VclPtr<SvxTPFilter> m_pFilterCtr;
VclPtr<CheckBox> m_pCbAccept;
VclPtr<CheckBox> m_pCbReject;
VclPtr<OKButton> m_pOkButton;
VclPtr<formula::RefEdit> m_pEdAssign;
VclPtr<formula::RefButton> m_pRbAssign;
ScViewData* pViewData;
ScDocument* pDoc;
ScChangeViewSettings aChangeViewSet;
std::unique_ptr<weld::CheckButton> m_xHighlightBox;
std::unique_ptr<weld::CheckButton> m_xCbAccept;
std::unique_ptr<weld::CheckButton> m_xCbReject;
std::unique_ptr<weld::Button> m_xOkButton;
std::unique_ptr<formula::WeldRefEdit> m_xEdAssign;
std::unique_ptr<formula::WeldRefButton> m_xRbAssign;
std::unique_ptr<weld::Container> m_xBox;
std::unique_ptr<SvxTPFilter> m_xFilterCtr;
void Init();
DECL_LINK( RefHandle, SvxTPFilter*, void );
DECL_LINK( HighlightHandle, Button*, void );
DECL_LINK( OKBtnHdl, Button*, void );
DECL_LINK( HighlightHandle, weld::Button&, void );
DECL_LINK( OKBtnHdl, weld::Button&, void );
protected:
virtual void RefInputDone( bool bForced = false ) override;
public:
ScHighlightChgDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent,
ScViewData* ptrViewData);
ScHighlightChgDlg( SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pParent,
ScViewData* ptrViewData);
virtual ~ScHighlightChgDlg() override;
virtual void dispose() override;
virtual ~ScHighlightChgDlg() override;
virtual void SetActive() override;
virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) override;
virtual bool Close() override;
virtual void Close() override;
virtual bool IsRefInputMode() const override;
};
......
......@@ -33,30 +33,19 @@
SFX_DECL_CHILDWINDOW_WITHID(Class); \
};
#define DECL_WRAPPER_WITHID_CONTROLLER(Class) \
class Class : public SfxChildWindow \
{ \
public: \
Class( vcl::Window*, sal_uInt16, SfxBindings*, const SfxChildWinInfo* ); \
static std::unique_ptr<SfxChildWindow> CreateImpl(vcl::Window *pParent, sal_uInt16 nId, \
SfxBindings *pBindings, SfxChildWinInfo* pInfo ); \
static void RegisterChildWindow (bool bVisible=false, SfxModule *pMod=nullptr, SfxChildWindowFlags nFlags=SfxChildWindowFlags::NONE); \
static sal_uInt16 GetChildWindowId ();\
};
DECL_WRAPPER_WITHID_CONTROLLER(ScNameDlgWrapper)
DECL_WRAPPER_WITHID_CONTROLLER(ScNameDefDlgWrapper)
DECL_WRAPPER_WITHID_CONTROLLER(ScSolverDlgWrapper)
DECL_WRAPPER_WITHID_CONTROLLER(ScOptSolverDlgWrapper)
DECL_WRAPPER_WITHID(ScNameDlgWrapper)
DECL_WRAPPER_WITHID(ScNameDefDlgWrapper)
DECL_WRAPPER_WITHID(ScSolverDlgWrapper)
DECL_WRAPPER_WITHID(ScOptSolverDlgWrapper)
DECL_WRAPPER_WITHID(ScXMLSourceDlgWrapper)
DECL_WRAPPER_WITHID(ScPivotLayoutWrapper)
DECL_WRAPPER_WITHID_CONTROLLER(ScTabOpDlgWrapper)
DECL_WRAPPER_WITHID_CONTROLLER(ScFilterDlgWrapper)
DECL_WRAPPER_WITHID_CONTROLLER(ScSpecialFilterDlgWrapper)
DECL_WRAPPER_WITHID_CONTROLLER(ScDbNameDlgWrapper)
DECL_WRAPPER_WITHID_CONTROLLER(ScConsolidateDlgWrapper)
DECL_WRAPPER_WITHID_CONTROLLER(ScPrintAreasDlgWrapper)
DECL_WRAPPER_WITHID_CONTROLLER(ScColRowNameRangesDlgWrapper)
DECL_WRAPPER_WITHID(ScTabOpDlgWrapper)
DECL_WRAPPER_WITHID(ScFilterDlgWrapper)
DECL_WRAPPER_WITHID(ScSpecialFilterDlgWrapper)
DECL_WRAPPER_WITHID(ScDbNameDlgWrapper)
DECL_WRAPPER_WITHID(ScConsolidateDlgWrapper)
DECL_WRAPPER_WITHID(ScPrintAreasDlgWrapper)
DECL_WRAPPER_WITHID(ScColRowNameRangesDlgWrapper)
DECL_WRAPPER_WITHID(ScFormulaDlgWrapper)
DECL_WRAPPER_WITHID(ScHighlightChgDlgWrapper)
DECL_WRAPPER_WITHID(ScCondFormatDlgWrapper)
......@@ -159,41 +148,38 @@ private:
ScFourierAnalysisDialogWrapper() = delete;
};
class ScAcceptChgDlgWrapper: public SfxChildWindow
class ScAcceptChgDlgWrapper : public SfxChildWindow
{
public:
ScAcceptChgDlgWrapper( vcl::Window*,
sal_uInt16,
SfxBindings*,
SfxChildWinInfo* );
public:
ScAcceptChgDlgWrapper( vcl::Window*,
sal_uInt16,
SfxBindings*,
SfxChildWinInfo* );
SFX_DECL_CHILDWINDOW_WITHID(Class);
SFX_DECL_CHILDWINDOW_WITHID(Class);
void ReInitDlg();
void ReInitDlg();
};
class ScSimpleRefDlgWrapper: public SfxChildWindow
{
public:
ScSimpleRefDlgWrapper( vcl::Window*,
sal_uInt16,
SfxBindings*,
SfxChildWinInfo* );
static std::unique_ptr<SfxChildWindow> CreateImpl(vcl::Window *pParent, sal_uInt16 nId,
SfxBindings *pBindings, SfxChildWinInfo* pInfo);
static void RegisterChildWindow(bool bVisible=false, SfxModule *pMod=nullptr, SfxChildWindowFlags nFlags=SfxChildWindowFlags::NONE);
static sal_uInt16 GetChildWindowId();
static void SetDefaultPosSize(Point aPos, Size aSize);
void SetRefString(const OUString& rStr);
void SetCloseHdl( const Link<const OUString*,void>& rLink );
void SetUnoLinks( const Link<const OUString&,void>& rDone, const Link<const OUString&,void>& rAbort,
const Link<const OUString&,void>& rChange );
void SetFlags( bool bCloseOnButtonUp, bool bSingleCell, bool bMultiSelection );
static void SetAutoReOpen(bool bFlag);
void StartRefInput();
public:
ScSimpleRefDlgWrapper(vcl::Window*,
sal_uInt16,
SfxBindings*,
SfxChildWinInfo*);
SFX_DECL_CHILDWINDOW_WITHID(Class);
static void SetDefaultPosSize(Point aPos, Size aSize);
void SetRefString(const OUString& rStr);
void SetCloseHdl( const Link<const OUString*,void>& rLink );
void SetUnoLinks( const Link<const OUString&,void>& rDone, const Link<const OUString&,void>& rAbort,
const Link<const OUString&,void>& rChange );
void SetFlags( bool bCloseOnButtonUp, bool bSingleCell, bool bMultiSelection );
static void SetAutoReOpen(bool bFlag);
void StartRefInput();
};
class SC_DLLPUBLIC ScValidityRefChildWin : public SfxChildWindow
......
......@@ -35,6 +35,7 @@ private:
ScRange theCurArea;
bool bCloseFlag;
bool bAutoReOpen;
bool bCloseOnButtonUp;
bool bSingleCell;
bool bMultiSelection;
......@@ -67,6 +68,7 @@ public:
void StartRefInput();
void SetRefString(const OUString &rStr);
virtual void FillInfo(SfxChildWinInfo&) const override;
void SetCloseHdl( const Link<const OUString*,void>& rLink );
void SetUnoLinks( const Link<const OUString&,void>& rDone, const Link<const OUString&,void>& rAbort,
......
......@@ -23,6 +23,7 @@
ScSimpleRefDlg::ScSimpleRefDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pParent)
: ScAnyRefDlgController(pB, pCW, pParent, "modules/scalc/ui/simplerefdialog.ui", "SimpleRefDialog")
, bAutoReOpen(true)
, bCloseOnButtonUp(false)
, bSingleCell(false)
, bMultiSelection(false)
......@@ -45,6 +46,12 @@ ScSimpleRefDlg::~ScSimpleRefDlg()
SetDispatcherLock( false ); // deactivate modal mode
}
void ScSimpleRefDlg::FillInfo(SfxChildWinInfo& rWinInfo) const
{
ScAnyRefDlgController::FillInfo(rWinInfo);
rWinInfo.bVisible = bAutoReOpen;