summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorJaskaran Singh <jvsg1303@gmail.com>2016-07-13 12:22:49 +0530
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-09-18 00:15:12 +0200
commit57f71f190a2b11fdcc471d94cdc60727f18a656f (patch)
tree813e88381ccfe3fcbd8a29fb9f437846170c6f33 /sc
parente57e81ad89cf6271ee55fae077290c3f65bb5afc (diff)
Add call to import ODF styles when spreadsheet is created or loaded
Change-Id: If2f6843337f554829a321cfbe0b7dfdba90dca48
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/docshell/docsh.cxx10
-rw-r--r--sc/source/ui/docshell/docsh2.cxx11
2 files changed, 21 insertions, 0 deletions
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index dadb9c5c22d4..c36489663afb 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -109,6 +109,8 @@
#include "docshimp.hxx"
#include "sizedev.hxx"
#include "refreshtimerprotector.hxx"
+#include <orcus/orcus_import_ods.hpp>
+#include <orcusfiltersimpl.hxx>
#include <officecfg/Office/Calc.hxx>
#include <comphelper/processfactory.hxx>
@@ -586,6 +588,14 @@ bool ScDocShell::Load( SfxMedium& rMedium )
aDocument.GetStyleSheetPool()->CreateStandardStyles();
aDocument.UpdStlShtPtrsFrmNms();
+ /* Create styles that are imported through Orcus */
+
+ OUString aFileName = "styles.xml";
+ ScOrcusFilters* pOrcus = ScFormatFilter::Get().GetOrcusFilters();
+ if (!pOrcus)
+ return false;
+ pOrcus->importODS_Styles(aDocument, aFileName);
+
bRet = LoadXML( &rMedium, nullptr );
}
}
diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx
index d4b2cdf7975c..04989b092810 100644
--- a/sc/source/ui/docshell/docsh2.cxx
+++ b/sc/source/ui/docshell/docsh2.cxx
@@ -22,6 +22,8 @@
#include <svl/asiancfg.hxx>
#include <editeng/forbiddencharacterstable.hxx>
#include <editeng/unolingu.hxx>
+#include <orcus/orcus_import_ods.hpp>
+#include <orcusfiltersimpl.hxx>
#include "drwlayer.hxx"
#include "stlpool.hxx"
@@ -29,6 +31,7 @@
#include "docshimp.hxx"
#include "docfunc.hxx"
#include "sc.hrc"
+#include "filter.hxx"
using namespace com::sun::star;
@@ -53,6 +56,14 @@ bool ScDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
aDocument.GetStyleSheetPool()->CreateStandardStyles();
aDocument.UpdStlShtPtrsFrmNms();
+ /* Create styles that are imported through Orcus */
+
+ OUString aFileName = "styles.xml";
+ ScOrcusFilters* pOrcus = ScFormatFilter::Get().GetOrcusFilters();
+ if (!pOrcus)
+ return false;
+ pOrcus->importODS_Styles(aDocument, aFileName);
+
// SetDocumentModified is not allowed anymore in Load/InitNew!
InitItems();
CalcOutputFactor();