Kaydet (Commit) 158b5076 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

use XL_A1 as ref string syntax for excel produced documents

Change-Id: Ieed3521674ef713d9c09313cd41d1edd6ba3dcc5
üst c43a25a7
......@@ -2160,7 +2160,7 @@ public:
SC_DLLPUBLIC void DumpAreaBroadcasters() const;
#endif
void SetCalcConfig( const ScCalcConfig& rConfig );
SC_DLLPUBLIC void SetCalcConfig( const ScCalcConfig& rConfig );
const ScCalcConfig& GetCalcConfig() const { return maCalcConfig; }
void ConvertFormulaToValue( const ScRange& rRange, sc::TableValues* pUndo );
......
......@@ -34,6 +34,8 @@
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/table/CellAddress.hpp>
#include <com/sun/star/container/XNamed.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <osl/thread.h>
#include <oox/helper/progressbar.hxx>
#include <oox/helper/propertyset.hxx>
......@@ -521,6 +523,18 @@ void WorkbookGlobals::useInternalChartDataTable( bool bInternal )
// private --------------------------------------------------------------------
namespace {
formula::FormulaGrammar::AddressConvention getConvention(css::uno::Reference<XDocumentProperties> xDocProps)
{
if (xDocProps->getGenerator().startsWithIgnoreAsciiCase("Microsoft"))
return formula::FormulaGrammar::CONV_XL_A1;
return formula::FormulaGrammar::CONV_OOO;
}
}
void WorkbookGlobals::initialize( bool bWorkbookFile )
{
maCellStyles = "CellStyles";
......@@ -548,6 +562,12 @@ void WorkbookGlobals::initialize( bool bWorkbookFile )
if (!mpDoc)
throw RuntimeException("Workbookhelper::getScDocument(): Failed to access ScDocument from model");
Reference< XDocumentPropertiesSupplier > xPropSupplier( mxDoc, UNO_QUERY);
Reference< XDocumentProperties > xDocProps = xPropSupplier->getDocumentProperties();
ScCalcConfig aCalcConfig = mpDoc->GetCalcConfig();
aCalcConfig.meStringRefAddressSyntax = getConvention(xDocProps);
mpDoc->SetCalcConfig(aCalcConfig);
mxDocImport.reset(new ScDocumentImport(*mpDoc));
mxFormulaBuffer.reset( new FormulaBuffer( *this ) );
......
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