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 6e55f7df9ae8e0948b456cb02f6c841b353acd23
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/36819
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.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 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!
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to