[Libreoffice-commits] .: 24 commits - sc/source

Jan Holesovsky kendy at kemper.freedesktop.org
Thu Jul 28 09:40:41 PDT 2011


 sc/source/core/data/table1.cxx |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit 44ba93cbad6ef271d32991cac40988763b99dee2
Merge: e668a2e... bd43eae...
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Thu Jul 28 18:37:15 2011 +0200

    Merge branch 'master' of git://anongit.freedesktop.org/libreoffice/calc

commit e668a2e66e5325835010e2c7ed9266438b774dab
Merge: c5cea38... 4d03f29...
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Thu Jul 28 18:34:35 2011 +0200

    Merge commit 'libreoffice-3.4.2.3'
    
    Conflicts:
    	sc/source/filter/excel/xestream.cxx
    	sc/source/filter/excel/xiname.cxx

diff --cc sc/source/core/data/table1.cxx
index d316b49,b755bdf..2bfc88d
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@@ -1412,11 -1414,11 +1412,14 @@@ void ScTable::UpdateInsertTab(SCTAB nTa
          if (pDBDataNoName)
              pDBDataNoName->UpdateMoveTab(nTab - 1 ,nTab);
      }
 -    for (SCCOL i=0; i <= MAXCOL; i++) aCol[i].UpdateInsertTab(nTable);
 +    for (SCCOL i=0; i <= MAXCOL; i++) aCol[i].UpdateInsertTab(nTable, nNewSheets);
 +
 +    if (mpRangeName)
 +        mpRangeName->UpdateTabRef( nTable, 1, 0, nNewSheets);
  
+     if (mpRangeName)
+         mpRangeName->UpdateTabRef( nTable, 1);
+ 
      if (IsStreamValid())
          SetStreamValid(false);
  }
@@@ -1432,18 -1434,15 +1435,23 @@@ void ScTable::UpdateDeleteTab( SCTAB nT
  
      SCCOL i;
      if (pRefUndo)
 -        for (i=0; i <= MAXCOL; i++) aCol[i].UpdateDeleteTab(nTable, bIsMove, &pRefUndo->aCol[i]);
 +        for (i=0; i <= MAXCOL; i++) aCol[i].UpdateDeleteTab(nTable, bIsMove, &pRefUndo->aCol[i], nSheets);
      else
 -        for (i=0; i <= MAXCOL; i++) aCol[i].UpdateDeleteTab(nTable, bIsMove, NULL);
 +        for (i=0; i <= MAXCOL; i++) aCol[i].UpdateDeleteTab(nTable, bIsMove, NULL, nSheets);
 +
 +    if (mpRangeName)
 +    {
 +        for (SCTAB aTab = 0; aTab < nSheets; ++aTab)
 +        {
 +            mpRangeName->UpdateTabRef( nTable + aTab, 2 );
 +        }
 +    }
  
+     if (mpRangeName)
+     {
+         mpRangeName->UpdateTabRef( nTable, 2 );
+     }
+ 
      if (IsStreamValid())
          SetStreamValid(false);
  }
commit 4d03f2946e938ca594ffc92e89548223546726c2
Author: Petr Mladek <pmladek at suse.cz>
Date:   Mon Jul 25 20:28:41 2011 +0200

    Version 3.4.2.3, tag libreoffice-3.4.2.3 (3.4.2-rc3)
commit 31b9a3667b8e5a989bc17b8b50473e1dd5880b61
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Mon Jul 25 10:21:01 2011 -0400

    fdo#39236: Better way to remove DP objects without reversing order.
    
    The old fix reversed the order of the elements even when no elements
    were deleted.  This is better & cleaner.  Thanks to David Tardon for
    suggesting me this.
    
    Signed-off-by: Michael Meeks <michael.meeks at novell.com>
    Signed-off-by: Petr Mladek <pmladek at suse.cz>
    Signed-off-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 3aa7477..d87629a 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -83,6 +83,7 @@
 
 using namespace com::sun::star;
 using ::std::vector;
+using ::std::unary_function;
 using ::boost::shared_ptr;
 using ::com::sun::star::uno::Sequence;
 using ::com::sun::star::uno::Reference;
@@ -2554,6 +2555,25 @@ ScDPCollection::~ScDPCollection()
     maTables.clear();
 }
 
+namespace {
+
+/**
+ * Unary predicate to match DP objects by the table ID.
+ */
+class MatchByTable : public unary_function<ScDPObject, bool>
+{
+    SCTAB mnTab;
+public:
+    MatchByTable(SCTAB nTab) : mnTab(nTab) {}
+
+    bool operator() (const ScDPObject& rObj) const
+    {
+        return rObj.GetOutRange().aStart.Tab() == mnTab;
+    }
+};
+
+}
+
 bool ScDPCollection::ClearCache(ScDPObject* pDPObj)
 {
     if (pDPObj->IsSheetData())
@@ -2591,15 +2611,7 @@ bool ScDPCollection::ClearCache(ScDPObject* pDPObj)
 
 void ScDPCollection::DeleteOnTab( SCTAB nTab )
 {
-    TablesType aNewTables;
-    while (!maTables.empty())
-    {
-        TablesType::auto_type xDP = maTables.pop_back();
-        if (xDP->GetOutRange().aStart.Tab() != nTab)
-            // Not on this sheet.  Keep it.
-            aNewTables.push_back(xDP.release());
-    }
-    maTables.swap(aNewTables);
+    maTables.erase_if(MatchByTable(nTab));
 }
 
 void ScDPCollection::UpdateReference( UpdateRefMode eUpdateRefMode,
commit b061f53aafad796b68278194c3eab08613f34142
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Tue Jul 19 14:46:50 2011 -0400

    fdo#39236: Prevent double-deletes during removal of pivot tables.
    
    In short, don't use erase remove(_if) idiom to remove objects from
    boost ptr containers which would cause double deletes because of
    the way remove-like algorithms work.  STL's remove-like algorithms
    create duplicates of the elements instead of re-ordering them by
    design, and this obviously doesn't work well with containers
    containing pointers.
    
    IMPORTANT: this will get a better incremental fix
    
    Signed-off-by: David Tardon <dtardon at redhat.com>
    Signed-off-by: Petr Mladek <pmladek at suse.cz>
    Signed-off-by: Michael Meeks <michael.meeks at novell.com>
    Signed-off-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 4426763..3aa7477 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -83,8 +83,6 @@
 
 using namespace com::sun::star;
 using ::std::vector;
-using ::std::unary_function;
-using ::std::remove_if;
 using ::boost::shared_ptr;
 using ::com::sun::star::uno::Sequence;
 using ::com::sun::star::uno::Reference;
@@ -2556,25 +2554,6 @@ ScDPCollection::~ScDPCollection()
     maTables.clear();
 }
 
-namespace {
-
-/**
- * Unary predicate to match DP objects by the table ID.
- */
-class MatchByTable : public unary_function<bool, ScDPObject>
-{
-    SCTAB mnTab;
-public:
-    MatchByTable(SCTAB nTab) : mnTab(nTab) {}
-
-    bool operator() (const ScDPObject& rObj) const
-    {
-        return rObj.GetOutRange().aStart.Tab() == mnTab;
-    }
-};
-
-}
-
 bool ScDPCollection::ClearCache(ScDPObject* pDPObj)
 {
     if (pDPObj->IsSheetData())
@@ -2612,9 +2591,15 @@ bool ScDPCollection::ClearCache(ScDPObject* pDPObj)
 
 void ScDPCollection::DeleteOnTab( SCTAB nTab )
 {
-    maTables.erase(
-        remove_if(maTables.begin(), maTables.end(), MatchByTable(nTab)),
-        maTables.end());
+    TablesType aNewTables;
+    while (!maTables.empty())
+    {
+        TablesType::auto_type xDP = maTables.pop_back();
+        if (xDP->GetOutRange().aStart.Tab() != nTab)
+            // Not on this sheet.  Keep it.
+            aNewTables.push_back(xDP.release());
+    }
+    maTables.swap(aNewTables);
 }
 
 void ScDPCollection::UpdateReference( UpdateRefMode eUpdateRefMode,
commit 71dc55fcd837c3578d6d5d9d4a68f1523e5b5a1a
Author: Petr Mladek <pmladek at suse.cz>
Date:   Thu Jul 21 14:16:11 2011 +0200

    Version 3.4.2.2, tag libreoffice-3.4.2.2-buildfix1 (3.4.2-rc2)
commit 4ef89b3893e7fbe159799e627aefb0fe1cf9c6bc
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date:   Thu Jul 21 09:23:19 2011 +0200

    Avoid confusion with our windows api clash prevention
    
    (cherry picked from commit a027bee4bb2565f14eb70c4325592b23a86c007a)
    
    Signed-off-by: Tor Lillqvist <tlillqvist at novell.com>
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>
    Signed-off-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 835f085..56efc6c 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -88,6 +88,13 @@
 #include <iostream>
 #include <vector>
 
+#ifdef WNT
+#define NOMINMAX
+#include <prewin.h>
+#include <postwin.h>
+#undef NOMINMAX
+#endif
+
 #define MDDS_HASH_CONTAINER_BOOST 1
 #include <mdds/mixed_type_matrix.hpp>
 
commit 5c81236146cc24b3ae942f4be4c1c7159313f441
Author: Petr Mladek <pmladek at suse.cz>
Date:   Tue Jul 19 17:07:57 2011 +0200

    Version 3.4.2.2, tag libreoffice-3.4.2.2 (3.4.2-rc2)
commit f325aecc07990198bf87943f3c59a4bfc1aa1ea6
Author: Muthu Subramanian <sumuthu at novell.com>
Date:   Mon Jun 6 18:56:54 2011 +0530

    Out-of-bounds array access fix. (Thanks to Fridrich too).
    
    Signed-off-by: Fridrich Å trba <fridrich.strba at bluewin.ch>
    Signed-off-by: Michael Meeks <michael.meeks at novell.com>
    Signed-off-by: David Tardon <dtardon at redhat.com>

diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index 319dfe1..5108c3c 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -861,10 +861,10 @@ OUString XclXmlUtils::ToOUString( const char* s )
 
 OUString XclXmlUtils::ToOUString( const ScfUInt16Vec& rBuf, sal_Int32 nStart, sal_Int32 nLength )
 {
-    if( nLength == -1 )
-        nLength = rBuf.size();
+    if( nLength == -1 || ( nLength > (rBuf.size() - nStart) ) )
+        nLength = (rBuf.size() - nStart);
 
-    return OUString( &rBuf[nStart], nLength );
+    return (nLength > 0) ? OUString( &rBuf[nStart], nLength ) : OUString();
 }
 
 OUString XclXmlUtils::ToOUString( const String& s )
commit a7e403a590146a80e1c44c3c56ebf974801f5b87
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Thu Jul 14 18:38:16 2011 -0400

    fdo#37767: Fix broken refresh() from UNO API (and Basic).
    
    We now need to clear the cache before running DataPilotUpdate() in
    order to re-populate the cache from the source data.
    
    Signed-off-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Signed-off-by: Michael Meeks <michael.meeks at novell.com>

diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx
index 510f308..87fb78e 100644
--- a/sc/inc/dpobject.hxx
+++ b/sc/inc/dpobject.hxx
@@ -322,6 +322,8 @@ public:
     ScDPCollection(const ScDPCollection& r);
     ~ScDPCollection();
 
+    bool ClearCache(ScDPObject* pDPObj);
+
     SC_DLLPUBLIC size_t GetCount() const;
     SC_DLLPUBLIC ScDPObject* operator[](size_t nIndex);
     SC_DLLPUBLIC const ScDPObject* operator[](size_t nIndex) const;
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 93bfebb..4426763 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -2575,6 +2575,41 @@ public:
 
 }
 
+bool ScDPCollection::ClearCache(ScDPObject* pDPObj)
+{
+    if (pDPObj->IsSheetData())
+    {
+        // data source is internal sheet.
+        const ScSheetSourceDesc* pDesc = pDPObj->GetSheetDesc();
+        if (!pDesc)
+            return false;
+
+        if (pDesc->HasRangeName())
+        {
+            // cache by named range
+            ScDPCollection::NameCaches& rCaches = GetNameCaches();
+            rCaches.removeCache(pDesc->GetRangeName());
+        }
+        else
+        {
+            // cache by cell range
+            ScDPCollection::SheetCaches& rCaches = GetSheetCaches();
+            rCaches.removeCache(pDesc->GetSourceRange());
+        }
+    }
+    else if (pDPObj->IsImportData())
+    {
+        // data source is external database.
+        const ScImportSourceDesc* pDesc = pDPObj->GetImportSourceDesc();
+        if (!pDesc)
+            return false;
+
+        ScDPCollection::DBCaches& rCaches = GetDBCaches();
+        rCaches.removeCache(pDesc->GetCommandType(), pDesc->aDBName, pDesc->aObject);
+    }
+    return true;
+}
+
 void ScDPCollection::DeleteOnTab( SCTAB nTab )
 {
     maTables.erase(
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index 9095d6e..e1e2877 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -1282,10 +1282,9 @@ void SAL_CALL ScDataPilotTableObj::refresh() throw(RuntimeException)
     ScDPObject* pDPObj = lcl_GetDPObject(GetDocShell(), nTab, aName);
     if (pDPObj)
     {
-        ScDPObject* pNew = new ScDPObject(*pDPObj);
         ScDBDocFunc aFunc(*GetDocShell());
-        aFunc.DataPilotUpdate( pDPObj, pNew, true, true );
-        delete pNew;		// DataPilotUpdate copies settings from "new" object
+        GetDocShell()->GetDocument()->GetDPCollection()->ClearCache(pDPObj);
+        aFunc.DataPilotUpdate( pDPObj, pDPObj, true, true );
     }
 }
 
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index 5f427a8..c01a85b 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -707,37 +707,10 @@ void ScDBFunc::RecalcPivotTable()
     {
         // Remove existing data cache for the data that this datapilot uses,
         // to force re-build data cache.
-        if (pDPObj->IsSheetData())
+        if (!pDPs->ClearCache(pDPObj))
         {
-            // data source is internal sheet.
-            const ScSheetSourceDesc* pDesc = pDPObj->GetSheetDesc();
-            if (!pDesc)
-            {
-                ErrorMessage(STR_PIVOT_NOTFOUND);
-                return;
-            }
-            if (pDesc->HasRangeName())
-            {
-                ScDPCollection::NameCaches& rCaches = pDPs->GetNameCaches();
-                rCaches.removeCache(pDesc->GetRangeName());
-            }
-            else
-            {
-                ScDPCollection::SheetCaches& rCaches = pDPs->GetSheetCaches();
-                rCaches.removeCache(pDesc->GetSourceRange());
-            }
-        }
-        else if (pDPObj->IsImportData())
-        {
-            // data source is external database.
-            const ScImportSourceDesc* pDesc = pDPObj->GetImportSourceDesc();
-            if (!pDesc)
-            {
-                ErrorMessage(STR_PIVOT_NOTFOUND);
-                return;
-            }
-            ScDPCollection::DBCaches& rCaches = pDPs->GetDBCaches();
-            rCaches.removeCache(pDesc->GetCommandType(), pDesc->aDBName, pDesc->aObject);
+            ErrorMessage(STR_PIVOT_NOTFOUND);
+            return;
         }
 
         ScDBDocFunc aFunc( *pDocSh );
commit 8f7e08c1349a3e3737de36110aac22dd7494d816
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Thu Jul 14 13:03:04 2011 -0400

    fdo#36688: Make sure the drawing layer is initialized before use.
    
    From how it's used, it appears to be the convention to call
    InitDrawLayer() before getting the drawing layer pointer, to ensure
    that the drawing layer is present when needed.
    
    Signed-off-by: Noel Power <noel.power at novell.com>

diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index f37a2c8..ab698e4 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -1634,6 +1634,7 @@ void ScOutputData::DrawRotatedFrame( const Color* pForceColor )
 
 drawinglayer::processor2d::BaseProcessor2D* ScOutputData::CreateProcessor2D( )
 {
+    pDoc->InitDrawLayer(pDoc->GetDocumentShell());
     ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
     if (!pDrawLayer)
         return NULL;
commit 9ccbe796c993b01f9c26a69714a0970d639b6d14
Author: Petr Mladek <pmladek at suse.cz>
Date:   Tue Jul 12 16:41:08 2011 +0200

    Branch libreoffice-3-4-2
    
    This is 'libreoffice-3-4-2' - the stable branch for the 3.4.2 release.
    Only very safe changes, reviewed by three people are allowed.
    
    If you want to commit more complicated fix for the next 3.4.x release,
    please use the 'libreoffice-3-4' branch.
    
    If you want to build something cool, unstable, and risky, use master.
commit f26066e1697acb5edf1f0d84e1500f2a6c2901d5
Author: Petr Mladek <pmladek at suse.cz>
Date:   Tue Jul 12 15:49:38 2011 +0200

    Version 3.4.2.1, tag libreoffice-3.4.2.1 (3.4.2-rc1)
commit 4619e6a8cc6fba268ce46a94fad927a20c44613c
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Jun 22 15:47:21 2011 +0200

    fix for fdo#37880
    
    we need to save the information if we have a local range name or a
    global range name in the uno api too
    
    Signed-off-by: Kohei Yoshida <kyoshida at novell.com>

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 8e80819..0153ca4 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -57,6 +57,7 @@ using ::std::vector;
 #include <com/sun/star/sheet/ComplexReference.hpp>
 #include <com/sun/star/sheet/ExternalReference.hpp>
 #include <com/sun/star/sheet/ReferenceFlags.hpp>
+#include <com/sun/star/sheet/NameToken.hpp>
 
 using namespace formula;
 using namespace com::sun::star;
@@ -1175,6 +1176,13 @@ bool ScTokenArray::AddFormulaToken(const com::sun::star::sheet::FormulaToken& _a
                         else
                             bError = true;
                     }
+                    else if ( aType.equals( cppu::UnoType<sheet::NameToken>::get() ) )
+                    {
+                        sheet::NameToken aTokenData;
+                        _aToken.Data >>= aTokenData;
+                        if ( eOpCode == ocName )
+                            AddRangeName(aTokenData.Index, aTokenData.Global);
+                    }
                     else if ( aType.equals( cppu::UnoType<sheet::ExternalReference>::get() ) )
                     {
                         sheet::ExternalReference aApiExtRef;
diff --git a/sc/source/ui/unoobj/tokenuno.cxx b/sc/source/ui/unoobj/tokenuno.cxx
index 95e350c..5f89de8 100644
--- a/sc/source/ui/unoobj/tokenuno.cxx
+++ b/sc/source/ui/unoobj/tokenuno.cxx
@@ -37,6 +37,7 @@
 #include <com/sun/star/sheet/ExternalReference.hpp>
 #include <com/sun/star/sheet/ReferenceFlags.hpp>
 #include <com/sun/star/sheet/AddressConvention.hpp>
+#include <com/sun/star/sheet/NameToken.hpp>
 #include <com/sun/star/table/CellAddress.hpp>
 
 #include <svl/itemprop.hxx>
@@ -395,7 +396,12 @@ bool ScTokenConversion::ConvertToTokenSequence( ScDocument& rDoc,
                     }
                     break;
                 case svIndex:
-                    rAPI.Data <<= static_cast<sal_Int32>( rToken.GetIndex() );
+                    {
+                        sheet::NameToken aNameToken;
+                        aNameToken.Index = static_cast<sal_Int32>( rToken.GetIndex() );
+                        aNameToken.Global = static_cast<sal_Bool>( rToken.GetByte() );
+                        rAPI.Data <<= aNameToken;
+                    }
                     break;
                 case svMatrix:
                     if (!ScRangeToSequence::FillMixedArray( rAPI.Data, static_cast<const ScToken&>(rToken).GetMatrix(), true))
commit 4960acecc71a142ee25ee69cd842ac8cdaeb5b72
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed May 18 23:09:41 2011 +0000

    Make sure to only export up to 1026 manual page breaks to XLS.
    
    If you export even one excess page break than 1026, Excel refuses
    to load the whole document.
    
    Signed-off-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/source/filter/excel/xepage.cxx b/sc/source/filter/excel/xepage.cxx
index 47899eb..5ac8493 100644
--- a/sc/source/filter/excel/xepage.cxx
+++ b/sc/source/filter/excel/xepage.cxx
@@ -330,6 +330,14 @@ XclExpPageSettings::XclExpPageSettings( const XclExpRoot& rRoot ) :
         maData.maHorPageBreaks.push_back(nRow);
     }
 
+    if (maData.maHorPageBreaks.size() > 1026)
+    {
+        // Excel allows only up to 1026 page breaks.  Trim any excess page breaks.
+        ScfUInt16Vec::iterator itr = maData.maHorPageBreaks.begin();
+        ::std::advance(itr, 1026);
+        maData.maHorPageBreaks.erase(itr, maData.maHorPageBreaks.end());
+    }
+
     set<SCCOL> aColBreaks;
     rDoc.GetAllColBreaks(aColBreaks, nScTab, false, true);
     for (set<SCCOL>::const_iterator itr = aColBreaks.begin(), itrEnd = aColBreaks.end(); itr != itrEnd; ++itr)
commit 6da6e164f04b8110e9800378215d76ea4a51549c
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Thu Jun 30 05:44:00 2011 +0200

    fix for fdo#38380: update local range names
    
    local range names must be updated like global range names
    
    Signed-off-by: Katarina Machalkova <kmachalkova at novell.com>

diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 2927aa0..b755bdf 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -1303,6 +1303,12 @@ void ScTable::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW
         bUpdated |= aCol[i].UpdateReference(
             eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, nDx, nDy, nDz, pUndoDoc );
 
+    if (mpRangeName)
+    {
+        ScRange aRange( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );;
+        mpRangeName->UpdateReference( eUpdateRefMode, aRange, nDx, nDy, nDz );
+    }
+
     if ( bIncludeDraw )
         UpdateDrawRef( eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, nDx, nDy, nDz, bUpdateNoteCaptionPos );
 
@@ -1410,6 +1416,9 @@ void ScTable::UpdateInsertTab(SCTAB nTable)
     }
     for (SCCOL i=0; i <= MAXCOL; i++) aCol[i].UpdateInsertTab(nTable);
 
+    if (mpRangeName)
+        mpRangeName->UpdateTabRef( nTable, 1);
+
     if (IsStreamValid())
         SetStreamValid(false);
 }
@@ -1429,6 +1438,11 @@ void ScTable::UpdateDeleteTab( SCTAB nTable, sal_Bool bIsMove, ScTable* pRefUndo
     else
         for (i=0; i <= MAXCOL; i++) aCol[i].UpdateDeleteTab(nTable, bIsMove, NULL);
 
+    if (mpRangeName)
+    {
+        mpRangeName->UpdateTabRef( nTable, 2 );
+    }
+
     if (IsStreamValid())
         SetStreamValid(false);
 }
@@ -1443,6 +1457,9 @@ void ScTable::UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos, SCTAB nTabNo,
         rProgress.SetState( rProgress.GetState() + aCol[i].GetCodeCount() );
     }
 
+    if (mpRangeName)
+        mpRangeName->UpdateTabRef(nOldPos, 3, nNewPos);
+
     if (IsStreamValid())
         SetStreamValid(false);
    if (pDBDataNoName)
commit a2198f4880b6586732aa6bbb5f59e63555ae026f
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Jun 29 21:54:18 2011 +0200

    fix for fdo#36963: name box always selects cell in the first sheet
    
    add the current table number as fallback to the address parser for the
    case that no table is specified
    
    Signed-off-by: Katarina Machalkova <kmachalkova at novell.com>

diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index 570f8dd..156043b 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -1420,7 +1420,7 @@ sal_uInt16 ScRange::ParseAny( const String& r, ScDocument* pDoc,
 
     if ( (nRet & nValid) != nValid )
     {
-        ScAddress aAdr;
+        ScAddress aAdr(aStart);//initialize with currentPos as fallback for table number
         nRet = aAdr.Parse( r, pDoc, rDetails );
         if ( nRet & SCA_VALID )
             aStart = aEnd = aAdr;
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 3907c6d..49c35a4 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1701,7 +1701,7 @@ void ScPosWnd::DoEnter()
                     {
                         // Note that SID_CURRENTCELL always expects address to
                         // be in Calc A1 format.  Convert the text.
-                        ScRange aRange;
+                        ScRange aRange(0,0,pViewData->GetTabNo());
                         aRange.ParseAny(aText, pDoc, pDoc->GetAddressConvention());
                         aRange.Format(aText, SCR_ABS_3D, pDoc, ::formula::FormulaGrammar::CONV_OOO);
                     }
commit 0292da5929768cb7324821947379aad625ed41e4
Author: Katarina Machalkova <kmachalkova at suse.cz>
Date:   Mon Jun 27 13:35:01 2011 +0200

    fdo#38456: Always set column offset to 0
    
    Setting it to anything else moves field indexes off-by-N and causes crash
    in some cases (the original code has been unused since 2004 at least)
    
    Signed-off-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 472c451..93bfebb 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -1860,9 +1860,6 @@ sal_Bool ScDPObject::FillOldParam(ScPivotParam& rParam) const
     // ppLabelArr / nLabels is not changed
 
     SCCOL nSrcColOffset = 0;
-    if (IsSheetData())
-        // source data column offset is only for internal sheet source.
-        nSrcColOffset = pSheetDesc->GetSourceRange().aStart.Col();
 
     bool bAddData = ( lcl_GetDataGetOrientation( xSource ) == sheet::DataPilotFieldOrientation_HIDDEN );
     lcl_FillOldFields(
commit 27677513a21ac7c9b4ce9f9236e0b5722d179f38
Author: Petr Mladek <pmladek at suse.cz>
Date:   Fri Jun 24 11:49:24 2011 +0200

    Revert "fdo#36688: Fixed undisplayed calc page and header / footer borders"
    
    It triggered heavy leaking of opened file descriptors (fdo#38590)
    
    This reverts commit 70af08e849a93d56915b7abe14537facf1022a6a.
    
    Signed-off-by: Petr Mladek <pmladek at suse.cz>
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>
    Signed-off-by: Michael Meeks <michael.meeks at novell.com>

diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 22b5d24..f37a2c8 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -52,7 +52,6 @@
 #include <basegfx/matrix/b2dhommatrix.hxx>
 #include <svx/sdr/contact/objectcontacttools.hxx>
 #include <svx/unoapi.hxx>
-#include <svx/svdpage.hxx>
 
 #include "output.hxx"
 #include "document.hxx"
@@ -1635,19 +1634,17 @@ void ScOutputData::DrawRotatedFrame( const Color* pForceColor )
 
 drawinglayer::processor2d::BaseProcessor2D* ScOutputData::CreateProcessor2D( )
 {
-    SdrModel aModel;
-    SdrPage aSdrPage( aModel );
-
     ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
-    if ( pDrawLayer )
-        aSdrPage = *pDrawLayer->GetPage( static_cast< sal_uInt16 >( nTab ) );
+    if (!pDrawLayer)
+        return NULL;
 
     basegfx::B2DRange aViewRange;
+    SdrPage *pDrawPage = pDrawLayer->GetPage( static_cast< sal_uInt16 >( nTab ) );
     const drawinglayer::geometry::ViewInformation2D aNewViewInfos(
             basegfx::B2DHomMatrix(  ),
             pDev->GetViewTransformation(),
             aViewRange,
-            GetXDrawPageForSdrPage( &aSdrPage ),
+            GetXDrawPageForSdrPage( pDrawPage ),
             0.0,
             uno::Sequence< beans::PropertyValue >() );
 
commit 026c16f0d00323a1b1bf536ccca74bec8fa7f66d
Author: Noel Power <noel.power at novell.com>
Date:   Thu Jun 23 14:33:42 2011 +0000

    fix for fdo#38544 enable Object/Edit menu item for ole/embedded objects
    
    Signed-off-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx
index a75dfd8..02787e8 100644
--- a/sc/source/ui/view/drawview.cxx
+++ b/sc/source/ui/view/drawview.cxx
@@ -487,7 +487,7 @@ void ScDrawView::MarkListHasChanged()
         uno::Reference < embed::XEmbeddedObject > xObj = pOle2Obj->GetObjRef();
         DBG_ASSERT( xObj.is(), "SdrOle2Obj ohne ObjRef" );
         if (xObj.is())
-            xObj->getSupportedVerbs();
+            aVerbs = xObj->getSupportedVerbs();
     }
     pViewSh->SetVerbs( aVerbs );
 
commit 145e3d196f9b86de32a9095811433fd941aace50
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Thu Jun 23 17:12:26 2011 +0200

    fix for fdo#38593: don't call vector::back on an empty vector
    (cherry picked from commit 70d01893e713fa730acd73a28fbf5ee29651215c)

diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx
index c7a79a1..10c4a5b 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -1012,7 +1012,9 @@ void ScHTMLLayoutParser::TableOn( ImportInfo* pInfo )
             nColOffsetStart = nColOffset;
         }
 
-        ScEEParseEntry* pE = maList.back();
+        ScEEParseEntry* pE = NULL;
+        if (maList.size())
+            pE = maList.back();
         NewActEntry( pE );      // neuer freifliegender pActEntry
         xLockedList = new ScRangeList;
     }
commit bdbd2f7c727d909550839d3d88cc2ca7e089d151
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Jun 22 20:29:46 2011 +0200

    fix for fdo#38204: formulas with range names were not imported correctly
    
    Signed-off-by: Noel Power <noel.power at novell.com>

diff --git a/sc/source/filter/excel/xiname.cxx b/sc/source/filter/excel/xiname.cxx
index 90be4dc..8a80f52 100644
--- a/sc/source/filter/excel/xiname.cxx
+++ b/sc/source/filter/excel/xiname.cxx
@@ -271,7 +271,7 @@ const XclImpName* XclImpNameManager::FindName( const String& rXclName, SCTAB nSc
 const XclImpName* XclImpNameManager::GetName( sal_uInt16 nXclNameIdx ) const
 {
     DBG_ASSERT( nXclNameIdx > 0, "XclImpNameManager::GetName - index must be >0" );
-    return ( nXclNameIdx >= maNameList.size() ) ? NULL : &(maNameList.at( nXclNameIdx - 1 ));
+    return ( nXclNameIdx > maNameList.size() ) ? NULL : &(maNameList.at( nXclNameIdx - 1 ));
 }
 
 // ============================================================================
commit 556838a24b2ac018d1ffb24e46b1b8de731dc903
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Jun 20 23:20:33 2011 +0200

    better fix for fdo#38455
    
    Signed-off-by: Petr Mladek <pmladek at suse.cz>

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 329bf96..abe74d7 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -2066,7 +2066,8 @@ IMPL_LINK( ScInputHandler, ModifyHdl, void *, EMPTYARG )
 
 sal_Bool ScInputHandler::DataChanging( sal_Unicode cTyped, sal_Bool bFromCommand )		// return sal_True = new view created
 {
-    pActiveViewSh->GetViewData()->SetPasteMode( SC_PASTE_NONE );
+    if (pActiveViewSh)
+        pActiveViewSh->GetViewData()->SetPasteMode( SC_PASTE_NONE );
     bInOwnChange = true;				// disable ModifyHdl (reset in DataChanged)
 
     if ( eMode == SC_INPUT_NONE )
@@ -2283,7 +2284,7 @@ void ScInputHandler::SetMode( ScInputMode eNewMode )
         return;
     }
 
-    if (eNewMode != SC_INPUT_NONE)
+    if (eNewMode != SC_INPUT_NONE && pActiveViewSh)
         // Disable paste mode when edit mode starts.
         pActiveViewSh->GetViewData()->SetPasteMode( SC_PASTE_NONE );
 
commit d46d716461812e03f1bc8541aa8b486a4f7f54ba
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Tue Jun 14 01:07:57 2011 -0400

    Properly return empty string when asked, as it did previosly.
    
    Refactoring of ScMatrix changed this behavior by accident.  Let's
    bring back the old behavior.
    
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>

diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx
index b2f4826..fcdf412 100644
--- a/sc/source/core/tool/scmatrix.cxx
+++ b/sc/source/core/tool/scmatrix.cxx
@@ -463,12 +463,15 @@ const String& ScMatrixImpl::GetString(SCSIZE nC, SCSIZE nR) const
 {
     if (ValidColRowOrReplicated( nC, nR ))
     {
-        if (maMat.get_type(nR, nC) == ::mdds::element_string)
-            return *maMat.get_string(nR, nC);
-        else
+        switch (maMat.get_type(nR, nC))
         {
-            SetErrorAtInterpreter( GetError(nC, nR));
-            DBG_ERRORFILE("ScMatrixImpl::GetString: access error, no string");
+            case ::mdds::element_string:
+                return *maMat.get_string(nR, nC);
+            case ::mdds::element_empty:
+                return ScGlobal::GetEmptyString();
+            default:
+                SetErrorAtInterpreter( GetError(nC, nR));
+                OSL_FAIL("ScMatrixImpl::GetString: access error, no string");
         }
     }
     else


More information about the Libreoffice-commits mailing list