summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-04-22 20:32:33 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-04-22 22:45:12 +0200
commit6e55f7df9ae8e0948b456cb02f6c841b353acd23 (patch)
tree1e641e1f12c8a22ae140fbdc86e68e0934280af8 /sc
parenta4df49725b142f1c779fd7f95c58acfa5654cd92 (diff)
mark all new styles as default styles, tdf#103380, tdf#103330
Change-Id: I0b893d61ea6c9d0fd4af9f08b0d3b2e5454e544e Reviewed-on: https://gerrit.libreoffice.org/36819 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc')
-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 e41e8f03693d..b4aa9bbb7505 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 e9369c93def8..b4f95a008d71 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -599,7 +599,10 @@ bool ScDocShell::Load( SfxMedium& rMedium )
ScOrcusFilters* pOrcus = ScFormatFilter::Get().GetOrcusFilters();
if (pOrcus)
+ {
pOrcus->importODS_Styles(aDocument, aPath);
+ aDocument.GetStyleSheetPool()->setAllStandard();
+ }
}
bRet = LoadXML( &rMedium, nullptr );
diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx
index 9dc8cd2b319d..e656dc49ce72 100644
--- a/sc/source/ui/docshell/docsh2.cxx
+++ b/sc/source/ui/docshell/docsh2.cxx
@@ -71,7 +71,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();
+ }
}
// SetDocumentModified is not allowed anymore in Load/InitNew!