summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-04-22 20:32:33 +0200
committerEike Rathke <erack@redhat.com>2017-04-27 17:24:52 +0200
commit4df765766892a9148b7be1b8d5f174ee37cf73e0 (patch)
tree4c4aefbb6c1efe336fb82d2ee92517b05773061b
parent8f51b4272450b6220f563740538f143c0bc70175 (diff)
mark all new styles as default styles, tdf#103380, tdf#103330
Change-Id: I0b893d61ea6c9d0fd4af9f08b0d3b2e5454e544e Reviewed-on: https://gerrit.libreoffice.org/36827 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
-rw-r--r--sc/inc/stlpool.hxx2
-rw-r--r--sc/source/core/data/stlpool.cxx10
-rw-r--r--sc/source/ui/docshell/docsh.cxx3
-rw-r--r--sc/source/ui/docshell/docsh2.cxx3
4 files changed, 18 insertions, 0 deletions
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