summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-05-03 19:39:19 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-05-03 22:44:08 +0200
commita9102a1c637272d88ef542d37b871bd9278cacb7 (patch)
treec8396740a53e5262f1937917fea008098d853d00
parent28609e1017adf10cdfa513639406e362e578259e (diff)
explicitly pass SfxStyleFamily to GenerateUnusedName
Change-Id: I7879578383d58cb65441c9049e91e33bb4827afb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93353 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--include/sfx2/styledlg.hxx3
-rw-r--r--sfx2/source/dialog/mgetempl.cxx2
-rw-r--r--sfx2/source/dialog/styledlg.cxx4
-rw-r--r--sw/source/uibase/app/docst.cxx2
4 files changed, 6 insertions, 5 deletions
diff --git a/include/sfx2/styledlg.hxx b/include/sfx2/styledlg.hxx
index eb91875c5702..6fd7afde1f85 100644
--- a/include/sfx2/styledlg.hxx
+++ b/include/sfx2/styledlg.hxx
@@ -25,6 +25,7 @@
class SfxStyleSheetBase;
class SfxStyleSheetBasePool;
+enum class SfxStyleFamily;
class SFX2_DLLPUBLIC SfxStyleDialogController : public SfxTabDialogController
{
@@ -43,7 +44,7 @@ public:
virtual short Ok() override;
- static OUString GenerateUnusedName(SfxStyleSheetBasePool &rPool);
+ static OUString GenerateUnusedName(SfxStyleSheetBasePool &rPool, SfxStyleFamily eFam);
};
#endif
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
index f924b41ac96d..44aba7480eaf 100644
--- a/sfx2/source/dialog/mgetempl.cxx
+++ b/sfx2/source/dialog/mgetempl.cxx
@@ -110,7 +110,7 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage(weld::Container* pPage, weld::D
if ( pStyle->GetName().isEmpty() && pPool )
{
// NullString as Name -> generate Name
- OUString aNoName(SfxStyleDialogController::GenerateUnusedName(*pPool));
+ OUString aNoName(SfxStyleDialogController::GenerateUnusedName(*pPool, pStyle->GetFamily()));
pStyle->SetName( aNoName );
aName = aNoName;
aFollow = pStyle->GetFollow();
diff --git a/sfx2/source/dialog/styledlg.cxx b/sfx2/source/dialog/styledlg.cxx
index 133c338d1176..3f694ec66573 100644
--- a/sfx2/source/dialog/styledlg.cxx
+++ b/sfx2/source/dialog/styledlg.cxx
@@ -108,12 +108,12 @@ IMPL_LINK_NOARG(SfxStyleDialogController, CancelHdl, weld::Button&, void)
m_xDialog->response(RET_CANCEL);
}
-OUString SfxStyleDialogController::GenerateUnusedName(SfxStyleSheetBasePool &rPool)
+OUString SfxStyleDialogController::GenerateUnusedName(SfxStyleSheetBasePool &rPool, SfxStyleFamily eFam)
{
OUString aNo(SfxResId(STR_NONAME));
sal_uInt16 i = 1;
OUString aNoName = aNo + OUString::number(i);
- while (rPool.Find(aNoName, rPool.GetSearchFamily(), rPool.GetSearchMask()))
+ while (rPool.Find(aNoName, eFam, rPool.GetSearchMask()))
{
++i;
aNoName = aNo + OUString::number(i);
diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index 70a69a6d255c..72aaf1e8f918 100644
--- a/sw/source/uibase/app/docst.cxx
+++ b/sw/source/uibase/app/docst.cxx
@@ -310,7 +310,7 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq )
sParent = static_cast<const SfxStringItem*>(pItem)->GetValue();
if (sName.isEmpty() && m_xBasePool.get())
- sName = SfxStyleDialogController::GenerateUnusedName(*m_xBasePool);
+ sName = SfxStyleDialogController::GenerateUnusedName(*m_xBasePool, nFamily);
Edit(sName, sParent, nFamily, nMask, true, OString(), nullptr, &rReq, nSlot);
}