Kaydet (Commit) 57f71f19 authored tarafından Jaskaran Singh's avatar Jaskaran Singh Kaydeden (comit) Markus Mohrhard

Add call to import ODF styles when spreadsheet is created or loaded

Change-Id: If2f6843337f554829a321cfbe0b7dfdba90dca48
üst e57e81ad
...@@ -109,6 +109,8 @@ ...@@ -109,6 +109,8 @@
#include "docshimp.hxx" #include "docshimp.hxx"
#include "sizedev.hxx" #include "sizedev.hxx"
#include "refreshtimerprotector.hxx" #include "refreshtimerprotector.hxx"
#include <orcus/orcus_import_ods.hpp>
#include <orcusfiltersimpl.hxx>
#include <officecfg/Office/Calc.hxx> #include <officecfg/Office/Calc.hxx>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
...@@ -586,6 +588,14 @@ bool ScDocShell::Load( SfxMedium& rMedium ) ...@@ -586,6 +588,14 @@ bool ScDocShell::Load( SfxMedium& rMedium )
aDocument.GetStyleSheetPool()->CreateStandardStyles(); aDocument.GetStyleSheetPool()->CreateStandardStyles();
aDocument.UpdStlShtPtrsFrmNms(); 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 ); bRet = LoadXML( &rMedium, nullptr );
} }
} }
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
#include <svl/asiancfg.hxx> #include <svl/asiancfg.hxx>
#include <editeng/forbiddencharacterstable.hxx> #include <editeng/forbiddencharacterstable.hxx>
#include <editeng/unolingu.hxx> #include <editeng/unolingu.hxx>
#include <orcus/orcus_import_ods.hpp>
#include <orcusfiltersimpl.hxx>
#include "drwlayer.hxx" #include "drwlayer.hxx"
#include "stlpool.hxx" #include "stlpool.hxx"
...@@ -29,6 +31,7 @@ ...@@ -29,6 +31,7 @@
#include "docshimp.hxx" #include "docshimp.hxx"
#include "docfunc.hxx" #include "docfunc.hxx"
#include "sc.hrc" #include "sc.hrc"
#include "filter.hxx"
using namespace com::sun::star; using namespace com::sun::star;
...@@ -53,6 +56,14 @@ bool ScDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) ...@@ -53,6 +56,14 @@ bool ScDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
aDocument.GetStyleSheetPool()->CreateStandardStyles(); aDocument.GetStyleSheetPool()->CreateStandardStyles();
aDocument.UpdStlShtPtrsFrmNms(); 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! // SetDocumentModified is not allowed anymore in Load/InitNew!
InitItems(); InitItems();
CalcOutputFactor(); CalcOutputFactor();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment