From d4bfe4634cdbd3769835a700943675c5fa132be7 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Tue, 3 Feb 2015 12:37:13 +0100 Subject: try to fix the build --- sc/source/ui/docshell/impex.cxx | 43 +++++++++++++++++++++++++++++++++++++++++ sc/source/ui/inc/impex.hxx | 1 + 2 files changed, 44 insertions(+) diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index 7ba8487d058c..2df60d661e25 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -125,6 +125,49 @@ ScImportExport::ScImportExport( ScDocument* p, const ScRange& r ) aRange.aEnd.SetTab( aRange.aStart.Tab() ); } +// Evaluate input string - either range, cell or the whole document (when error) +// If a View exists, the TabNo of the view will be used. +ScImportExport::ScImportExport( ScDocument* p, const OUString& rPos ) + : pDocSh( PTR_CAST(ScDocShell,p->GetDocumentShell()) ), pDoc( p ), + nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ), + bFormulas( false ), bIncludeFiltered( true ), + bAll( false ), bSingle( true ), bUndo( pDocSh != NULL ), + bOverflowRow( false ), bOverflowCol( false ), bOverflowCell( false ), + mbApi( true ), mbImportBroadcast(false), mbOverwriting( false ), + mExportTextOptions() +{ + pUndoDoc = NULL; + pExtOptions = NULL; + + SCTAB nTab = ScDocShell::GetCurTab(); + aRange.aStart.SetTab( nTab ); + OUString aPos( rPos ); + // Named range? + ScRangeName* pRange = pDoc->GetRangeName(); + if (pRange) + { + const ScRangeData* pData = pRange->findByUpperName(ScGlobal::pCharClass->uppercase(aPos)); + if (pData) + { + if( pData->HasType( RT_REFAREA ) + || pData->HasType( RT_ABSAREA ) + || pData->HasType( RT_ABSPOS ) ) + { + pData->GetSymbol(aPos); + } + } + } + formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention(); + // Range? + if (aRange.Parse(aPos, pDoc, eConv) & SCA_VALID) + bSingle = false; + // Cell? + else if (aRange.aStart.Parse(aPos, pDoc, eConv) & SCA_VALID) + aRange.aEnd = aRange.aStart; + else + bAll = true; +} + ScImportExport::~ScImportExport() { delete pUndoDoc; diff --git a/sc/source/ui/inc/impex.hxx b/sc/source/ui/inc/impex.hxx index 256c224a4846..8be2cbc1e71b 100644 --- a/sc/source/ui/inc/impex.hxx +++ b/sc/source/ui/inc/impex.hxx @@ -90,6 +90,7 @@ class ScImportExport public: ScImportExport( ScDocument* ); // the whole document + ScImportExport( ScDocument*, const OUString& ); // Range/cell input ScImportExport( ScDocument*, const ScAddress& ); ScImportExport( ScDocument*, const ScRange& ); ~ScImportExport(); -- cgit