From cae9785d0f7aa298d2f98f5d0334610b603d2b79 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 5 May 2020 14:34:08 +0100 Subject: use SfxStyleSearchBits::Auto as fallback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit instead of SfxStyleSheetBasePool::GetSearchMask() Change-Id: I2ca3ccc775f30f0ffa99f6cc2c41c69c6d401010 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93493 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sfx2/source/dialog/templdlg.cxx | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'sfx2') diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index aab406227ef4..8d52f5ae8ad5 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -1607,15 +1607,11 @@ void SfxCommonTemplateDialog_Impl::ActionSelect(const OString& rEntry) { const SfxStyleFamily eFam=GetFamilyItem_Impl()->GetFamily(); const SfxStyleFamilyItem *pItem = GetFamilyItem_Impl(); - SfxStyleSearchBits nFilter; - if( pItem && nActFilter != 0xffff ) - { + SfxStyleSearchBits nFilter(SfxStyleSearchBits::Auto); + if (pItem && nActFilter != 0xffff) nFilter = pItem->GetFilterList()[nActFilter].nFlags; - if(nFilter == SfxStyleSearchBits::Auto) // automatic - nFilter = nAppFilter; - } - else - nFilter=pStyleSheetPool->GetSearchMask(); + if (nFilter == SfxStyleSearchBits::Auto) // automatic + nFilter = nAppFilter; // why? : FloatingWindow must not be parent of a modal dialog SfxNewStyleDlg aDlg(pWindow ? pWindow->GetFrameWeld() : nullptr, *pStyleSheetPool, eFam); @@ -1719,15 +1715,11 @@ void SfxCommonTemplateDialog_Impl::NewHdl() const SfxStyleFamilyItem *pItem = GetFamilyItem_Impl(); const SfxStyleFamily eFam=pItem->GetFamily(); - SfxStyleSearchBits nMask; - if( nActFilter != 0xffff ) - { + SfxStyleSearchBits nMask(SfxStyleSearchBits::Auto); + if (nActFilter != 0xffff) nMask = pItem->GetFilterList()[nActFilter].nFlags; - if(nMask == SfxStyleSearchBits::Auto) // automatic - nMask = nAppFilter; - } - else - nMask=pStyleSheetPool->GetSearchMask(); + if (nMask == SfxStyleSearchBits::Auto) // automatic + nMask = nAppFilter; pStyleSheetPool->SetSearchMask(eFam,nMask); -- cgit