[Libreoffice-commits] core.git: sc/source

Markus Mohrhard markus.mohrhard at googlemail.com
Tue Feb 3 03:37:56 PST 2015


 sc/source/ui/docshell/impex.cxx |   43 ++++++++++++++++++++++++++++++++++++++++
 sc/source/ui/inc/impex.hxx      |    1 
 2 files changed, 44 insertions(+)

New commits:
commit d4bfe4634cdbd3769835a700943675c5fa132be7
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Feb 3 12:37:13 2015 +0100

    try to fix the build

diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 7ba8487..2df60d6 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 256c224..8be2cbc1 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();


More information about the Libreoffice-commits mailing list