summaryrefslogtreecommitdiff
path: root/sc/source/ui/docshell/impex.cxx
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-09-22 23:50:57 +0200
committerEike Rathke <erack@redhat.com>2016-09-22 23:53:55 +0200
commit854254c36f4c4804bb5c8fcde2edef444baed25c (patch)
tree89c4c13c6e14cd1ab0e0ca01abf6722aaec8d3d1 /sc/source/ui/docshell/impex.cxx
parent853a63997aaae1e54b638432b1b1391c070f4e2b (diff)
attempt to fix build, ScImportExport( ScDocument*, const OUString& )
... is not unused but only in ifdef _WIN32 commit c4cd079b8f613084a99a83b95c3968b65cbd8900 Date: Thu Sep 22 15:08:42 2016 +0200 loplugin:unusedmethods in sc..vcl Change-Id: I36c8d57fddfffe8c99cf40ae514270f445388d08
Diffstat (limited to 'sc/source/ui/docshell/impex.cxx')
-rw-r--r--sc/source/ui/docshell/impex.cxx43
1 files changed, 43 insertions, 0 deletions
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 930c7942d4b4..85efd9ab8219 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -136,6 +136,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( dynamic_cast< ScDocShell* >(p->GetDocumentShell()) ), pDoc( p ),
+ nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ),
+ bFormulas( false ), bIncludeFiltered( true ),
+ bAll( false ), bSingle( true ), bUndo( pDocSh != nullptr ),
+ bOverflowRow( false ), bOverflowCol( false ), bOverflowCell( false ),
+ mbApi( true ), mbImportBroadcast(false), mbOverwriting( false ),
+ mExportTextOptions()
+{
+ pUndoDoc = nullptr;
+ pExtOptions = nullptr;
+
+ 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( ScRangeData::Type::RefArea )
+ || pData->HasType( ScRangeData::Type::AbsArea )
+ || pData->HasType( ScRangeData::Type::AbsPos ) )
+ {
+ pData->GetSymbol(aPos);
+ }
+ }
+ }
+ formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
+ // Range?
+ if (aRange.Parse(aPos, pDoc, eConv) & ScRefFlags::VALID)
+ bSingle = false;
+ // Cell?
+ else if (aRange.aStart.Parse(aPos, pDoc, eConv) & ScRefFlags::VALID)
+ aRange.aEnd = aRange.aStart;
+ else
+ bAll = true;
+}
+
ScImportExport::~ScImportExport()
{
delete pUndoDoc;