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

Eike Rathke erack at redhat.com
Thu Sep 22 21:55:54 UTC 2016


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

New commits:
commit 854254c36f4c4804bb5c8fcde2edef444baed25c
Author: Eike Rathke <erack at redhat.com>
Date:   Thu Sep 22 23:50:57 2016 +0200

    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

diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 930c794..85efd9a 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;
diff --git a/sc/source/ui/inc/impex.hxx b/sc/source/ui/inc/impex.hxx
index b5b69f6..b0be3ef 100644
--- a/sc/source/ui/inc/impex.hxx
+++ b/sc/source/ui/inc/impex.hxx
@@ -89,6 +89,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