[Libreoffice-commits] core.git: sfx2/source
Anshu (via logerrit)
logerrit at kemper.freedesktop.org
Tue Aug 17 07:03:07 UTC 2021
sfx2/source/dialog/StyleList.cxx | 66 ++++++++++++++++++++-------------------
sfx2/source/dialog/templdlg.cxx | 57 ++++++++++++++++++++-------------
sfx2/source/inc/StyleList.hxx | 23 ++++++-------
sfx2/source/inc/templdgi.hxx | 20 ++---------
4 files changed, 83 insertions(+), 83 deletions(-)
New commits:
commit 39e969ac53b7e0b2c4889a3f910d97521ec4251f
Author: Anshu <anshukhare50 at gmail.com>
AuthorDate: Mon Aug 2 04:52:42 2021 -0700
Commit: Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Tue Aug 17 09:02:32 2021 +0200
Refactoring
Change-Id: I0863c4afb5dfce549dbcbdae4b8a63068e5d7331
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119878
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx
index 27c05c6ff27e..259113f62e96 100644
--- a/sfx2/source/dialog/StyleList.cxx
+++ b/sfx2/source/dialog/StyleList.cxx
@@ -178,17 +178,13 @@ IMPL_LINK_NOARG(StyleList, ReadResource, void*, size_t)
m_xStyleFamilies.emplace();
m_nActFilter = 0xffff;
- // Assigning value to Dialog's nActFilter so that both nActFilters are in sync
- m_pParentDialog->SetFilterByIndex(m_nActFilter);
+
if (m_pCurObjShell)
{
m_nActFilter = static_cast<sal_uInt16>(m_aLoadFactoryStyleFilter.Call(m_pCurObjShell));
- // Assigning value to Dialog's nActFilter so that both nActFilters are in sync
- m_pParentDialog->SetFilterByIndex(m_nActFilter);
if (0xffff == m_nActFilter)
{
m_nActFilter = m_pCurObjShell->GetAutoStyleFilterIndex();
- m_pParentDialog->SetFilterByIndex(m_nActFilter);
}
}
size_t nCount = m_xStyleFamilies->size();
@@ -281,19 +277,23 @@ public:
}
};
-IMPL_LINK(StyleList, FilterSelect, sal_uInt16, mActFilter, void)
+void StyleList::FilterSelect(sal_uInt16 nActFilter, bool bsetFilter)
{
- m_nActFilter = mActFilter;
- SfxObjectShell* const pDocShell = m_aSaveSelection.Call(nullptr);
- SfxStyleSheetBasePool* pOldStyleSheetPool = m_pStyleSheetPool;
- m_pStyleSheetPool = pDocShell ? pDocShell->GetStyleSheetPool() : nullptr;
- if (pOldStyleSheetPool != m_pStyleSheetPool)
+ m_nActFilter = nActFilter;
+ if (bsetFilter)
{
- if (pOldStyleSheetPool)
- EndListening(*pOldStyleSheetPool);
- if (m_pStyleSheetPool)
- StartListening(*m_pStyleSheetPool);
+ SfxObjectShell* const pDocShell = m_aSaveSelection.Call(*this);
+ SfxStyleSheetBasePool* pOldStyleSheetPool = m_pStyleSheetPool;
+ m_pStyleSheetPool = pDocShell ? pDocShell->GetStyleSheetPool() : nullptr;
+ if (pOldStyleSheetPool != m_pStyleSheetPool)
+ {
+ if (pOldStyleSheetPool)
+ EndListening(*pOldStyleSheetPool);
+ if (m_pStyleSheetPool)
+ StartListening(*m_pStyleSheetPool);
+ }
}
+ UpdateStyles(StyleFlags::UpdateFamilyList);
}
IMPL_LINK(StyleList, SetFamily, sal_uInt16, nId, void)
@@ -351,15 +351,11 @@ void StyleList::Initialize()
LINK(this, StyleList, NewMenuExecuteAction));
m_pParentDialog->connect_stylelist_for_watercan(LINK(this, StyleList, IsSafeForWaterCan));
m_pParentDialog->connect_stylelist_has_selected_style(LINK(this, StyleList, HasSelectedStyle));
- m_pParentDialog->connect_stylelist_update_styles(LINK(this, StyleList, UpdateStyles));
- m_pParentDialog->connect_stylelist_update_family(LINK(this, StyleList, UpdateFamily));
m_pParentDialog->connect_stylelist_update_style_dependents(
LINK(this, StyleList, UpdateStyleDependents));
m_pParentDialog->connect_stylelist_enable_tree_drag(LINK(this, StyleList, EnableTreeDrag));
- m_pParentDialog->connect_stylelist_filter_select(LINK(this, StyleList, FilterSelect));
m_pParentDialog->connect_stylelist_enable_delete(LINK(this, StyleList, EnableDelete));
m_pParentDialog->connect_stylelist_set_water_can_state(LINK(this, StyleList, SetWaterCanState));
- m_pParentDialog->connect_family_select(LINK(this, StyleList, FamilySelect));
m_pParentDialog->connect_set_family(LINK(this, StyleList, SetFamily));
int nTreeHeight = m_xFmtLb->get_height_rows(8);
@@ -379,7 +375,7 @@ void StyleList::Initialize()
Update();
}
-IMPL_LINK_NOARG(StyleList, UpdateFamily, void*, void)
+void StyleList::UpdateFamily()
{
m_bUpdateFamily = false;
@@ -425,7 +421,7 @@ void StyleList::connect_LoadFactoryStyleFilter(const Link<SfxObjectShell const*,
m_aLoadFactoryStyleFilter = rLink;
}
-void StyleList::connect_SaveSelection(const Link<void*, SfxObjectShell*> rLink)
+void StyleList::connect_SaveSelection(const Link<StyleList&, SfxObjectShell*> rLink)
{
m_aSaveSelection = rLink;
}
@@ -554,6 +550,7 @@ IMPL_LINK_NOARG(StyleList, NewMenuExecuteAction, void*, void)
m_pParentDialog->Execute_Impl(SID_STYLE_NEW_BY_EXAMPLE, aTemplName, "",
static_cast<sal_uInt16>(GetFamilyItem()->GetFamily()),
*this, nFilter);
+ UpdateFamily();
m_aUpdateFamily.Call(*this);
}
}
@@ -805,7 +802,7 @@ IMPL_LINK(StyleList, SetWaterCanState, const SfxBoolItem*, pItem, void)
m_pBindings->LeaveRegistrations();
}
-IMPL_LINK(StyleList, FamilySelect, sal_uInt16, nEntry, void)
+void StyleList::FamilySelect(sal_uInt16 nEntry)
{
m_nActFamily = nEntry;
SfxDispatcher* pDispat = m_pBindings->GetDispatcher_Impl();
@@ -814,6 +811,7 @@ IMPL_LINK(StyleList, FamilySelect, sal_uInt16, nEntry, void)
pDispat->ExecuteList(SID_STYLE_FAMILY, SfxCallMode::SYNCHRON, { &aItem });
m_pBindings->Invalidate(SID_STYLE_FAMILY);
m_pBindings->Update(SID_STYLE_FAMILY);
+ UpdateFamily();
m_aUpdateFamily.Call(*this);
}
@@ -1065,7 +1063,7 @@ IMPL_LINK_NOARG(StyleList, UpdateStyleDependents, void*, void)
}
// Comes into action when the current style is changed
-IMPL_LINK(StyleList, UpdateStyles, StyleFlags, nFlags, void)
+void StyleList::UpdateStyles(StyleFlags nFlags)
{
OSL_ENSURE(nFlags != StyleFlags::NONE, "nothing to do");
const SfxStyleFamilyItem* pItem = GetFamilyItem();
@@ -1081,8 +1079,7 @@ IMPL_LINK(StyleList, UpdateStyles, StyleFlags, nFlags, void)
// It happens sometimes, God knows why
return;
m_nAppFilter = m_pFamilyState[StyleNrToInfoOffset(n)]->GetValue();
- m_pParentDialog->SetApplicationFilter(m_nAppFilter);
- m_pParentDialog->FamilySelect(StyleNrToInfoOffset(n) + 1);
+ m_pParentDialog->FamilySelect(StyleNrToInfoOffset(n) + 1, *this);
pItem = GetFamilyItem();
}
@@ -1407,6 +1404,7 @@ void StyleList::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
}
else if (m_bUpdateFamily)
{
+ UpdateFamily();
m_aUpdateFamily.Call(*this);
}
@@ -1687,7 +1685,10 @@ void StyleList::Update()
}
if (m_bUpdateFamily)
+ {
+ UpdateFamily();
m_aUpdateFamily.Call(*this);
+ }
sal_uInt16 i;
for (i = 0; i < MAX_FAMILIES; ++i)
@@ -1710,8 +1711,7 @@ void StyleList::Update()
std::unique_ptr<SfxTemplateItem>& pNewItem = m_pFamilyState[StyleNrToInfoOffset(n)];
m_nAppFilter = pNewItem->GetValue();
- m_pParentDialog->SetApplicationFilter(m_nAppFilter);
- m_pParentDialog->FamilySelect(StyleNrToInfoOffset(n) + 1);
+ m_pParentDialog->FamilySelect(StyleNrToInfoOffset(n) + 1, *this);
pItem = pNewItem.get();
}
else if (bDocChanged)
@@ -1719,15 +1719,13 @@ void StyleList::Update()
// other DocShell -> all new
m_pParentDialog->CheckItem(OString::number(m_nActFamily));
m_nActFilter = static_cast<sal_uInt16>(m_aLoadFactoryStyleFilter.Call(pDocShell));
- m_pParentDialog->SetFilterByIndex(m_nActFilter);
+ m_pParentDialog->IsUpdate(true, *this);
if (0xffff == m_nActFilter)
{
m_nActFilter = pDocShell->GetAutoStyleFilterIndex();
- m_pParentDialog->SetFilterByIndex(m_nActFilter);
}
m_nAppFilter = pItem->GetValue();
- m_pParentDialog->SetApplicationFilter(m_nAppFilter);
if (!m_xTreeBox->get_visible())
{
UpdateStyles(StyleFlags::UpdateFamilyList);
@@ -1745,7 +1743,6 @@ void StyleList::Update()
&& m_nAppFilter != pItem->GetValue())
{
m_nAppFilter = pItem->GetValue();
- m_pParentDialog->SetApplicationFilter(m_nAppFilter);
if (!m_xTreeBox->get_visible())
UpdateStyles(StyleFlags::UpdateFamilyList);
else
@@ -1754,7 +1751,6 @@ void StyleList::Update()
else
{
m_nAppFilter = pItem->GetValue();
- m_pParentDialog->SetApplicationFilter(m_nAppFilter);
}
}
const OUString aStyle(pItem->GetStyleName());
@@ -1812,4 +1808,10 @@ IMPL_LINK(StyleList, PopupTreeMenuHdl, const CommandEvent&, rCEvt, bool)
return true;
}
+void StyleList::setVisible(bool b)
+{
+ m_xTreeBox->set_visible(b && m_bHierarchical);
+ m_xFmtLb->set_visible(b && !m_bHierarchical);
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index a3f3cfd8b66d..cd2ab4840310 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -172,11 +172,6 @@ void SfxCommonTemplateDialog_Impl::connect_stylelist_enable_tree_drag(const Link
m_aStyleListEnableTreeDrag = rLink;
}
-void SfxCommonTemplateDialog_Impl::connect_stylelist_filter_select(Link<sal_uInt16, void> rLink)
-{
- m_aStyleListFilterSelect = rLink;
-}
-
void SfxCommonTemplateDialog_Impl::connect_stylelist_enable_delete(const Link<void*, void> rLink)
{
m_aStyleListEnableDelete = rLink;
@@ -188,11 +183,6 @@ void SfxCommonTemplateDialog_Impl::connect_stylelist_set_water_can_state(
m_aStyleListSetWaterCanState = rLink;
}
-void SfxCommonTemplateDialog_Impl::connect_family_select(const Link<sal_uInt16, void> rLink)
-{
- m_aStyleListFamilySelect = rLink;
-}
-
// Constructor
SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl(SfxBindings* pB, weld::Container* pC, weld::Builder* pBuilder)
@@ -206,7 +196,6 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl(SfxBindings* pB, weld
, mxFilterLb(pBuilder->weld_combo_box("filter"))
, nActFamily(0xffff)
, nActFilter(0)
- , nAppFilter(SfxStyleSearchBits::Auto)
, bIsWater(false)
, bUpdate(false)
, bUpdateFamily(false)
@@ -229,6 +218,18 @@ void SfxTemplateDialog_Impl::EnableEdit(bool bEnable)
IMPL_LINK(SfxCommonTemplateDialog_Impl, ReadResource_Hdl, StyleList&, rStyleList, void)
{
+ nActFilter = 0xffff;
+
+ SfxViewFrame* pViewFrame = pBindings->GetDispatcher_Impl()->GetFrame();
+ SfxObjectShell* pCurObjShell = pViewFrame->GetObjectShell();
+ if (pCurObjShell)
+ {
+ nActFilter = static_cast<sal_uInt16>(LoadFactoryStyleFilter_Hdl(pCurObjShell));
+ if (0xffff == nActFilter)
+ {
+ nActFilter = pCurObjShell->GetAutoStyleFilterIndex();
+ }
+ }
size_t nCount = m_aStyleListReadResource.Call(nullptr);
@@ -307,7 +308,7 @@ IMPL_LINK(SfxCommonTemplateDialog_Impl, UpdateStyles_Hdl, StyleFlags, nFlags, vo
else
{
nActFilter = 0;
- m_aStyleList.SetFilterIdx(nActFilter);
+ m_aStyleList.FilterSelect(nActFilter, false);
mxFilterLb->set_active(1);
}
@@ -325,7 +326,7 @@ IMPL_LINK(SfxCommonTemplateDialog_Impl, UpdateStyles_Hdl, StyleFlags, nFlags, vo
else
{
nActFilter = 0;
- m_aStyleList.SetFilterIdx(nActFilter);
+ m_aStyleList.FilterSelect(nActFilter, false);
mxFilterLb->set_active(1);
}
}
@@ -532,7 +533,7 @@ void SfxCommonTemplateDialog_Impl::EnableHierarchical(bool const bEnable, StyleL
{
// Turn on treeView
m_bWantHierarchical = true;
- SaveSelection_Hdl(nullptr); // fdo#61429 store "hierarchical"
+ SaveSelection_Hdl(rStyleList); // fdo#61429 store "hierarchical"
m_aStyleList.SetHierarchical();
}
}
@@ -556,9 +557,21 @@ void SfxCommonTemplateDialog_Impl::FilterSelect(
return;
nActFilter = nEntry;
- m_aStyleListFilterSelect.Call(nActFilter);
+ m_aStyleList.FilterSelect(nActFilter, true);
+}
- m_aStyleListUpdateStyles.Call(StyleFlags::UpdateFamilyList);
+void SfxCommonTemplateDialog_Impl::IsUpdate(bool bDoUpdate, StyleList&)
+{
+ SfxViewFrame* pViewFrame = pBindings->GetDispatcher_Impl()->GetFrame();
+ SfxObjectShell* pDocShell = pViewFrame->GetObjectShell();
+ if (bDoUpdate)
+ {
+ nActFilter = static_cast<sal_uInt16>(LoadFactoryStyleFilter_Hdl(pDocShell));
+ if (0xffff == nActFilter)
+ {
+ nActFilter = pDocShell->GetAutoStyleFilterIndex();
+ }
+ }
}
IMPL_LINK(SfxCommonTemplateDialog_Impl, FilterSelectHdl, weld::ComboBox&, rBox, void)
@@ -574,14 +587,14 @@ IMPL_LINK(SfxCommonTemplateDialog_Impl, FilterSelectHdl, weld::ComboBox&, rBox,
}
// Select-Handler for the Toolbox
-void SfxCommonTemplateDialog_Impl::FamilySelect(sal_uInt16 nEntry, bool bPreviewRefresh)
+void SfxCommonTemplateDialog_Impl::FamilySelect(sal_uInt16 nEntry, StyleList&, bool bPreviewRefresh)
{
assert((0 < nEntry && nEntry <= MAX_FAMILIES) || 0xffff == nEntry);
if( nEntry != nActFamily || bPreviewRefresh )
{
CheckItem(OString::number(nActFamily), false);
nActFamily = nEntry;
- m_aStyleListFamilySelect.Call(nEntry);
+ m_aStyleList.FamilySelect(nEntry);
}
}
@@ -671,7 +684,7 @@ void SfxCommonTemplateDialog_Impl::SaveFactoryStyleFilter( SfxObjectShell const
xModuleManager->replaceByName( getModuleIdentifier( xModuleManager, i_pObjSh ), makeAny( lProps ) );
}
-IMPL_LINK_NOARG(SfxCommonTemplateDialog_Impl, SaveSelection_Hdl, void*, SfxObjectShell*)
+IMPL_LINK_NOARG(SfxCommonTemplateDialog_Impl, SaveSelection_Hdl, StyleList&, SfxObjectShell*)
{
SfxViewFrame *const pViewFrame(pBindings->GetDispatcher_Impl()->GetFrame());
SfxObjectShell *const pDocShell(pViewFrame->GetObjectShell());
@@ -692,7 +705,7 @@ IMPL_LINK_NOARG(SfxCommonTemplateDialog_Impl, PreviewHdl, weld::Toggleable&, voi
m_aStyleList.EnablePreview(bCustomPreview);
- FamilySelect(nActFamily, true);
+ FamilySelect(nActFamily, m_aStyleList, true);
}
IMPL_LINK_NOARG(SfxCommonTemplateDialog_Impl, UpdateStyleDependents_Hdl, void*, void)
@@ -848,7 +861,7 @@ bool SfxTemplateDialog_Impl::IsCheckedItem(const OString& rMesId)
IMPL_LINK( SfxTemplateDialog_Impl, ToolBoxLSelect, const OString&, rEntry, void)
{
- FamilySelect(rEntry.toUInt32());
+ FamilySelect(rEntry.toUInt32(), m_aStyleList);
}
IMPL_LINK(SfxTemplateDialog_Impl, ToolBoxRSelect, const OString&, rEntry, void)
@@ -904,8 +917,6 @@ IMPL_LINK(SfxCommonTemplateDialog_Impl, UpdateFamily_Hdl, StyleList&, rStyleList
bTreeDrag = true;
bUpdateByExampleDisabled = false;
- m_aStyleListUpdateFamily.Call(nullptr);
-
if (IsCheckedItem("watercan") &&
// only if that area is allowed
rStyleList.CurrentFamilyHasState())
diff --git a/sfx2/source/inc/StyleList.hxx b/sfx2/source/inc/StyleList.hxx
index 7ab7fafcac02..72efc8981fbc 100644
--- a/sfx2/source/inc/StyleList.hxx
+++ b/sfx2/source/inc/StyleList.hxx
@@ -88,11 +88,6 @@ public:
// It is used to defaultly set the hierarchical view
bool IsTreeView() { return m_xTreeBox->get_visible(); }
- // Dialog and StyleList have their own copies of m_nActFilter
- // When this value gets updated in Dialog's UpdateStyles_Hdl while setting a filter,
- // the corresponding value gets updated here too.
- void SetFilterIdx(sal_uInt16 filter) { m_nActFilter = filter; }
-
// Helper function: Access to the current family item
// Used in Dialog's updateStyleHandler, Execute_Impl etc...
const SfxStyleFamilyItem* GetFamilyItem() const;
@@ -120,13 +115,21 @@ public:
void connect_ReadResource(const Link<StyleList&, void>& rLink) { m_aReadResource = rLink; }
void connect_ClearResource(const Link<void*, void>& rLink) { m_aClearResource = rLink; }
void connect_LoadFactoryStyleFilter(const Link<SfxObjectShell const*, sal_Int32>& rLink);
- void connect_SaveSelection(const Link<void*, SfxObjectShell*> rLink);
+ void connect_SaveSelection(const Link<StyleList&, SfxObjectShell*> rLink);
void connect_UpdateStyleDependents(const Link<void*, void> rLink);
void connect_UpdateFamily(const Link<StyleList&, void> rLink) { m_aUpdateFamily = rLink; }
+ void FamilySelect(sal_uInt16 nEntry);
+ void FilterSelect(sal_uInt16 nActFilter, bool bsetFilter);
+
+ void setVisible(bool b);
+
private:
void FillTreeBox(SfxStyleFamily eFam);
+ void UpdateFamily();
+ void UpdateStyles(StyleFlags nFlags);
+
OUString getDefaultStyleName(const SfxStyleFamily eFam);
SfxStyleFamily GetActualFamily() const;
void GetSelectedStyle() const;
@@ -152,16 +155,12 @@ private:
DECL_LINK(NewMenuExecuteAction, void*, void);
DECL_LINK(IsSafeForWaterCan, void*, bool);
DECL_LINK(HasSelectedStyle, void*, bool);
- DECL_LINK(UpdateFamily, void*, void);
- DECL_LINK(UpdateStyles, StyleFlags, void);
DECL_LINK(UpdateStyleDependents, void*, void);
DECL_LINK(TimeOut, Timer*, void);
DECL_LINK(EnableTreeDrag, bool, void);
DECL_LINK(EnableDelete, void*, void);
- DECL_LINK(FilterSelect, sal_uInt16, void);
DECL_LINK(SetWaterCanState, const SfxBoolItem*, void);
DECL_LINK(SetFamily, sal_uInt16, void);
- DECL_LINK(FamilySelect, sal_uInt16, void);
void InvalidateBindings();
@@ -170,7 +169,7 @@ private:
Link<StyleList&, void> m_aReadResource;
Link<void*, void> m_aClearResource;
Link<SfxObjectShell const*, sal_Int32> m_aLoadFactoryStyleFilter;
- Link<void*, SfxObjectShell*> m_aSaveSelection;
+ Link<StyleList&, SfxObjectShell*> m_aSaveSelection;
Link<void*, void> m_aUpdateStyleDependents;
Link<StyleList&, void> m_aUpdateFamily;
@@ -217,7 +216,7 @@ private:
std::array<std::unique_ptr<SfxTemplateItem>, MAX_FAMILIES> m_pFamilyState;
SfxObjectShell* m_pCurObjShell;
sal_uInt16 m_nActFamily;
- SfxStyleSearchBits m_nAppFilter;
+ SfxStyleSearchBits m_nAppFilter; // Filter, which has set the application (for automatic)
std::unique_ptr<TreeViewDropTarget> m_xTreeView1DropTargetHelper;
std::unique_ptr<TreeViewDropTarget> m_xTreeView2DropTargetHelper;
diff --git a/sfx2/source/inc/templdgi.hxx b/sfx2/source/inc/templdgi.hxx
index daedd86de98c..d555f7404277 100644
--- a/sfx2/source/inc/templdgi.hxx
+++ b/sfx2/source/inc/templdgi.hxx
@@ -86,7 +86,6 @@ protected:
sal_uInt16 nActFamily; // Id in the ToolBox = Position - 1
sal_uInt16 nActFilter; // FilterIdx
- SfxStyleSearchBits nAppFilter; // Filter, which has set the application (for automatic)
bool bIsWater :1;
bool bUpdate :1;
@@ -104,15 +103,12 @@ protected:
Link<void*, void> m_aStyleListNewMenu;
Link<void*, bool> m_aStyleListWaterCan;
Link<void*, bool> m_aStyleListHasSelectedStyle;
- Link<StyleFlags, void> m_aStyleListUpdateStyles;
Link<void*, void> m_aStyleListUpdateFamily;
Link<SfxHintId, void> m_aStyleListNotify;
Link<void*, void> m_aStyleListUpdateStyleDependents;
Link<bool, void> m_aStyleListEnableTreeDrag;
- Link<sal_uInt16, void> m_aStyleListFilterSelect;
Link<void*, void> m_aStyleListEnableDelete;
Link<const SfxBoolItem*, void> m_aStyleListSetWaterCanState;
- Link<sal_uInt16, void> m_aStyleListFamilySelect;
Link<sal_uInt16, void> m_aStyleListSetFamily;
DECL_LINK(FilterSelectHdl, weld::ComboBox&, void );
@@ -138,7 +134,7 @@ protected:
DECL_LINK(ReadResource_Hdl, StyleList&, void);
DECL_LINK(ClearResource_Hdl, void*, void);
- DECL_LINK(SaveSelection_Hdl, void*, SfxObjectShell*);
+ DECL_LINK(SaveSelection_Hdl, StyleList&, SfxObjectShell*);
DECL_LINK(LoadFactoryStyleFilter_Hdl, SfxObjectShell const*, sal_Int32);
DECL_LINK(UpdateStyles_Hdl, StyleFlags, void);
DECL_LINK(UpdateFamily_Hdl, StyleList&, void);
@@ -158,7 +154,7 @@ public:
// Used in StyleList::UpdateStyles, StyleList::Update
// Whenever a new family(Eg. Character, List etc.) is selected it comes into action
- void FamilySelect(sal_uInt16 nId, bool bPreviewRefresh = false);
+ void FamilySelect(sal_uInt16 nId, StyleList& rStyleList, bool bPreviewRefresh = false);
// Constructor
SfxCommonTemplateDialog_Impl(SfxBindings* pB, weld::Container*, weld::Builder* pBuilder);
@@ -193,12 +189,8 @@ public:
// This is used when a style is selected
void SelectStyle(const OUString& rStyle, bool bIsCallback, StyleList& rStyleList);
- // Dialog and StyleList have their own copies of variable nAppFilter.
- // When a filter is applied, it comes into action and updates the value of nAppFilter
- void SetApplicationFilter(SfxStyleSearchBits filter) { nAppFilter = filter; }
- // Dialog and StyleList have their own copies of variable nActFilter.
- // When a filter is applied, it comes into action and updates the value of nActFilter
- void SetFilterByIndex(sal_uInt16 filter) { nActFilter = filter; }
+ //When a new document is created, it comes into action
+ void IsUpdate(bool bDoUpdate, StyleList&);
// This function return the value of bUpdate in Stylelist
// This value is used in StyleList's Notify
@@ -214,15 +206,11 @@ public:
void connect_stylelist_execute_new_menu(const Link<void*, void>& rLink) { m_aStyleListNewMenu = rLink; }
void connect_stylelist_for_watercan(const Link<void*, bool>& rLink) { m_aStyleListWaterCan = rLink; }
void connect_stylelist_has_selected_style(const Link<void*, bool>& rLink);
- void connect_stylelist_update_styles(const Link<StyleFlags, void> rLink) { m_aStyleListUpdateStyles = rLink; }
- void connect_stylelist_update_family(const Link<void*, void> rLink) { m_aStyleListUpdateFamily = rLink; }
void connect_stylelist_update_style_dependents(const Link<void*, void>& rLink);
void connect_stylelist_enable_tree_drag(const Link<bool, void> rLink);
void connect_stylelist_notify(const Link<SfxHintId, void> rLink) { m_aStyleListNotify = rLink; }
- void connect_stylelist_filter_select(Link<sal_uInt16, void> rLink);
void connect_stylelist_enable_delete(const Link<void*, void> rLink);
void connect_stylelist_set_water_can_state(const Link<const SfxBoolItem*, void> rLink);
- void connect_family_select(const Link<sal_uInt16, void> rLink);
void connect_set_family(const Link<sal_uInt16, void> rLink) { m_aStyleListSetFamily = rLink; }
};
More information about the Libreoffice-commits
mailing list