summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cui/source/customize/acccfg.cxx2
-rw-r--r--cui/source/customize/cfgutil.cxx19
-rw-r--r--cui/source/inc/cfgutil.hxx4
3 files changed, 14 insertions, 11 deletions
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index dfaf2004d173..f5d90803fc58 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -924,7 +924,7 @@ void SfxAcceleratorConfigPage::Init(const uno::Reference<ui::XAcceleratorConfigu
if (xController.is())
xModel = xController->getModel();
- m_aStylesInfo.setModel(xModel);
+ m_aStylesInfo.init(m_sModuleLongName, xModel);
m_pFunctionBox->SetStylesInfo(&m_aStylesInfo);
m_pGroupLBox->SetStylesInfo(&m_aStylesInfo);
m_bStylesInfoInitialized = true;
diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index ad171a755354..408c74331950 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -76,8 +76,9 @@ using namespace ::com::sun::star::document;
SfxStylesInfo_Impl::SfxStylesInfo_Impl()
{}
-void SfxStylesInfo_Impl::setModel(const css::uno::Reference< css::frame::XModel >& xModel)
+void SfxStylesInfo_Impl::init(const OUString& rModuleName, const css::uno::Reference< css::frame::XModel >& xModel)
{
+ m_aModuleName = rModuleName;
m_xDoc = xModel;
}
@@ -171,12 +172,14 @@ std::vector< SfxStyleInfo_Impl > SfxStylesInfo_Impl::getStyleFamilies()
css::uno::Reference< css::container::XNameAccess > xCont = xModel->getStyleFamilies();
css::uno::Sequence< OUString > lFamilyNames = xCont->getElementNames();
std::vector< SfxStyleInfo_Impl > lFamilies;
- sal_Int32 c = lFamilyNames.getLength();
- sal_Int32 i = 0;
- for(i=0; i<c; ++i)
+ for (const auto& aFamily : lFamilyNames)
{
+ if ((aFamily == "CellStyles" && m_aModuleName != "com.sun.star.sheet.SpreadsheetDocument") ||
+ aFamily == "cell" || aFamily == "table" || aFamily == "Default")
+ continue;
+
SfxStyleInfo_Impl aFamilyInfo;
- aFamilyInfo.sFamily = lFamilyNames[i];
+ aFamilyInfo.sFamily = aFamily;
try
{
@@ -1189,9 +1192,9 @@ SvxScriptSelectorDialog::SvxScriptSelectorDialog(
m_pOKButton->Show();
get(m_pCategories, "categories");
+ const OUString aModuleName(vcl::CommandInfoProvider::GetModuleIdentifier(xFrame));
m_pCategories->SetFunctionListBox(m_pCommands);
- m_pCategories->Init(comphelper::getProcessComponentContext(), xFrame,
- vcl::CommandInfoProvider::GetModuleIdentifier(xFrame), bShowSlots);
+ m_pCategories->Init(comphelper::getProcessComponentContext(), xFrame, aModuleName, bShowSlots);
m_pCategories->SetSelectHdl(
LINK( this, SvxScriptSelectorDialog, SelectHdl ) );
@@ -1211,7 +1214,7 @@ SvxScriptSelectorDialog::SvxScriptSelectorDialog(
if (xController.is())
xModel = xController->getModel();
- m_aStylesInfo.setModel(xModel);
+ m_aStylesInfo.init(aModuleName, xModel);
m_pCommands->SetStylesInfo(&m_aStylesInfo);
m_pCategories->SetStylesInfo(&m_aStylesInfo);
diff --git a/cui/source/inc/cfgutil.hxx b/cui/source/inc/cfgutil.hxx
index d053555bba86..acc0020daa1f 100644
--- a/cui/source/inc/cfgutil.hxx
+++ b/cui/source/inc/cfgutil.hxx
@@ -61,13 +61,13 @@ struct SfxStyleInfo_Impl
struct SfxStylesInfo_Impl
{
private:
-
+ OUString m_aModuleName;
css::uno::Reference< css::frame::XModel > m_xDoc;
public:
SfxStylesInfo_Impl();
- void setModel(const css::uno::Reference< css::frame::XModel >& xModel);
+ void init(const OUString& rModuleName, const css::uno::Reference< css::frame::XModel >& xModel);
static bool parseStyleCommand(SfxStyleInfo_Impl& aStyle);
void getLabel4Style(SfxStyleInfo_Impl& aStyle);