[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.4' - 12 commits - bin/lo-xlate-lang formula/source include/formula odk/examples sc/inc sc/source sd/source svx/uiconfig sw/qa toolkit/source vcl/source wizards/source writerfilter/source

Stephan Bergmann sbergman at redhat.com
Thu Jun 18 02:20:26 PDT 2015


 bin/lo-xlate-lang                             |    2 +-
 formula/source/ui/dlg/FormulaHelper.cxx       |    4 +---
 include/formula/IFunctionDescription.hxx      |    5 +++--
 odk/examples/java/Spreadsheet/CalcAddins.java |    2 +-
 sc/inc/funcdesc.hxx                           |   10 ++++++----
 sc/inc/progress.hxx                           |    4 ++++
 sc/inc/token.hxx                              |    6 ++++++
 sc/source/core/data/column2.cxx               |   17 +++++++++++++++++
 sc/source/core/data/document.cxx              |   11 +++++++----
 sc/source/core/data/formulacell.cxx           |    8 ++++++--
 sc/source/core/data/funcdesc.cxx              |    7 ++++---
 sc/source/core/tool/progress.cxx              |   13 ++++++++-----
 sc/source/core/tool/token.cxx                 |   21 +++++++++++++++------
 sd/source/ui/view/drtxtob1.cxx                |   15 ++-------------
 svx/uiconfig/ui/sidebararea.ui                |    7 +++++++
 sw/qa/extras/ooxmlimport/data/tdf8255.docx    |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx      |    9 +++++++++
 toolkit/source/awt/vclxtoolkit.cxx            |   22 +++++++++++++++++++++-
 vcl/source/app/svapp.cxx                      |    3 ++-
 wizards/source/access2base/Recordset.xba      |   21 +++++++++------------
 writerfilter/source/dmapper/PropertyMap.cxx   |   12 +++++++++++-
 21 files changed, 140 insertions(+), 59 deletions(-)

New commits:
commit 66d9cd0e0d6ed341e20c3049ea309c0da1c6e966
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jun 17 17:54:19 2015 +0200

    Fix CalcAddins example
    
    was broken with 70f56bc22fe952c75ec714e05e1bb5296491a36a "java: reduce scope,
    make member classes private"
    
    Change-Id: I84a3fafbfdddf6bb04ab7787d344bf50ffd22994
    (cherry picked from commit 3b07120a72a5fd28836b226becbc100e24e84edf)
    
    Conflicts:
    	odk/examples/java/Spreadsheet/CalcAddins.java
    
    (cherry picked from commit df5c4b956b7634c9f5cf2fd84a7946c7d97cd408)

diff --git a/odk/examples/java/Spreadsheet/CalcAddins.java b/odk/examples/java/Spreadsheet/CalcAddins.java
index 555ddde..c46fc4a 100644
--- a/odk/examples/java/Spreadsheet/CalcAddins.java
+++ b/odk/examples/java/Spreadsheet/CalcAddins.java
@@ -60,7 +60,7 @@ public class CalcAddins {
  * of the service description. It implements the needed interfaces.
  * @implements XCalcAddins, XAddIn, XServiceName, XServiceInfo, XTypeProvider
  */
-    static private class _CalcAddins extends WeakBase implements
+    static public class _CalcAddins extends WeakBase implements
                                             XCalcAddins,
                                             XAddIn,
                                             XServiceName,
commit 533225f98576ad33efbf0ead638872821db2ed3a
Author: Eike Rathke <erack at redhat.com>
Date:   Wed Jun 17 00:04:30 2015 +0200

    Resolves: tdf#86305 clone upper left of matrix result if double token
    
    Change-Id: I541577e0b99b0144a755e5755adc890c0ca8d204
    (cherry picked from commit ffc1ffed11dc63a69fc2db04f12b3ea266b580fe)
    Reviewed-on: https://gerrit.libreoffice.org/16326
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/inc/token.hxx b/sc/inc/token.hxx
index da4f9e9..31a598a 100644
--- a/sc/inc/token.hxx
+++ b/sc/inc/token.hxx
@@ -337,6 +337,12 @@ public:
     /** Reset matrix and upper left, keep matrix
         formula dimension. */
     void ResetResult();
+
+private:
+
+    /** xUpperLeft is modifiable through SetUpperLeftDouble(), so clone it
+        whenever an svDouble token is assigned to. */
+    void CloneUpperLeftIfNecessary();
 };
 
 class SC_DLLPUBLIC ScHybridCellToken : public formula::FormulaToken
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 1e5c7d2..b4d1dd0 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -918,7 +918,10 @@ void ScMatrixCellResultToken::Assign( const ScMatrixCellResultToken & r )
 
 ScMatrixFormulaCellToken::ScMatrixFormulaCellToken(
     SCCOL nC, SCROW nR, const ScConstMatrixRef& pMat, formula::FormulaToken* pUL ) :
-    ScMatrixCellResultToken(pMat, pUL), nRows(nR), nCols(nC) {}
+    ScMatrixCellResultToken(pMat, pUL), nRows(nR), nCols(nC)
+{
+    CloneUpperLeftIfNecessary();
+}
 
 ScMatrixFormulaCellToken::ScMatrixFormulaCellToken( SCCOL nC, SCROW nR ) :
     ScMatrixCellResultToken(NULL, NULL), nRows(nR), nCols(nC) {}
@@ -926,10 +929,7 @@ ScMatrixFormulaCellToken::ScMatrixFormulaCellToken( SCCOL nC, SCROW nR ) :
 ScMatrixFormulaCellToken::ScMatrixFormulaCellToken( const ScMatrixFormulaCellToken& r ) :
     ScMatrixCellResultToken(r), nRows(r.nRows), nCols(r.nCols)
 {
-    // xUpperLeft is modifiable through
-    // SetUpperLeftDouble(), so clone it.
-    if (xUpperLeft)
-        xUpperLeft = xUpperLeft->Clone();
+    CloneUpperLeftIfNecessary();
 }
 
 bool ScMatrixFormulaCellToken::operator==( const FormulaToken& r ) const
@@ -939,9 +939,17 @@ bool ScMatrixFormulaCellToken::operator==( const FormulaToken& r ) const
         nCols == p->nCols && nRows == p->nRows;
 }
 
+void ScMatrixFormulaCellToken::CloneUpperLeftIfNecessary()
+{
+    if (xUpperLeft && xUpperLeft->GetType() == svDouble)
+        xUpperLeft = xUpperLeft->Clone();
+}
+
 void ScMatrixFormulaCellToken::Assign( const ScMatrixCellResultToken & r )
 {
     ScMatrixCellResultToken::Assign( r);
+
+    CloneUpperLeftIfNecessary();
 }
 
 void ScMatrixFormulaCellToken::Assign( const formula::FormulaToken& r )
@@ -963,6 +971,7 @@ void ScMatrixFormulaCellToken::Assign( const formula::FormulaToken& r )
         {
             xUpperLeft = &r;
             xMatrix = NULL;
+            CloneUpperLeftIfNecessary();
         }
     }
 }
commit 4d0b68128824651478c1119e2649dabb81f8aea0
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Mon Jun 15 23:23:10 2015 +0300

    tdf#91001 Fix inc/dec font for complex selections
    
    By "complex selection" I mean:
    1. Selection with an empty paragraph that has a bullet.
    2. Selection that has different font sizes.
    
    This is a regression of
    5b32d9c4406a68507ac9737ee0ada8bd1d424815 that tried to
    fix tdf#61492. In reality in order to fix that, it seems
    to be enough to pass an empty SfxItemSet, because what we
    really need is to invalidate the bullet width (by setting
    it to -1), thus force recalculation, and this occurs
    anyway.
    
    Change-Id: I92545192f8c78ef7f1d66d72f0d8e8f256f87604
    (cherry picked from commit 2a05cb81d363cce181d3e31967cea2cfff1bd06d)
    Reviewed-on: https://gerrit.libreoffice.org/16336
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx
index c38924b..924f06c 100644
--- a/sd/source/ui/view/drtxtob1.cxx
+++ b/sd/source/ui/view/drtxtob1.cxx
@@ -396,19 +396,8 @@ void TextObjectBar::Execute( SfxRequest &rReq )
             {
                 FuText::ChangeFontSize( nSlot == SID_GROW_FONT_SIZE, pOLV, pFontList, mpView );
                 if( pOLV )
-                {
-                    SfxItemSet aSet( pOLV->GetEditView().GetAttribs() );
-                    SfxItemSet aNewAttrs (pOLV->GetEditView().GetEmptyItemSet() );
-
-                    aNewAttrs.Put( aSet.Get( EE_CHAR_FONTHEIGHT ), EE_CHAR_FONTHEIGHT );
-                    aNewAttrs.Put( aSet.Get( EE_CHAR_FONTHEIGHT_CJK ), EE_CHAR_FONTHEIGHT_CJK );
-                    aNewAttrs.Put( aSet.Get( EE_CHAR_FONTHEIGHT_CTL ), EE_CHAR_FONTHEIGHT_CTL );
-
-                    mpView->SetAttributes( aNewAttrs );
-                }
-                Invalidate();
-                // to refresh preview (in outline mode), slot has to be invalidated:
-                mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_PREVIEW_STATE, true, false );
+                    pOLV->SetAttribs( pOLV->GetEditView().GetEmptyItemSet() );
+                mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_ATTR_CHAR_FONTHEIGHT );
             }
             rReq.Done();
         }
commit 62ac88a92318af80216c92e3a42362119cd6e75d
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Jun 8 07:48:42 2015 +0200

    tdf#82553 DOCX import: handle table margin when converting floattables
    
    (cherry picked from commit 292ec5fe8d01af6119325f1a426422bb42e58615)
    
    Conflicts:
    	sw/qa/extras/ooxmlimport/ooxmlimport.cxx
    
    Change-Id: I7a3a233a34453153b3e1c0fe3d60bb0ede65dc86
    Reviewed-on: https://gerrit.libreoffice.org/16248
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/qa/extras/ooxmlimport/data/tdf8255.docx b/sw/qa/extras/ooxmlimport/data/tdf8255.docx
new file mode 100644
index 0000000..366e498
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf8255.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 0721a1e..4a7a8bc 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2581,6 +2581,15 @@ DECLARE_OOXMLIMPORT_TEST(testFdo87488, "fdo87488.docx")
     }
 }
 
+DECLARE_OOXMLIMPORT_TEST(testTdf8255, "tdf8255.docx")
+{
+    uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
+    uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xTextDocument, uno::UNO_QUERY);
+    uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
+    // This was 1: a full-page-wide multi-page floating table was imported as a TextFrame.
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), xDrawPage->getCount());
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index 845dbe6..f83862c 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1037,6 +1037,16 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
     for (size_t i = 0; i < rPendingFloatingTables.size(); ++i)
     {
         FloatingTableInfo& rInfo = rPendingFloatingTables[i];
+
+        // Count the layout width of the table.
+        sal_Int32 nTableWidth = rInfo.m_nTableWidth;
+        sal_Int32 nLeftMargin = 0;
+        if (rInfo.getPropertyValue("LeftMargin") >>= nLeftMargin)
+            nTableWidth += nLeftMargin;
+        sal_Int32 nRightMargin = 0;
+        if (rInfo.getPropertyValue("RightMargin") >>= nRightMargin)
+            nTableWidth += nRightMargin;
+
         // If the table is wider than the text area, then don't create a fly
         // for the table: no wrapping will be performed anyway, but multi-page
         // tables will be broken.
@@ -1045,7 +1055,7 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl )
         // If there are columns, always create the fly, otherwise the columns would
         // restrict geometry of the table.
         if ( ( rInfo.getPropertyValue("HoriOrientRelation") == text::RelOrientation::PAGE_FRAME ) ||
-             ( rInfo.m_nTableWidth < nTextAreaWidth ) || ColumnCount() + 1 >= 2 )
+             nTableWidth < nTextAreaWidth || ColumnCount() + 1 >= 2 )
             xBodyText->convertToTextFrame(rInfo.m_xStart, rInfo.m_xEnd, rInfo.m_aFrameProperties);
     }
     rPendingFloatingTables.clear();
commit 2fcce28ed40321780e8f2e7213aa13fa4fb195d9
Author: Jean-Pierre Ledure <jp at ledure.be>
Date:   Sat Jun 13 14:33:36 2015 +0200

    Access2Base - Correct behaviour of MoveNext, MovePrevious (patch 03)
    
    Bug in MoveNext and MovePrevious methods of Recordset class module
    Reported in https://forum.openoffice.org/en/forum/viewtopic.php?f=47&t=76640
    
    Change-Id: I6c2a3f6e23bbc414f594c791a86066d46a7b09f4
    Reviewed-on: https://gerrit.libreoffice.org/16257
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/wizards/source/access2base/Recordset.xba b/wizards/source/access2base/Recordset.xba
index 4a9c833..4df3af2 100644
--- a/wizards/source/access2base/Recordset.xba
+++ b/wizards/source/access2base/Recordset.xba
@@ -920,18 +920,15 @@ Dim l As Long, lRow As Long
 				End If
 		End Select
 
-		Select Case True
-			Case .isBeforeFirst()
-				_BOF = True
-				_Move = False
-			Case .isAfterlast()
-				_EOF = True
-				_Move = False
-			Case Else
-				If .rowDeleted() Then Goto Error_RowDeleted
-				If .rowUpdated() Then .refreshRow()
-				_Move = True
-		End Select
+		_BOF = .isBeforeFirst()			'	https://forum.openoffice.org/en/forum/viewtopic.php?f=47&t=76640
+		_EOF = .isAfterlast()
+		If _BOF Or _EOF Then
+			_Move = False
+		Else
+			If .rowDeleted() Then Goto Error_RowDeleted
+			If .rowUpdated() Then .refreshRow()
+			_Move = True
+		End If
 	End With
 
 Exit_Function:
commit 82073a3435149b35ab0a224063eac313e8997eea
Author: Rishabh Kumar <kris.kr296 at gmail.com>
Date:   Mon Jun 8 16:35:05 2015 +0530

    tdf#88843 Set Maximum Value for Transparency spin button in area sidebar tab
    
    Change-Id: Idb1c5051de5ddb0501b8d1440f8abe62074296bc
    Reviewed-on: https://gerrit.libreoffice.org/16144
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
    Tested-by: Katarina Behrens <Katarina.Behrens at cib.de>
    (cherry picked from commit c1692f620610621a139e54fb1f9d11d4c177608d)
    Reviewed-on: https://gerrit.libreoffice.org/16204
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/svx/uiconfig/ui/sidebararea.ui b/svx/uiconfig/ui/sidebararea.ui
index adad038..708533c 100644
--- a/svx/uiconfig/ui/sidebararea.ui
+++ b/svx/uiconfig/ui/sidebararea.ui
@@ -3,6 +3,12 @@
 <interface>
   <requires lib="gtk+" version="3.0"/>
   <requires lib="LibreOffice" version="1.0"/>
+  <object class="GtkAdjustment" id="adjustment1">
+    <property name="lower">0</property>
+    <property name="upper">100</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
   <object class="GtkGrid" id="AreaPropertyPanel">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
@@ -185,6 +191,7 @@
                     <property name="hexpand">True</property>
                     <property name="max_length">100</property>
                     <property name="invisible_char">•</property>
+                    <property name="adjustment">adjustment1</property>
                     <property name="secondary_icon_activatable">False</property>
                     <property name="climb_rate">5</property>
                     <property name="numeric">True</property>
commit 147ec6b7fbdb8de5307e49b5d3f269d9159d2f21
Author: Eike Rathke <erack at redhat.com>
Date:   Sat Jun 13 15:12:32 2015 +0200

    do not access token data after token has been destroyed
    
    Change-Id: I624e64745fd3874be3e1bd3df6bac18dfb17aebb
    (cherry picked from commit c1fc84ac140d519e0bfa7a607e36771682b08eed)
    Reviewed-on: https://gerrit.libreoffice.org/16258
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index a96936c..1e5c7d2 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -2245,9 +2245,9 @@ void ScTokenArray::ReadjustAbsolute3DReferences( const ScDocument* pOldDoc, cons
                     OUString aTabName;
                     sal_uInt16 nFileId;
                     GetExternalTableData(pOldDoc, pNewDoc, rRef1.Tab(), aTabName, nFileId);
-                    pCode[j]->DecRef();
                     ScExternalDoubleRefToken* pToken = new ScExternalDoubleRefToken(nFileId, aTabName, rRef);
                     pToken->IncRef();
+                    pCode[j]->DecRef(); // ATTENTION: rRef can't be used after this point
                     pCode[j] = pToken;
                 }
             }
commit a9b19fcc252da10b5ee3aed75fea5ee52d235124
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Jun 15 23:45:28 2015 +0200

    Resolves: tdf#91411 end listening only on selected sheets
    
    ... not in cell areas of all sheets.
    
    (cherry picked from commit 80ec99db4325a439a8a3f1d420d0a80f8bf9c439)
    
    Conflicts:
    	sc/source/core/data/document.cxx
    
    Change-Id: I8d19c15c6d8d89652ac5695214bc4dd930783087
    Reviewed-on: https://gerrit.libreoffice.org/16303
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 5889916..4a4f0004 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -1779,12 +1779,15 @@ void ScDocument::DeleteArea(
     std::vector<ScAddress> aGroupPos;
     sc::EndListeningContext aCxt(*this);
     ScRange aRange(nCol1, nRow1, 0, nCol2, nRow2, 0);
-    for (size_t i = 0; i < maTabs.size(); ++i)
+    for (SCTAB i = 0; i < static_cast<SCTAB>(maTabs.size()); i++)
     {
-        aRange.aStart.SetTab(i);
-        aRange.aEnd.SetTab(i);
+        if (rMark.GetTableSelect(i))
+        {
+            aRange.aStart.SetTab(i);
+            aRange.aEnd.SetTab(i);
 
-        EndListeningIntersectedGroups(aCxt, aRange, &aGroupPos);
+            EndListeningIntersectedGroups(aCxt, aRange, &aGroupPos);
+        }
     }
     aCxt.purgeEmptyBroadcasters();
 
commit 5a3a9cf8b677140ad57c7a1c4576ef11abcdfeea
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jun 4 10:06:17 2015 +0100

    Resolves: tdf#46440 SIGSEGV on toolkit bootstrap without running instance
    
    (cherry picked from commit 3f69547397e5841d0915921be5be8b3edfdfdbc5)
    
    Change-Id: I9a78a75b3d72586b1702ed6fa63bb0b62ce6cd72
    Reviewed-on: https://gerrit.libreoffice.org/16078
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index 680fc0c..4cc5873 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -44,6 +44,7 @@
 #include <com/sun/star/awt/XToolkitExperimental.hpp>
 #include <com/sun/star/awt/XMessageBoxFactory.hpp>
 
+#include <cppuhelper/bootstrap.hxx>
 #include <cppuhelper/compbase2.hxx>
 #include <cppuhelper/interfacecontainer.hxx>
 #include <cppuhelper/supportsservice.hxx>
@@ -601,7 +602,26 @@ static void SAL_CALL ToolkitWorkerFunction( void* pArgs )
 {
     osl_setThreadName("VCLXToolkit VCL main thread");
 
-    VCLXToolkit * pTk = (VCLXToolkit *)pArgs;
+    css::uno::Reference<css::lang::XMultiServiceFactory> xServiceManager;
+    try
+    {
+        xServiceManager = ::comphelper::getProcessServiceFactory();
+    }
+    catch (const css::uno::DeploymentException&)
+    {
+    }
+    if (!xServiceManager.is())
+    {
+        css::uno::Reference<css::uno::XComponentContext> xContext =
+            ::cppu::defaultBootstrap_InitialComponentContext();
+
+        xServiceManager = css::uno::Reference<css::lang::XMultiServiceFactory>(
+            xContext->getServiceManager(), css::uno::UNO_QUERY_THROW );
+        // set global process service factory used by unotools config helpers
+        ::comphelper::setProcessServiceFactory( xServiceManager );
+    }
+
+    VCLXToolkit * pTk = static_cast<VCLXToolkit *>(pArgs);
     bInitedByVCLToolkit = InitVCL();
     if( bInitedByVCLToolkit )
     {
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 8d99977..5ce9477 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -428,7 +428,8 @@ void Application::AcquireSolarMutex( sal_uLong nCount )
 
 bool Application::IsInMain()
 {
-    return ImplGetSVData()->maAppData.mbInAppMain;
+    ImplSVData* pSVData = ImplGetSVData();
+    return pSVData ? pSVData->maAppData.mbInAppMain : false;
 }
 
 bool Application::IsInExecute()
commit ebe63e58280d354c13222db67d7c041e06a1884e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jun 11 16:52:09 2015 +0100

    Resolves: tdf#89643 report builder function wizard segfaults
    
    regression from
    
        commit 3d6521280929ecacc53b7c358d29d0b5d31b3462
        CommitDate: Thu Jul 31 22:14:25 2014 +0200
    
            fix memory leak around function descriptions
    
            Found by Lsan.
    
    There are two implementations of getCategory, one (sc) returns a new one each
    time (hence the leak fix) and the other (reportdesign) returns a pointer to one
    that belongs to the manger (hence the crash).
    
    The code in formula really looks to me to expect that the getCategory return a
    pointer that "someone else" needs to look after, i.e. the reportdesign variant
    is the more correct so revert 3d6521280929ecacc53b7c358d29d0b5d31b3462 and to
    fix the leak make the sc own the ScFunctionCategories and just cache them like
    the reportdesign one does
    
    Change-Id: Ifd986301a54b4d20449e864697655cd973e0c4df
    (cherry picked from commit 7c3abee29c742593206b755b20a718c46f0780fa)
    (cherry picked from commit 73107eb3375f1671f549f0467be2812df9223848)
    Reviewed-on: https://gerrit.libreoffice.org/16232
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/formula/source/ui/dlg/FormulaHelper.cxx b/formula/source/ui/dlg/FormulaHelper.cxx
index c644856..ab1baa6 100644
--- a/formula/source/ui/dlg/FormulaHelper.cxx
+++ b/formula/source/ui/dlg/FormulaHelper.cxx
@@ -23,8 +23,6 @@
 #include <unotools/charclass.hxx>
 #include <unotools/syslocale.hxx>
 
-#include <boost/scoped_ptr.hpp>
-
 namespace formula
 {
 
@@ -95,7 +93,7 @@ bool FormulaHelper::GetNextFunc( const OUString&  rFormula,
             const sal_uInt32 nCategoryCount = m_pFunctionManager->getCount();
             for(sal_uInt32 j= 0; j < nCategoryCount && !*ppFDesc; ++j)
             {
-                boost::scoped_ptr<const IFunctionCategory> pCategory(m_pFunctionManager->getCategory(j));
+                const IFunctionCategory* pCategory = m_pFunctionManager->getCategory(j);
                 const sal_uInt32 nCount = pCategory->getCount();
                 for(sal_uInt32 i = 0 ; i < nCount; ++i)
                 {
diff --git a/include/formula/IFunctionDescription.hxx b/include/formula/IFunctionDescription.hxx
index 1b37d51..85f42aa 100644
--- a/include/formula/IFunctionDescription.hxx
+++ b/include/formula/IFunctionDescription.hxx
@@ -60,7 +60,7 @@ namespace formula
         ~IFunctionManager() {}
     };
 
-    class IFunctionCategory
+    class SAL_NO_VTABLE IFunctionCategory
     {
     public:
         IFunctionCategory(){}
@@ -70,7 +70,8 @@ namespace formula
         virtual sal_uInt32                  getNumber() const = 0;
         virtual OUString             getName() const = 0;
 
-        virtual ~IFunctionCategory() {}
+    protected:
+        ~IFunctionCategory() {}
     };
 
     class SAL_NO_VTABLE IFunctionDescription
diff --git a/sc/inc/funcdesc.hxx b/sc/inc/funcdesc.hxx
index e746462..43e4101 100644
--- a/sc/inc/funcdesc.hxx
+++ b/sc/inc/funcdesc.hxx
@@ -27,6 +27,7 @@
 #include <formula/IFunctionDescription.hxx>
 #include <sal/types.h>
 #include <rtl/ustring.hxx>
+#include <map>
 
 #define MAX_FUNCCAT 12  /* maximum number of categories for functions */
 #define LRU_MAX 10 /* maximal number of last recently used functions */
@@ -361,7 +362,7 @@ public:
     /**
       Returns a category.
 
-      Creates an IFunctionCategory object from a category specified by nPos.
+      Returns an IFunctionCategory object for a category specified by nPos.
 
       @param nPos
       the index of the category, note that 0 maps to the first category not the cumulative ('All') category.
@@ -399,9 +400,10 @@ public:
 
 private:
     ScFunctionList* pFuncList; /**< list of all calc functions */
-    ::std::vector<const ScFuncDesc*>* aCatLists[MAX_FUNCCAT]; /**< array of all categories, 0 is the cumulative ('All') category */
-    mutable ::std::vector<const ScFuncDesc*>::iterator pCurCatListIter; /**< position in current category */
-    mutable ::std::vector<const ScFuncDesc*>::iterator pCurCatListEnd; /**< end of current category */
+    std::vector<const ScFuncDesc*>* aCatLists[MAX_FUNCCAT]; /**< array of all categories, 0 is the cumulative ('All') category */
+    mutable std::map< sal_uInt32, std::shared_ptr<ScFunctionCategory> > m_aCategories; /**< map of category pos to IFunctionCategory */
+    mutable std::vector<const ScFuncDesc*>::iterator pCurCatListIter; /**< position in current category */
+    mutable std::vector<const ScFuncDesc*>::iterator pCurCatListEnd; /**< end of current category */
 };
 
 #endif // INCLUDED_SC_INC_FUNCDESC_HXX
diff --git a/sc/source/core/data/funcdesc.cxx b/sc/source/core/data/funcdesc.cxx
index 9dd713d..d9d0266 100644
--- a/sc/source/core/data/funcdesc.cxx
+++ b/sc/source/core/data/funcdesc.cxx
@@ -752,12 +752,13 @@ sal_uInt32 ScFunctionMgr::getCount() const
 
 const formula::IFunctionCategory* ScFunctionMgr::getCategory(sal_uInt32 nCategory) const
 {
-    formula::IFunctionCategory* pRet = NULL;
     if ( nCategory < (MAX_FUNCCAT-1) )
     {
-         pRet = new ScFunctionCategory(const_cast<ScFunctionMgr*>(this),aCatLists[nCategory+1],nCategory); // aCatLists[0] is "all"
+        if (m_aCategories.find(nCategory) == m_aCategories.end())
+            m_aCategories[nCategory].reset(new ScFunctionCategory(const_cast<ScFunctionMgr*>(this),aCatLists[nCategory+1],nCategory)); // aCatLists[0] is "all"
+        return m_aCategories[nCategory].get();
     }
-    return pRet;
+    return NULL;
 }
 
 const formula::IFunctionDescription* ScFunctionMgr::getFunctionByName(const OUString& _sFunctionName) const
commit e336e2d2e521bd0758a927d82756c0437a7b9c82
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed May 27 13:52:36 2015 +0100

    Resolves: tdf#91416 setting progress -> resize -> destroy formula context
    
    i.e. setting progress triggers ScTabView::DoResize and an InterpretVisible and
    InterpretDirtyCells which resets the mpFormulaGroupCxt that the current rCxt
    points to, which is bad, so disable progress for the duration of the GetResult
    loop
    
    Change-Id: I8e88cee4dd2308ef61dee934d300a38978833703
    (cherry picked from commit e3c1a394a00cef416a81b89b6d5c204891abb286)
    Reviewed-on: https://gerrit.libreoffice.org/15926
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/inc/progress.hxx b/sc/inc/progress.hxx
index a658829..e14561d 100644
--- a/sc/inc/progress.hxx
+++ b/sc/inc/progress.hxx
@@ -49,6 +49,7 @@ private:
     static  bool            bAllowInterpretProgress;
     static  ScDocument*     pInterpretDoc;
     static  bool            bIdleWasEnabled;
+            bool            bEnabled;
 
             SfxProgress*    pProgress;
 
@@ -144,6 +145,9 @@ public:
                                         return pProgress->GetState();
                                     return 0;
                                 }
+            bool                Enabled() const { return bEnabled; }
+            void                Disable() { bEnabled = false; }
+            void                Enable() { bEnabled = true; }
 };
 
 #endif
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 0f22f79..6f764c7 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -43,6 +43,7 @@
 #include "formulagroup.hxx"
 #include "listenercontext.hxx"
 #include "mtvcellfunc.hxx"
+#include "progress.hxx"
 #include "scmatrix.hxx"
 #include <rowheightcontext.hxx>
 
@@ -2305,10 +2306,23 @@ bool appendToBlock(
                 sc::formula_block::iterator itData, itDataEnd;
                 getBlockIterators<sc::formula_block>(it, nLenRemain, itData, itDataEnd);
 
+                /* tdf#91416 setting progress in triggers a resize of the window
+                   and so ScTabView::DoResize and an InterpretVisible and
+                   InterpretDirtyCells which resets the mpFormulaGroupCxt that
+                   the current rCxt points to, which is bad, so disable progress
+                   during GetResult
+                 */
+                ScProgress *pProgress = ScProgress::GetInterpretProgress();
+                bool bTempDisableProgress = pProgress && pProgress->Enabled();
+                if (bTempDisableProgress)
+                    pProgress->Disable();
+
                 for (; itData != itDataEnd; ++itData, ++nPos)
                 {
                     ScFormulaCell& rFC = **itData;
+
                     sc::FormulaResultValue aRes = rFC.GetResult();
+
                     if (aRes.meType == sc::FormulaResultValue::Invalid || aRes.mnError)
                     {
                         if (aRes.mnError == ScErrorCodes::errCircularReference)
@@ -2331,6 +2345,9 @@ bool appendToBlock(
                         (*rColArray.mpNumArray)[nPos] = aRes.mfValue;
                     }
                 }
+
+                if (bTempDisableProgress)
+                    pProgress->Enable();
             }
             break;
             case sc::element_type_empty:
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 044c4a3..efa393a 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -1937,8 +1937,12 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam )
         }
 
         // Reschedule slows the whole thing down considerably, thus only execute on percent change
-        ScProgress::GetInterpretProgress()->SetStateCountDownOnPercent(
-            pDocument->GetFormulaCodeInTree()/MIN_NO_CODES_PER_PROGRESS_UPDATE );
+        ScProgress *pProgress = ScProgress::GetInterpretProgress();
+        if (pProgress && pProgress->Enabled())
+        {
+            pProgress->SetStateCountDownOnPercent(
+                pDocument->GetFormulaCodeInTree()/MIN_NO_CODES_PER_PROGRESS_UPDATE );
+        }
 
         switch (p->GetVolatileType())
         {
diff --git a/sc/source/core/tool/progress.cxx b/sc/source/core/tool/progress.cxx
index c0e4a29..a416fca 100644
--- a/sc/source/core/tool/progress.cxx
+++ b/sc/source/core/tool/progress.cxx
@@ -70,8 +70,9 @@ static bool lcl_HasControllersLocked( SfxObjectShell& rObjSh )
     return false;
 }
 
-ScProgress::ScProgress( SfxObjectShell* pObjSh, const OUString& rText,
-                        sal_uLong nRange, bool bAllDocs, bool bWait )
+ScProgress::ScProgress(SfxObjectShell* pObjSh, const OUString& rText,
+                       sal_uLong nRange, bool bAllDocs, bool bWait)
+    : bEnabled(true)
 {
 
     if ( pGlobalProgress || SfxProgress::GetActiveProgress( NULL ) )
@@ -114,9 +115,11 @@ ScProgress::ScProgress( SfxObjectShell* pObjSh, const OUString& rText,
     }
 }
 
-ScProgress::ScProgress() :
-        pProgress( NULL )
-{   // DummyInterpret
+ScProgress::ScProgress()
+    : bEnabled(true)
+    , pProgress(NULL)
+{
+    // DummyInterpret
 }
 
 ScProgress::~ScProgress()
commit 1616a4f6ed76f6527879a52ad389d5d9f24e2b4c
Author: Rene Engelhard <rene at debian.org>
Date:   Sun Jun 14 19:38:59 2015 +0200

    deb#788713: fix (fatal) perl deprecation in lo-xlate-lang
    
    Change-Id: I82c63358d9400b2c8bd391a88bba18ffae52a14b

diff --git a/bin/lo-xlate-lang b/bin/lo-xlate-lang
index b7a2879..c54f379 100755
--- a/bin/lo-xlate-lang
+++ b/bin/lo-xlate-lang
@@ -102,7 +102,7 @@ if ($LanguageCode =~ (m/^all$/)) {
 }
 
 usage ("no mapping found for $LanguageCode\n",1)
-	if (!(%$LanguageMap->{$LanguageCode}));
+	if (!($LanguageMap->{$LanguageCode}));
 
 print $LanguageMap->{$LanguageCode}, "\n";
 


More information about the Libreoffice-commits mailing list