summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-05-03 20:49:54 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-05-04 17:47:49 +0200
commit224c155d89e4d957c0d566a5aea6004a466d54e9 (patch)
tree318c90cbfa5fdfcfadb74befe8f18b5adc296f2f /sfx2
parent9ca3a372a45d146acb8efdda5c02bd10e1a14ab3 (diff)
make Search family and mask explicit for SfxNewStyleDlg
Change-Id: Ib3e5765d37474188d6505f1d9965969ee6c24f0c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93358 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/newstyle.cxx10
-rw-r--r--sfx2/source/dialog/templdlg.cxx2
2 files changed, 7 insertions, 5 deletions
diff --git a/sfx2/source/dialog/newstyle.cxx b/sfx2/source/dialog/newstyle.cxx
index ed7a20f70d63..288fc39c1244 100644
--- a/sfx2/source/dialog/newstyle.cxx
+++ b/sfx2/source/dialog/newstyle.cxx
@@ -30,7 +30,7 @@
IMPL_LINK_NOARG(SfxNewStyleDlg, OKClickHdl, weld::Button&, void)
{
const OUString aName(m_xColBox->get_active_text());
- SfxStyleSheetBase* pStyle = m_rPool.Find(aName, m_rPool.GetSearchFamily());
+ SfxStyleSheetBase* pStyle = m_rPool.Find(aName, m_eSearchFamily);
if ( pStyle )
{
if ( !pStyle->IsUserDefined() )
@@ -60,9 +60,10 @@ IMPL_LINK(SfxNewStyleDlg, ModifyHdl, weld::ComboBox&, rBox, void)
m_xOKBtn->set_sensitive(!rBox.get_active_text().replaceAll(" ", "").isEmpty());
}
-SfxNewStyleDlg::SfxNewStyleDlg(weld::Window* pParent, SfxStyleSheetBasePool& rInPool)
+SfxNewStyleDlg::SfxNewStyleDlg(weld::Window* pParent, SfxStyleSheetBasePool& rInPool, SfxStyleFamily eFam, SfxStyleSearchBits nMask)
: GenericDialogController(pParent, "sfx/ui/newstyle.ui", "CreateStyleDialog")
, m_rPool(rInPool)
+ , m_eSearchFamily(eFam)
, m_xColBox(m_xBuilder->weld_entry_tree_view("stylegrid", "stylename", "styles"))
, m_xOKBtn(m_xBuilder->weld_button("ok"))
, m_xQueryOverwriteBox(Application::CreateMessageDialog(m_xDialog.get(), VclMessageType::Question, VclButtonsType::YesNo,
@@ -75,11 +76,12 @@ SfxNewStyleDlg::SfxNewStyleDlg(weld::Window* pParent, SfxStyleSheetBasePool& rIn
m_xColBox->connect_changed(LINK(this, SfxNewStyleDlg, ModifyHdl));
m_xColBox->connect_row_activated(LINK(this, SfxNewStyleDlg, OKHdl));
- SfxStyleSheetBase *pStyle = m_rPool.First();
+ auto xIter = m_rPool.CreateIterator(eFam, nMask);
+ SfxStyleSheetBase *pStyle = xIter->First();
while (pStyle)
{
m_xColBox->append_text(pStyle->GetName());
- pStyle = m_rPool.Next();
+ pStyle = xIter->Next();
}
}
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 9fe35922cd39..6cfc649abf44 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -1621,7 +1621,7 @@ void SfxCommonTemplateDialog_Impl::ActionSelect(const OString& rEntry)
pStyleSheetPool->SetSearchMask( eFam, SfxStyleSearchBits::UserDefined );
// why? : FloatingWindow must not be parent of a modal dialog
- SfxNewStyleDlg aDlg(pWindow ? pWindow->GetFrameWeld() : nullptr, *pStyleSheetPool);
+ SfxNewStyleDlg aDlg(pWindow ? pWindow->GetFrameWeld() : nullptr, *pStyleSheetPool, eFam, SfxStyleSearchBits::UserDefined);
if (aDlg.run() == RET_OK)
{
pStyleSheetPool->SetSearchMask(eFam, nFilter);