[Libreoffice-commits] core.git: Branch 'aoo/trunk' - sc/inc sc/source

Armin Le Grand alg at apache.org
Wed Jun 12 03:07:24 PDT 2013


 sc/inc/document.hxx               |    7 +++++++
 sc/source/core/data/documen2.cxx  |    1 +
 sc/source/ui/docshell/docsh.cxx   |    7 +++++++
 sc/source/ui/unoobj/chart2uno.cxx |   11 ++++++++++-
 4 files changed, 25 insertions(+), 1 deletion(-)

New commits:
commit f3fc172d21f772035e412e3e47f039cad4a80a19
Author: Armin Le Grand <alg at apache.org>
Date:   Wed Jun 12 09:50:11 2013 +0000

    i118840 Make it possible to identify temporary calc docs and use it to not access inexistent data

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 3a5b018..025c322 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -435,6 +435,9 @@ private:
     bool                mbChangeReadOnlyEnabled;    // allow changes in read-only document (for API import filters)
     bool                mbStreamValidLocked;
 
+    // #118840# Have a flag to know that this ScDocument is used temporary
+    bool                mbIsTemporary : 1;
+
     sal_Int16           mnNamedRangesLockCount;
 
 public:
@@ -611,6 +614,10 @@ public:
     void            SetStreamValid( SCTAB nTab, sal_Bool bSet, sal_Bool bIgnoreLock = sal_False );
     void            LockStreamValid( bool bLock );
     bool            IsStreamValidLocked() const                         { return mbStreamValidLocked; }
+
+    // #118840# Have a flag to know that this ScDocument is used temporary
+    bool IsTemporary() const { return mbIsTemporary; }
+
     SC_DLLPUBLIC sal_Bool        IsPendingRowHeights( SCTAB nTab ) const;
     SC_DLLPUBLIC void            SetPendingRowHeights( SCTAB nTab, sal_Bool bSet );
     SC_DLLPUBLIC void           SetLayoutRTL( SCTAB nTab, sal_Bool bRTL );
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 1731860..85c9ca6 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -215,6 +215,7 @@ ScDocument::ScDocument( ScDocumentMode  eMode,
         mbExecuteLinkEnabled( true ),
         mbChangeReadOnlyEnabled( false ),
         mbStreamValidLocked( false ),
+        mbIsTemporary(false), // #118840#
         mnNamedRangesLockCount( 0 )
 {
     SetStorageGrammar( formula::FormulaGrammar::GRAM_STORAGE_DEFAULT);
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index dee9214..c81a9b7 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2589,6 +2589,13 @@ ScDocShell::ScDocShell( const sal_uInt64 i_nSfxCreationFlags )
     bIsInplace = (GetCreateMode() == SFX_CREATE_MODE_EMBEDDED);
     //  wird zurueckgesetzt, wenn nicht inplace
 
+    // #118840# set flag at ScDocument that it is used temporary (e.g. inplace
+    // for transporting a chart over the clipboard)
+    if(bIsInplace)
+    {
+        aDocument.mbIsTemporary = true;
+    }
+
     pDocFunc = new ScDocFunc(*this);
 
     //  SetBaseModel needs exception handling
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index a4d923b..105cf9b 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -2176,7 +2176,16 @@ rtl::OUString SAL_CALL ScChart2DataProvider::convertRangeFromXML( const rtl::OUS
     }
 
     OUString aRet;
-    ScRangeStringConverter::GetStringFromXMLRangeString(aRet, sXMLRange, m_pDocument);
+
+    // #118840# Only interpret range string when the ScDocument is not just used
+    // temporary (e.g. for transporting a chart over the clipboard). In that case, the local
+    // cell data would be invalid; despite the fact that a 'Sheet1' exists (just because
+    // it's the default)
+    if(!m_pDocument->IsTemporary())
+    {
+        ScRangeStringConverter::GetStringFromXMLRangeString(aRet, sXMLRange, m_pDocument);
+    }
+
     return aRet;
 }
 


More information about the Libreoffice-commits mailing list