summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-04-10 09:34:07 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-04-10 11:40:27 +0200
commit91afe5519613bc64f344b5bc7e7fee982a859280 (patch)
tree6c86c76ad313dab4f2e02f2b0138d7e368ca3e95 /sfx2
parent5ab0d0a69ff65eaef1bf043526040b1230fcdb89 (diff)
loplugin:inlinefields in SfxSaveAsTemplateDialog
Change-Id: I7b32fc64b96e2f89edc810d4a95d3a3f6f885957 Reviewed-on: https://gerrit.libreoffice.org/36352 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/saveastemplatedlg.cxx19
1 files changed, 9 insertions, 10 deletions
diff --git a/sfx2/source/doc/saveastemplatedlg.cxx b/sfx2/source/doc/saveastemplatedlg.cxx
index 1aadfebc781a..746c0ed8fab1 100644
--- a/sfx2/source/doc/saveastemplatedlg.cxx
+++ b/sfx2/source/doc/saveastemplatedlg.cxx
@@ -37,8 +37,7 @@ SfxSaveAsTemplateDialog::SfxSaveAsTemplateDialog():
ModalDialog(nullptr, "SaveAsTemplateDialog", "sfx/ui/saveastemplatedlg.ui"),
msSelectedCategory(OUString()),
msTemplateName(OUString()),
- mnRegionPos(0),
- mpDocTemplates(new SfxDocumentTemplates)
+ mnRegionPos(0)
{
get(mpLBCategory, "categorylb");
get(mpCBXDefault, "defaultcb");
@@ -121,10 +120,10 @@ IMPL_LINK_NOARG(SfxSaveAsTemplateDialog, SelectCategoryHdl, ListBox&, void)
void SfxSaveAsTemplateDialog::initialize()
{
- sal_uInt16 nCount = mpDocTemplates->GetRegionCount();
+ sal_uInt16 nCount = maDocTemplates.GetRegionCount();
for (sal_uInt16 i = 0; i < nCount; ++i)
{
- OUString sCategoryName(mpDocTemplates->GetFullRegionName(i));
+ OUString sCategoryName(maDocTemplates.GetFullRegionName(i));
msCategories.push_back(sCategoryName);
}
}
@@ -145,10 +144,10 @@ bool SfxSaveAsTemplateDialog::IsTemplateNameUnique()
it=find(msCategories.begin(), msCategories.end(), msSelectedCategory);
mnRegionPos = std::distance(msCategories.begin(), it);
- sal_uInt16 nEntries = mpDocTemplates->GetCount(mnRegionPos);
+ sal_uInt16 nEntries = maDocTemplates.GetCount(mnRegionPos);
for(sal_uInt16 i = 0; i < nEntries; i++)
{
- OUString aName = mpDocTemplates->GetName(mnRegionPos, i);
+ OUString aName = maDocTemplates.GetName(mnRegionPos, i);
if(aName == msTemplateName)
return false;
}
@@ -165,9 +164,9 @@ bool SfxSaveAsTemplateDialog::SaveTemplate()
if (!xTemplates->storeTemplate( msSelectedCategory, msTemplateName, xStorable ))
return false;
- sal_uInt16 nDocId = mpDocTemplates->GetCount(mnRegionPos);
- OUString sURL = mpDocTemplates->GetTemplateTargetURLFromComponent(msSelectedCategory, msTemplateName);
- bool bIsSaved = mpDocTemplates->InsertTemplate( mnRegionPos, nDocId, msTemplateName, sURL);
+ sal_uInt16 nDocId = maDocTemplates.GetCount(mnRegionPos);
+ OUString sURL = maDocTemplates.GetTemplateTargetURLFromComponent(msSelectedCategory, msTemplateName);
+ bool bIsSaved = maDocTemplates.InsertTemplate( mnRegionPos, nDocId, msTemplateName, sURL);
if (!bIsSaved)
return false;
@@ -194,7 +193,7 @@ bool SfxSaveAsTemplateDialog::SaveTemplate()
SfxObjectFactory::SetStandardTemplate(aServiceName, sURL);
}
- mpDocTemplates->Update();
+ maDocTemplates.Update();
return true;
}