Kaydet (Commit) 53ece992 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

place the calc default style file in the share folder

Change-Id: I1b8bfee1abf82c5a55cbfc5c1674b115cdfe63b8
üst 1c54582a
......@@ -9,7 +9,7 @@
$(eval $(call gb_Package_Package,sc_res_xml,$(SRCDIR)/sc/res/xml))
$(eval $(call gb_Package_add_files,sc_res_xml,$(LIBO_BIN_FOLDER),\
$(eval $(call gb_Package_add_files,sc_res_xml,$(LIBO_SHARE_FOLDER)/calc,\
styles.xml \
))
......
......@@ -39,6 +39,7 @@
#include <svl/documentlockfile.hxx>
#include <svl/sharecontrolfile.hxx>
#include <svl/urihelper.hxx>
#include <osl/file.hxx>
#include "chgtrack.hxx"
#include "chgviset.hxx"
#include <com/sun/star/awt/Key.hpp>
......@@ -62,6 +63,8 @@
#include <com/sun/star/frame/XStorable2.hpp>
#include <com/sun/star/frame/Desktop.hpp>
#include <config_folders.h>
#include "scabstdlg.hxx"
#include <sot/formats.hxx>
......@@ -590,29 +593,21 @@ bool ScDocShell::Load( SfxMedium& rMedium )
aDocument.GetStyleSheetPool()->CreateStandardStyles();
aDocument.UpdStlShtPtrsFrmNms();
#if ENABLE_ORCUS
#if ENABLE_ORCUS
/* Create styles that are imported through Orcus */
OUString aPath("$BRAND_BASE_DIR/"); /* Read the comment below before changing this */
rtl::Bootstrap::expandMacros(aPath);
OUString aValidPath;
/* The Following loop trims 'file://' from start of string and
* '../' from the end of string. If you ever happen to change the above macro
* please consider changing the following range too, otherwise app would
* crash!!
*/
for (sal_Int32 i = 7; i < aPath.getLength() - 3; ++i)
aValidPath += OUString(aPath[i]);
OUString aURL("$BRAND_BASE_DIR" LIBO_SHARE_FOLDER "/calc/styles.xml");
rtl::Bootstrap::expandMacros(aURL);
OUString aFileName = "styles.xml";
aValidPath += aFileName;
OUString aPath;
osl::FileBase::getSystemPathFromFileURL(aURL, aPath);
ScOrcusFilters* pOrcus = ScFormatFilter::Get().GetOrcusFilters();
if (!pOrcus)
return false;
pOrcus->importODS_Styles(aDocument, aValidPath);
#endif
pOrcus->importODS_Styles(aDocument, aPath);
#endif
bRet = LoadXML( &rMedium, nullptr );
}
......
......@@ -19,6 +19,7 @@
#include "scitems.hxx"
#include <rtl/bootstrap.hxx>
#include <osl/file.hxx>
#include <svx/drawitem.hxx>
#include <svl/asiancfg.hxx>
#include <editeng/forbiddencharacterstable.hxx>
......@@ -26,6 +27,7 @@
#include <orcus/orcus_import_ods.hpp>
#include <orcusfiltersimpl.hxx>
#include <config_orcus.h>
#include <config_folders.h>
#include "drwlayer.hxx"
#include "stlpool.hxx"
......@@ -58,29 +60,20 @@ bool ScDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
aDocument.GetStyleSheetPool()->CreateStandardStyles();
aDocument.UpdStlShtPtrsFrmNms();
#if ENABLE_ORCUS
#if ENABLE_ORCUS
/* Create styles that are imported through Orcus */
OUString aPath("$BRAND_BASE_DIR/"); /* Read the comment below before changing this */
rtl::Bootstrap::expandMacros(aPath);
OUString aValidPath;
OUString aURL("$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER "/calc/styles.xml");
rtl::Bootstrap::expandMacros(aURL);
/* The Following loop trims 'file://' from start of string and
* '../' from the end of string. If you ever happen to change the above macro
* please consider changing the following range too, otherwise app would
* crash!!
*/
for (sal_Int32 i = 7; i < aPath.getLength() - 3; ++i)
aValidPath += OUString(aPath[i]);
OUString aFileName = "styles.xml";
aValidPath += aFileName;
OUString aPath;
osl::FileBase::getSystemPathFromFileURL(aURL, aPath);
ScOrcusFilters* pOrcus = ScFormatFilter::Get().GetOrcusFilters();
if (!pOrcus)
return false;
pOrcus->importODS_Styles(aDocument, aValidPath);
#endif
pOrcus->importODS_Styles(aDocument, aPath);
#endif
// SetDocumentModified is not allowed anymore in Load/InitNew!
InitItems();
......
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