sc/inc/stlpool.hxx | 2 ++ sc/source/core/data/stlpool.cxx | 10 ++++++++++ sc/source/ui/docshell/docsh.cxx | 3 +++ sc/source/ui/docshell/docsh2.cxx | 3 +++ 4 files changed, 18 insertions(+)
New commits: commit 4df765766892a9148b7be1b8d5f174ee37cf73e0 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Sat Apr 22 20:32:33 2017 +0200 mark all new styles as default styles, tdf#103380, tdf#103330 Change-Id: I0b893d61ea6c9d0fd4af9f08b0d3b2e5454e544e Reviewed-on: https://gerrit.libreoffice.org/36827 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> diff --git a/sc/inc/stlpool.hxx b/sc/inc/stlpool.hxx index 2b7f1f09abe6..7d75031fe2cd 100644 --- a/sc/inc/stlpool.hxx +++ b/sc/inc/stlpool.hxx @@ -56,6 +56,8 @@ public: virtual SfxStyleSheetBase& Make( const OUString&, SfxStyleFamily eFam, sal_uInt16 nMask = SFXSTYLEBIT_ALL) override; + void setAllStandard(); + protected: virtual ~ScStyleSheetPool() override; diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx index 1ef9c311f615..4a1101f5739e 100644 --- a/sc/source/core/data/stlpool.cxx +++ b/sc/source/core/data/stlpool.cxx @@ -440,4 +440,14 @@ ScStyleSheet* ScStyleSheetPool::FindCaseIns( const OUString& rName, SfxStyleFami return nullptr; } +void ScStyleSheetPool::setAllStandard() +{ + SfxStyleSheetBase* pSheet = First(); + while (pSheet) + { + pSheet->SetMask(SCSTYLEBIT_STANDARD); + pSheet = Next(); + } +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 9d1e8fe8d1c2..9b12c99a25d5 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -608,7 +608,10 @@ bool ScDocShell::Load( SfxMedium& rMedium ) ScOrcusFilters* pOrcus = ScFormatFilter::Get().GetOrcusFilters(); if (pOrcus) + { pOrcus->importODS_Styles(aDocument, aPath); + aDocument.GetStyleSheetPool()->setAllStandard(); + } } #endif diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx index e211ee371c69..d9302921c0ec 100644 --- a/sc/source/ui/docshell/docsh2.cxx +++ b/sc/source/ui/docshell/docsh2.cxx @@ -73,7 +73,10 @@ bool ScDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) ScOrcusFilters* pOrcus = ScFormatFilter::Get().GetOrcusFilters(); if (pOrcus) + { pOrcus->importODS_Styles(aDocument, aPath); + aDocument.GetStyleSheetPool()->setAllStandard(); + } } #endif _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits