[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - 35 commits - chart2/source configure.ac cui/source cui/uiconfig dbaccess/source forms/source fpicker/source include/sfx2 include/svx jvmfwk/plugins sc/inc sc/source sd/source sfx2/inc sfx2/source svx/source sw/inc sw/qa sw/source vcl/source vcl/unx wizards/com xmloff/source

Andras Timar andras.timar at collabora.com
Fri May 9 06:54:49 PDT 2014


 chart2/source/controller/chartapiwrapper/TitleWrapper.cxx     |    2 
 chart2/source/tools/ErrorBar.cxx                              |    2 
 configure.ac                                                  |    2 
 cui/source/options/optgdlg.cxx                                |    1 
 cui/uiconfig/ui/optgeneralpage.ui                             |    2 
 dbaccess/source/ui/inc/sbagrid.hxx                            |    2 
 forms/source/component/Edit.hxx                               |    2 
 forms/source/component/FormattedField.hxx                     |    2 
 fpicker/source/office/commonpicker.hxx                        |    2 
 include/sfx2/thumbnailview.hxx                                |    1 
 include/svx/gridctrl.hxx                                      |    4 
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx           |    3 
 sc/inc/address.hxx                                            |   13 
 sc/inc/column.hxx                                             |   20 +
 sc/inc/columnspanset.hxx                                      |    8 
 sc/inc/consoli.hxx                                            |    7 
 sc/inc/document.hxx                                           |    9 
 sc/inc/formulacell.hxx                                        |    2 
 sc/inc/formularesult.hxx                                      |    2 
 sc/inc/listenercontext.hxx                                    |    7 
 sc/inc/refhint.hxx                                            |   20 +
 sc/inc/table.hxx                                              |    1 
 sc/inc/tokenarray.hxx                                         |   20 +
 sc/inc/types.hxx                                              |   15 
 sc/source/core/data/column.cxx                                |   69 ----
 sc/source/core/data/column4.cxx                               |  129 +++++++
 sc/source/core/data/columnspanset.cxx                         |   47 ++
 sc/source/core/data/document.cxx                              |   20 -
 sc/source/core/data/formulacell.cxx                           |   28 +
 sc/source/core/data/listenercontext.cxx                       |    9 
 sc/source/core/data/table3.cxx                                |   95 ++++-
 sc/source/core/tool/consoli.cxx                               |   52 +--
 sc/source/core/tool/formularesult.cxx                         |    2 
 sc/source/core/tool/refhint.cxx                               |   25 +
 sc/source/core/tool/token.cxx                                 |  170 +++++++++-
 sc/source/filter/excel/xecontent.cxx                          |    4 
 sc/source/filter/orcus/interface.cxx                          |    3 
 sc/source/filter/xml/xmlcelli.cxx                             |    7 
 sc/source/ui/app/transobj.cxx                                 |    2 
 sc/source/ui/docshell/docfunc.cxx                             |    2 
 sc/source/ui/docshell/docsh3.cxx                              |    6 
 sc/source/ui/inc/undobase.hxx                                 |   13 
 sc/source/ui/inc/undoblk.hxx                                  |    4 
 sc/source/ui/undo/undobase.cxx                                |   45 ++
 sc/source/ui/undo/undoblk3.cxx                                |   12 
 sc/source/ui/view/viewfunc.cxx                                |   32 +
 sd/source/core/drawdoc.cxx                                    |   38 +-
 sd/source/ui/inc/slideshow.hxx                                |    2 
 sd/source/ui/slideshow/SlideShowRestarter.hxx                 |    2 
 sfx2/inc/templatedlg.hxx                                      |    2 
 sfx2/source/control/thumbnailview.cxx                         |   14 
 sfx2/source/dialog/dinfdlg.cxx                                |    5 
 sfx2/source/doc/templatedlg.cxx                               |    2 
 svx/source/unodraw/unoshape.cxx                               |    9 
 sw/inc/ndtxt.hxx                                              |    3 
 sw/qa/complex/writer/CheckBookmarks.java                      |    2 
 sw/qa/extras/inc/swmodeltestbase.hxx                          |    3 
 sw/source/core/doc/doc.cxx                                    |    3 
 sw/source/core/doc/doccomp.cxx                                |   13 
 sw/source/core/doc/doclay.cxx                                 |    1 
 sw/source/core/fields/chpfld.cxx                              |   31 -
 sw/source/core/frmedt/fefly1.cxx                              |    7 
 sw/source/core/txtnode/ndtxt.cxx                              |   11 
 sw/source/filter/ww8/ww8par6.cxx                              |    6 
 sw/source/ui/utlui/unotools.cxx                               |    3 
 vcl/source/gdi/metric.cxx                                     |    5 
 vcl/unx/gtk/a11y/atkwrapper.cxx                               |    3 
 wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py |    2 
 wizards/com/sun/star/wizards/ui/WizardDialog.py               |   12 
 xmloff/source/chart/SchXMLPlotAreaContext.cxx                 |   15 
 xmloff/source/chart/SchXMLTableContext.cxx                    |   10 
 xmloff/source/draw/ximpshap.cxx                               |   10 
 72 files changed, 851 insertions(+), 288 deletions(-)

New commits:
commit 416399b7e7068646cf72d1c7ea81c6a3871ce01e
Author: Andras Timar <andras.timar at collabora.com>
Date:   Fri May 9 15:19:36 2014 +0200

    Revert "fdo#68663 don't blindly force categories when there are none"
    
    This reverts commit b090cbdf82e0827234caf5969124f6631311ef35.
    See https://bugs.freedesktop.org/show_bug.cgi?id=72727

diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx
index a3ccd4f..bab2a9f 100644
--- a/xmloff/source/chart/SchXMLTableContext.cxx
+++ b/xmloff/source/chart/SchXMLTableContext.cxx
@@ -943,6 +943,16 @@ void SchXMLTableHelper::switchRangesFromOuterToInternalIfNecessary(
         }
     }
 
+    // there exist files with own data without a categories element but with row
+    // descriptions.  The row descriptions were used as categories even without
+    // the categories element
+    if( ! bCategoriesApplied )
+    {
+        SchXMLTools::CreateCategories(
+            xDataProv, xChartDoc, OUString("categories"),
+            0 /* nCooSysIndex */, 0 /* nDimension */ );
+    }
+
     //i91578 display of hidden values (copy paste scenario; use hidden flag during migration to locale table upon paste )
     //remove series that consist only of hidden columns
     Reference< chart2::XInternalDataProvider > xInternalDataProvider( xDataProv, uno::UNO_QUERY );
commit 46c2b6341ff46ef639e83f03a3313c5a3938c553
Author: David Tardon <dtardon at redhat.com>
Date:   Fri May 9 13:07:33 2014 +0200

    rhbz#1071604 don't crash if slide layout configs are missing
    
    Change-Id: I5cbf4ed0683cc5736a45fb980827b1b56bd0c74c
    (cherry picked from commit df71f13b80c30cb98e310baf8f6aee11f8cbe81d)
    Reviewed-on: https://gerrit.libreoffice.org/9289
    Tested-by: Michael Stahl <mstahl at redhat.com>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx
index f0c14c6..5716b43 100644
--- a/sd/source/core/drawdoc.cxx
+++ b/sd/source/core/drawdoc.cxx
@@ -1006,12 +1006,19 @@ void SdDrawDocument::InitLayoutVector()
         const Reference<XDocumentBuilder> xDocBuilder(
             DocumentBuilder::create( comphelper::getComponentContext (xServiceFactory) ));
 
-        // loop over every layout entry in current file
-        const Reference<XDocument> xDoc = xDocBuilder->parseURI( sFilename );
-        const Reference<XNodeList> layoutlist = xDoc->getElementsByTagName("layout");
-        const int nElements = layoutlist->getLength();
-        for(int index=0; index < nElements; index++)
-            maLayoutInfo.push_back( layoutlist->item(index) );
+        try
+        {
+            // loop over every layout entry in current file
+            const Reference<XDocument> xDoc = xDocBuilder->parseURI( sFilename );
+            const Reference<XNodeList> layoutlist = xDoc->getElementsByTagName("layout");
+            const int nElements = layoutlist->getLength();
+            for(int index=0; index < nElements; index++)
+                maLayoutInfo.push_back( layoutlist->item(index) );
+        }
+        catch (const uno::Exception &)
+        {
+            // skip missing config. files
+        }
     }
 }
 
@@ -1035,12 +1042,19 @@ void SdDrawDocument::InitObjectVector()
         const Reference<XDocumentBuilder> xDocBuilder(
             DocumentBuilder::create( comphelper::getComponentContext (xServiceFactory) ));
 
-        // loop over every object entry in current file
-        const Reference<XDocument> xDoc = xDocBuilder->parseURI( sFilename );
-        const Reference<XNodeList> objectlist = xDoc->getElementsByTagName("object");
-        const int nElements = objectlist->getLength();
-        for(int index=0; index < nElements; index++)
-            maPresObjectInfo.push_back( objectlist->item(index) );
+        try
+        {
+            // loop over every object entry in current file
+            const Reference<XDocument> xDoc = xDocBuilder->parseURI( sFilename );
+            const Reference<XNodeList> objectlist = xDoc->getElementsByTagName("object");
+            const int nElements = objectlist->getLength();
+            for(int index=0; index < nElements; index++)
+                maPresObjectInfo.push_back( objectlist->item(index) );
+        }
+        catch (const uno::Exception &)
+        {
+            // skip missing config. files
+        }
     }
 }
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 22f21891b76e77efa3d862fa00a4083f060f58fc
Author: Andras Timar <andras.timar at collabora.com>
Date:   Fri May 9 14:42:34 2014 +0200

    Bump version to 4.2-3
    
    Change-Id: Ie76ae39f9286fa22437fa0a6418807709c9cb946

diff --git a/configure.ac b/configure.ac
index ee0365c..bdcb5d3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,7 +9,7 @@ dnl in order to create a configure script.
 # several non-alphanumeric characters, those are split off and used only for the
 # ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no idea.
 
-AC_INIT([LibreOffice],[4.2.10.2],[],[],[https://libreoffice-from-collabora.com/])
+AC_INIT([LibreOffice],[4.2.10.3],[],[],[https://libreoffice-from-collabora.com/])
 
 AC_PREREQ([2.59])
 
commit 0b481978ed0541f69aaa216478ea8cfb5d99e886
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu May 8 23:43:56 2014 +0200

    fdo#77720: Mail Merge: reset cursors after clearing document
    
    The root cause for the crash is that the shell has an invalid cursor
    that does not point at a paragraph; this is because first the document
    is filled and the cursor is pointed at the content of a frame, then the
    document is cleared from SwFrmCtrlWindow::Resize() [not sure why?] and
    at that point the cursor remains on an SwEndNode (which is invalid).
    
    Change-Id: I47c1e2a34d5579953c1896ff0895568978e72bc7
    (cherry picked from commit abb0549dd1744a35b0464faac55999b0d5968212)
    Reviewed-on: https://gerrit.libreoffice.org/9288
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 61b5ed5..3cba779 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -719,6 +719,7 @@ SwFlyFrmFmt* SwDoc::MakeFlySection( RndStdIds eAnchorType,
             (SwNodeIndex( GetNodes().GetEndOfAutotext()),
              GetTxtCollFromPool( nCollId ));
         SwCntntNode * pAnchorNode = pAnchorPos->nNode.GetNode().GetCntntNode();
+        assert(pAnchorNode); // pAnchorNode from cursor, must be valid
 
         const SfxPoolItem * pItem = NULL;
 
diff --git a/sw/source/ui/utlui/unotools.cxx b/sw/source/ui/utlui/unotools.cxx
index e25deec..b5b36ba 100644
--- a/sw/source/ui/utlui/unotools.cxx
+++ b/sw/source/ui/utlui/unotools.cxx
@@ -415,7 +415,10 @@ void SwOneExampleFrame::ClearDocument( sal_Bool bStartUpdateTimer )
             SwEditShell* pSh = pDoc->GetEditShell();
             pSh->LockPaint();
             pSh->StartAllAction();
+            pSh->KillPams();
+            pSh->ClearMark();
             pDoc->ClearDoc();
+            pSh->ClearUpCrsrs();
 
             if( aLoadedTimer.IsActive() || !bStartUpdateTimer )
             {
commit f1aa6122223572a46b693e73e2b5606efe9f1f8d
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Feb 6 13:02:19 2014 +0100

    SwDoc::ConvertFieldsToText(): don't insert empty strings
    
    Prevents an assert on accessing sText[0] in InsertString().
    
    Manually cherry-picked from 85a8c1361dccb2c3b98458c2c1c377d5de275d0e
    to resolve fdo#77720, see bt here https://bugs.freedesktop.org/attachment.cgi?id=97684
    
    Change-Id: I1828694a4c1e46f8b48cf3571ec2bf4dd615bf2c
    Reviewed-on: https://gerrit.libreoffice.org/9113
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 6382d74..e1d84f3 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -2427,7 +2427,8 @@ bool SwDoc::ConvertFieldsToText()
                     SwPaM aPam1(*pTxtFld->GetpTxtNode(), *pTxtFld->GetStart());
                     aPam1.Move();
                     //insert first to keep the field's attributes
-                    InsertString( aPam1, sText );
+                    if (!sText.isEmpty())
+                        InsertString( aPam1, sText );
                     SwPaM aPam2(*pTxtFld->GetpTxtNode(), *pTxtFld->GetStart());
                     aPam2.SetMark();
                     aPam2.Move();
commit c4e5b8efd740620fc2fb4335bcf14a49caa01846
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu May 8 23:42:28 2014 +0200

    Fix "symbol aliasing" code
    
    (cherry picked from commit 434c5d7845ab25f8a518e7bec910f8628725d5b9)
    Conflicts:
    	vcl/source/gdi/impfont.cxx
    
    Change-Id: Ic4605c40b9f3467f84732a0e3c956976fae68277
    Reviewed-on: https://gerrit.libreoffice.org/9285
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/gdi/metric.cxx b/vcl/source/gdi/metric.cxx
index 7aad7fb..d708ca2 100644
--- a/vcl/source/gdi/metric.cxx
+++ b/vcl/source/gdi/metric.cxx
@@ -364,12 +364,15 @@ int ImplFontCharMap::GetGlyphIndex( sal_uInt32 cChar ) const
     // check that we are inside any range
     if( (nRange == 0) && (cChar < mpRangeCodes[0]) ) {
         // symbol aliasing gives symbol fonts a second chance
-        const bool bSymbolic = (mpRangeCodes[0]>=0xF000) & (mpRangeCodes[1]<=0xF0FF);
+        const bool bSymbolic = cChar <= 0xFF && (mpRangeCodes[0]>=0xF000) & (mpRangeCodes[1]<=0xF0FF);
         if( !bSymbolic )
             return 0;
         // check for symbol aliasing (U+00xx <-> U+F0xx)
         cChar |= 0xF000;
         nRange = ImplFindRangeIndex( cChar );
+        if( (nRange == 0) && (cChar < mpRangeCodes[0]) ) {
+            return 0;
+        }
     }
     // check that we are inside a range
     if( (nRange & 1) != 0 )
commit 3c80db3ecfc9cbdea8813aa4dc35b47d55adc602
Author: Eike Rathke <erack at redhat.com>
Date:   Fri May 9 00:11:06 2014 +0200

    resolve fdo#77509 memory corruption / crash in Consolidate
    
    Regression introduced with c81dec478ab0618f2acd2580654a93d3a7185444
    memcpy some sizeof(OUString) is doomed to fail.
    
    Change-Id: I81dc9cc7eaf02607ed05b4d284a7e5e462eeeb0a
    (cherry picked from commit e891afeccba8f20f8bdaeacb20f2215cfcb1abfd)
    Reviewed-on: https://gerrit.libreoffice.org/9282
    Reviewed-by: Kohei Yoshida <libreoffice at kohei.us>
    Tested-by: Kohei Yoshida <libreoffice at kohei.us>

diff --git a/sc/inc/consoli.hxx b/sc/inc/consoli.hxx
index 9ae5060..e93ea8a 100644
--- a/sc/inc/consoli.hxx
+++ b/sc/inc/consoli.hxx
@@ -80,11 +80,10 @@ private:
     double**            ppCount;
     double**            ppSumSqr;
     ScReferenceList**   ppRefs;
-    OUString*           mpColHeaders;
-    OUString*           mpRowHeaders;
+    ::std::vector<OUString> maColHeaders;
+    ::std::vector<OUString> maRowHeaders;
+    ::std::vector<OUString> maTitles;
     SCSIZE              nDataCount;
-    SCSIZE              nTitleCount;
-    OUString*           mpTitles;
     SCSIZE**            ppTitlePos;
     sal_Bool                bCornerUsed;
     OUString            aCornerText;        // only for bColByName && bRowByName
diff --git a/sc/source/core/tool/consoli.cxx b/sc/source/core/tool/consoli.cxx
index 3dbe8f9..c2a5121 100644
--- a/sc/source/core/tool/consoli.cxx
+++ b/sc/source/core/tool/consoli.cxx
@@ -70,16 +70,9 @@ void ScReferenceList::AddEntry( SCCOL nCol, SCROW nRow, SCTAB nTab )
 }
 
 template< typename T >
-static void lcl_AddString( OUString*& pData, T& nCount, const OUString& rInsert )
+static void lcl_AddString( ::std::vector<OUString>& rData, T& nCount, const OUString& rInsert )
 {
-    OUString* pOldData = pData;
-    pData = new OUString[ nCount+1 ];
-    if (pOldData)
-    {
-        memcpy( pData, pOldData, nCount * sizeof(OUString) );
-        delete[] pOldData;
-    }
-    pData[nCount] = rInsert;
+    rData.push_back( rInsert);
     ++nCount;
 }
 
@@ -95,11 +88,7 @@ ScConsData::ScConsData() :
     ppCount(NULL),
     ppSumSqr(NULL),
     ppRefs(NULL),
-    mpColHeaders(NULL),
-    mpRowHeaders(NULL),
     nDataCount(0),
-    nTitleCount(0),
-    mpTitles(NULL),
     ppTitlePos(NULL),
     bCornerUsed(false)
 {
@@ -140,16 +129,12 @@ void ScConsData::DeleteData()
     DELETEARR( ppSumSqr,nColCount );
     DELETEARR( ppUsed,  nColCount );                // erst nach ppRefs !!!
     DELETEARR( ppTitlePos, nRowCount );
-    delete[] mpColHeaders;
-    mpColHeaders = NULL;
-    delete[] mpRowHeaders;
-    mpRowHeaders = NULL;
-    delete[] mpTitles;
-    mpTitles = NULL;
-    nTitleCount = 0;
+    ::std::vector<OUString>().swap( maColHeaders);
+    ::std::vector<OUString>().swap( maRowHeaders);
+    ::std::vector<OUString>().swap( maTitles);
     nDataCount = 0;
 
-    if (bColByName) nColCount = 0;                  // sonst stimmt mpColHeaders nicht
+    if (bColByName) nColCount = 0;                  // sonst stimmt maColHeaders nicht
     if (bRowByName) nRowCount = 0;
 
     bCornerUsed = false;
@@ -256,10 +241,10 @@ void ScConsData::AddFields( ScDocument* pSrcDoc, SCTAB nTab,
             {
                 bool bFound = false;
                 for (SCSIZE i=0; i<nColCount && !bFound; i++)
-                    if ( mpColHeaders[i] == aTitle )
+                    if ( maColHeaders[i] == aTitle )
                         bFound = true;
                 if (!bFound)
-                    lcl_AddString( mpColHeaders, nColCount, aTitle );
+                    lcl_AddString( maColHeaders, nColCount, aTitle );
             }
         }
     }
@@ -273,10 +258,10 @@ void ScConsData::AddFields( ScDocument* pSrcDoc, SCTAB nTab,
             {
                 bool bFound = false;
                 for (SCSIZE i=0; i<nRowCount && !bFound; i++)
-                    if ( mpRowHeaders[i] == aTitle )
+                    if ( maRowHeaders[i] == aTitle )
                         bFound = true;
                 if (!bFound)
-                    lcl_AddString( mpRowHeaders, nRowCount, aTitle );
+                    lcl_AddString( maRowHeaders, nRowCount, aTitle );
             }
         }
     }
@@ -289,7 +274,8 @@ void ScConsData::AddName( const OUString& rName )
 
     if (bReference)
     {
-        lcl_AddString( mpTitles, nTitleCount, rName );
+        maTitles.push_back( rName);
+        size_t nTitleCount = maTitles.size();
 
         for (nArrY=0; nArrY<nRowCount; nArrY++)
         {
@@ -528,7 +514,7 @@ void ScConsData::AddData( ScDocument* pSrcDoc, SCTAB nTab,
             {
                 bool bFound = false;
                 for (SCSIZE i=0; i<nColCount && !bFound; i++)
-                    if ( mpColHeaders[i] == aTitle )
+                    if ( maColHeaders[i] == aTitle )
                     {
                         nPos = static_cast<SCCOL>(i);
                         bFound = true;
@@ -549,7 +535,7 @@ void ScConsData::AddData( ScDocument* pSrcDoc, SCTAB nTab,
             {
                 bool bFound = false;
                 for (SCSIZE i=0; i<nRowCount && !bFound; i++)
-                    if ( mpRowHeaders[i] == aTitle )
+                    if ( maRowHeaders[i] == aTitle )
                     {
                         nPos = static_cast<SCROW>(i);
                         bFound = true;
@@ -661,10 +647,10 @@ void ScConsData::OutputToDocument( ScDocument* pDestDoc, SCCOL nCol, SCROW nRow,
 
     if (bColByName)
         for (SCSIZE i=0; i<nColCount; i++)
-            pDestDoc->SetString( sal::static_int_cast<SCCOL>(nStartCol+i), nRow, nTab, mpColHeaders[i] );
+            pDestDoc->SetString( sal::static_int_cast<SCCOL>(nStartCol+i), nRow, nTab, maColHeaders[i] );
     if (bRowByName)
         for (SCSIZE j=0; j<nRowCount; j++)
-            pDestDoc->SetString( nCol, sal::static_int_cast<SCROW>(nStartRow+j), nTab, mpRowHeaders[j] );
+            pDestDoc->SetString( nCol, sal::static_int_cast<SCROW>(nStartRow+j), nTab, maRowHeaders[j] );
 
     nCol = nStartCol;
     nRow = nStartRow;
@@ -774,7 +760,7 @@ void ScConsData::OutputToDocument( ScDocument* pDestDoc, SCCOL nCol, SCROW nRow,
 
                 //  Zwischentitel
 
-                if (ppTitlePos && mpTitles && mpRowHeaders)
+                if (ppTitlePos && !maTitles.empty() && !maRowHeaders.empty())
                 {
                     OUString aDelim( " / " );
                     for (SCSIZE nPos=0; nPos<nDataCount; nPos++)
@@ -786,9 +772,9 @@ void ScConsData::OutputToDocument( ScDocument* pDestDoc, SCCOL nCol, SCROW nRow,
                                 bDo = false;                                    // leer
                         if ( bDo && nTPos < nNeeded )
                         {
-                            aString =  mpRowHeaders[nArrY];
+                            aString =  maRowHeaders[nArrY];
                             aString += aDelim;
-                            aString += mpTitles[nPos];
+                            aString += maTitles[nPos];
                             pDestDoc->SetString( nCol-1, nRow+nArrY+nTPos, nTab, aString );
                         }
                     }
commit 550f9b2eac2bc8c836d914b636484644c674f085
Author: Laurent Balland-Poirier <laurent.balland-poirier at laposte.net>
Date:   Tue Apr 15 14:34:50 2014 +0200

    fdo#77451 Detect AOO 4.x for SvXMLImport::needFixPositionAfterZ
    
    Old versions of OOo and AOO need a fix for Z paths. But AOO 4.0 did not
    fix it neither.
    
    Change-Id: I29af75035c7c059b69fcdc3a1ce27b617a30dbd1
    Reviewed-on: https://gerrit.libreoffice.org/9012
    Tested-by: Michael Stahl <mstahl at redhat.com>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    (cherry picked from commit 3d2a17fd2e9cde29f12268ddfccc3f5b51455722)
    Signed-off-by: Michael Stahl <mstahl at redhat.com>

diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index ae94d31..65c3084 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -1755,10 +1755,12 @@ bool SvXMLImport::needFixPositionAfterZ() const
     bool bWrongPositionAfterZ( false );
     sal_Int32 nUPD( 0 );
     sal_Int32 nBuildId( 0 );
-    if ( getBuildIds( nUPD, nBuildId ) &&
-       ( ( nUPD == 641 ) || ( nUPD == 645 ) || ( nUPD == 680 ) || ( nUPD == 300 ) ||
-         ( nUPD == 310 ) || ( nUPD == 320 ) || ( nUPD == 330 ) || ( nUPD == 340 ) ||
-         ( nUPD == 350 && nBuildId < 202 ) ) )
+    if ( getBuildIds( nUPD, nBuildId ) && // test OOo and old versions of LibO and AOO
+       ( ( ( nUPD == 641 ) || ( nUPD == 645 ) || ( nUPD == 680 ) || ( nUPD == 300 ) ||
+           ( nUPD == 310 ) || ( nUPD == 320 ) || ( nUPD == 330 ) || ( nUPD == 340 ) ||
+           ( nUPD == 350 && nBuildId < 202 ) )
+       || ( getGeneratorVersion() >= SvXMLImport::AOO_40x     // test if AOO 4.x
+         && getGeneratorVersion() < SvXMLImport::AOO_4x ) ) )
     {
         bWrongPositionAfterZ = true;
     }
commit fd36be8bcb07a27d5b299db16fd99f042eb8fc1e
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Sat May 3 00:50:46 2014 -0400

    fdo#78062: Broadcast only on non-empty cells within deleted range.
    
    We don't want to broadcast over the whole selected range, which may be
    the whole sheet which is well over 1 billion cells !
    
    (cherry picked from commit af7df25bcc8bc95462e2b3bf8c003d035111a479)
    
    Conflicts:
    	sc/source/ui/inc/undobase.hxx
    	sc/source/ui/undo/undobase.cxx
    
    Change-Id: I7c139ce5efe09312cf824e35f0efe551184032eb
    Reviewed-on: https://gerrit.libreoffice.org/9240
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/inc/columnspanset.hxx b/sc/inc/columnspanset.hxx
index 62e96a8..c12f13e 100644
--- a/sc/inc/columnspanset.hxx
+++ b/sc/inc/columnspanset.hxx
@@ -39,8 +39,10 @@ struct RowSpan
  */
 class ColumnSpanSet : boost::noncopyable
 {
+public:
     typedef mdds::flat_segment_tree<SCROW, bool> ColumnSpansType;
 
+private:
     struct ColumnType
     {
         ColumnSpansType maSpans;
@@ -81,6 +83,12 @@ public:
     void set(SCTAB nTab, SCCOL nCol, SCROW nRow1, SCROW nRow2, bool bVal);
     void set(const ScRange& rRange, bool bVal);
 
+    /**
+     * Scan specified range in a specified sheet and mark all non-empty cells
+     * with specified boolean value.
+     */
+    void scan(const ScDocument& rDoc, SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool bVal);
+
     void executeAction(Action& ac) const;
     void executeColumnAction(ScDocument& rDoc, ColumnAction& ac) const;
 };
diff --git a/sc/source/core/data/columnspanset.cxx b/sc/source/core/data/columnspanset.cxx
index efa51b5..7bc517b 100644
--- a/sc/source/core/data/columnspanset.cxx
+++ b/sc/source/core/data/columnspanset.cxx
@@ -20,6 +20,29 @@
 
 namespace sc {
 
+namespace {
+
+class ColumnScanner
+{
+    ColumnSpanSet::ColumnSpansType& mrRanges;
+    bool mbVal;
+public:
+    ColumnScanner(ColumnSpanSet::ColumnSpansType& rRanges, bool bVal) :
+        mrRanges(rRanges), mbVal(bVal) {}
+
+    void operator() (const sc::CellStoreType::value_type& node, size_t nOffset, size_t nDataSize)
+    {
+        if (node.type == sc::element_type_empty)
+            return;
+
+        size_t nRow = node.position + nOffset;
+        size_t nEndRow = nRow + nDataSize; // Last row of current block plus 1
+        mrRanges.insert_back(nRow, nEndRow, mbVal);
+    }
+};
+
+}
+
 RowSpan::RowSpan(SCROW nRow1, SCROW nRow2) : mnRow1(nRow1), mnRow2(nRow2) {}
 
 ColumnSpanSet::ColumnType::ColumnType(SCROW nStart, SCROW nEnd, bool bInit) :
@@ -94,6 +117,30 @@ void ColumnSpanSet::set(const ScRange& rRange, bool bVal)
     }
 }
 
+void ColumnSpanSet::scan(
+    const ScDocument& rDoc, SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool bVal)
+{
+    if (!ValidColRow(nCol1, nRow1) || !ValidColRow(nCol2, nRow2))
+        return;
+
+    if (nCol1 > nCol2 || nRow1 > nRow2)
+        return;
+
+    const ScTable* pTab = rDoc.FetchTable(nTab);
+    if (!pTab)
+        return;
+
+    for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
+    {
+        ColumnType& rCol = getColumn(nTab, nCol);
+
+        const CellStoreType& rSrcCells = pTab->aCol[nCol].maCells;
+
+        ColumnScanner aScanner(rCol.maSpans, bVal);
+        ParseBlock(rSrcCells.begin(), rSrcCells, aScanner, nRow1, nRow2);
+    }
+}
+
 void ColumnSpanSet::executeAction(Action& ac) const
 {
     for (size_t nTab = 0; nTab < maDoc.size(); ++nTab)
diff --git a/sc/source/ui/inc/undobase.hxx b/sc/source/ui/inc/undobase.hxx
index 5c9df4b..fd84303 100644
--- a/sc/source/ui/inc/undobase.hxx
+++ b/sc/source/ui/inc/undobase.hxx
@@ -24,6 +24,9 @@
 #include "global.hxx"
 #include "address.hxx"
 #include "docsh.hxx"
+#include <columnspanset.hxx>
+
+#include <boost/ptr_container/ptr_map.hpp>
 
 class ScDocument;
 class ScDocShell;
@@ -39,6 +42,8 @@ class ScSimpleUndo: public SfxUndoAction
 
 public:
                     TYPEINFO();
+    typedef boost::ptr_map<SCTAB,sc::ColumnSpanSet> DataSpansType;
+
                     ScSimpleUndo( ScDocShell* pDocSh );
     virtual         ~ScSimpleUndo();
 
@@ -59,6 +64,14 @@ protected:
 
     void BroadcastChanges( const ScRange& rRange );
 
+    /**
+     * Broadcast changes on specified spans.
+     *
+     * @param rSpans container that specifies all spans whose changes need to
+     *               be broadcasted.
+     */
+    void BroadcastChanges( const DataSpansType& rSpans );
+
     static void     ShowTable( SCTAB nTab );
     static void     ShowTable( const ScRange& rRange );
 };
diff --git a/sc/source/ui/inc/undoblk.hxx b/sc/source/ui/inc/undoblk.hxx
index 3637cab..665cd70 100644
--- a/sc/source/ui/inc/undoblk.hxx
+++ b/sc/source/ui/inc/undoblk.hxx
@@ -274,7 +274,11 @@ public:
 
     virtual OUString GetComment() const;
 
+    void SetDataSpans( const boost::shared_ptr<DataSpansType>& pSpans );
+
 private:
+    boost::shared_ptr<DataSpansType> mpDataSpans; // Spans of non-empty cells.
+
     ScRange         aRange;
     ScMarkData      aMarkData;
     ScDocument*     pUndoDoc;       // Block mark and deleted data
diff --git a/sc/source/ui/undo/undobase.cxx b/sc/source/ui/undo/undobase.cxx
index 77f8345..609b6fe 100644
--- a/sc/source/ui/undo/undobase.cxx
+++ b/sc/source/ui/undo/undobase.cxx
@@ -30,8 +30,7 @@
 #include "queryparam.hxx"
 #include "subtotalparam.hxx"
 #include "globstr.hrc"
-
-// STATIC DATA -----------------------------------------------------------
+#include <column.hxx>
 
 TYPEINIT1(ScSimpleUndo,     SfxUndoAction);
 TYPEINIT1(ScBlockUndo,      ScSimpleUndo);
@@ -148,6 +147,48 @@ void ScSimpleUndo::BroadcastChanges( const ScRange& rRange )
     pDoc->BroadcastCells(rRange, SC_HINT_DATACHANGED);
 }
 
+namespace {
+
+class SpanBroadcaster : public sc::ColumnSpanSet::ColumnAction
+{
+    ScDocument& mrDoc;
+    SCTAB mnCurTab;
+    SCCOL mnCurCol;
+
+public:
+    SpanBroadcaster( ScDocument& rDoc ) : mrDoc(rDoc), mnCurTab(-1), mnCurCol(-1) {}
+
+    virtual void startColumn( ScColumn* pCol )
+    {
+        mnCurTab = pCol->GetTab();
+        mnCurCol = pCol->GetCol();
+    }
+
+    virtual void execute( SCROW nRow1, SCROW nRow2, bool bVal )
+    {
+        if (!bVal)
+            return;
+
+        ScRange aRange(mnCurTab, mnCurCol, nRow1, mnCurTab, mnCurCol, nRow2);
+        mrDoc.BroadcastCells(aRange, SC_HINT_DATACHANGED);
+    };
+};
+
+}
+
+void ScSimpleUndo::BroadcastChanges( const DataSpansType& rSpans )
+{
+    ScDocument* pDoc = pDocShell->GetDocument();
+    SpanBroadcaster aBroadcaster(*pDoc);
+
+    DataSpansType::const_iterator it = rSpans.begin(), itEnd = rSpans.end();
+    for (; it != itEnd; ++it)
+    {
+        const sc::ColumnSpanSet& rSet = *it->second;
+        rSet.executeColumnAction(*pDoc, aBroadcaster);
+    }
+}
+
 void ScSimpleUndo::ShowTable( SCTAB nTab )
 {
     ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx
index a06a076..6c258e0 100644
--- a/sc/source/ui/undo/undoblk3.cxx
+++ b/sc/source/ui/undo/undoblk3.cxx
@@ -105,6 +105,11 @@ OUString ScUndoDeleteContents::GetComment() const
     return ScGlobal::GetRscString( STR_UNDO_DELETECONTENTS );    // "Delete"
 }
 
+void ScUndoDeleteContents::SetDataSpans( const boost::shared_ptr<DataSpansType>& pSpans )
+{
+    mpDataSpans = pSpans;
+}
+
 void ScUndoDeleteContents::SetChangeTrack()
 {
     ScChangeTrack* pChangeTrack = pDocShell->GetDocument()->GetChangeTrack();
@@ -183,8 +188,13 @@ void ScUndoDeleteContents::Undo()
     EndUndo();
 
     if (nFlags & IDF_CONTENTS)
+    {
         // Broadcast only when the content changes. fdo#74687
-        BroadcastChanges(aRange);
+        if (mpDataSpans)
+            BroadcastChanges(*mpDataSpans);
+        else
+            BroadcastChanges(aRange);
+    }
 
     HelperNotifyChanges::NotifyIfChangesListeners(*pDocShell, aRange);
 }
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index dd4e562..e308cad 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -1854,6 +1854,9 @@ void ScViewFunc::DeleteContents( sal_uInt16 nFlags, bool bRecord )
                                        aFuncMark );
     }
 
+    // To keep track of all non-empty cells within the deleted area.
+    boost::shared_ptr<ScSimpleUndo::DataSpansType> pDataSpans;
+
     if ( bRecord )
     {
         pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
@@ -1880,6 +1883,26 @@ void ScViewFunc::DeleteContents( sal_uInt16 nFlags, bool bRecord )
         // do not copy note captions to undo document
         nUndoDocFlags |= IDF_NOCAPTIONS;
         pDoc->CopyToDocument( aCopyRange, nUndoDocFlags, bMulti, pUndoDoc, &aFuncMark );
+
+        pDataSpans.reset(new ScSimpleUndo::DataSpansType);
+
+        for (itr = aFuncMark.begin(); itr != itrEnd; ++itr)
+        {
+            nTab = *itr;
+
+            SCCOL nCol1 = aCopyRange.aStart.Col(), nCol2 = aCopyRange.aEnd.Col();
+            SCROW nRow1 = aCopyRange.aStart.Row(), nRow2 = aCopyRange.aEnd.Row();
+
+            std::pair<ScSimpleUndo::DataSpansType::iterator,bool> r =
+                pDataSpans->insert(nTab, new sc::ColumnSpanSet(false));
+
+            if (r.second)
+            {
+                ScSimpleUndo::DataSpansType::iterator it = r.first;
+                sc::ColumnSpanSet* pSet = it->second;
+                pSet->scan(*pDoc, nTab, nCol1, nRow1, nCol2, nRow2, true);
+            }
+        }
     }
 
     HideAllCursors();   // for if summary is cancelled
@@ -1894,9 +1917,12 @@ void ScViewFunc::DeleteContents( sal_uInt16 nFlags, bool bRecord )
 
     if ( bRecord )
     {
-        pDocSh->GetUndoManager()->AddUndoAction(
-            new ScUndoDeleteContents( pDocSh, aFuncMark, aExtendedRange,
-                                      pUndoDoc, bMulti, nFlags, bDrawUndo ) );
+        ScUndoDeleteContents* pUndo =
+            new ScUndoDeleteContents(
+                pDocSh, aFuncMark, aExtendedRange, pUndoDoc, bMulti, nFlags, bDrawUndo);
+        pUndo->SetDataSpans(pDataSpans);
+
+        pDocSh->GetUndoManager()->AddUndoAction(pUndo);
     }
 
     if (!AdjustRowHeight( aExtendedRange.aStart.Row(), aExtendedRange.aEnd.Row() ))
commit 9fe592a77c10577570f79ee7055674eee048151a
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu May 8 13:10:46 2014 +0200

    Resolves: rhbz#1092589 Thoroughly check whether JRE is still present
    
    ...not only on Mac OS X.  Was able to reproduce this on Fedora 20 where current
    JRE was /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.5.x86_64 but for whatever reason
    there was also a left-behind /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.0.x86_64 tree
    (containing just a handful of sub-dirs, but no real content) that was still
    recorded in my ~/.config/libreoffice/4/user/config/javasettings_Linux_X86_64.xml
    
    Change-Id: Ie477c5a506a430f6c29525f6c558dbc18bbf1c48
    (cherry picked from commit f5ed2f4e926016d23617355c94dd2292b40e6986)
    Reviewed-on: https://gerrit.libreoffice.org/9279
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index a3449c3..d3650f9 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -765,10 +765,10 @@ javaPluginError jfw_plugin_existJRE(const JavaInfo *pInfo, sal_Bool *exist)
     {
         ret = JFW_PLUGIN_E_ERROR;
     }
-#ifdef MACOSX
     //We can have the situation that the JavaVM runtime library is not
     //contained within JAVA_HOME. Then the check for JAVA_HOME would return
     //true although the runtime library may not be loadable.
+    //Or the JAVA_HOME directory of a deinstalled JRE left behind.
     if (ret == JFW_PLUGIN_E_NONE && *exist == sal_True)
     {
         OUString sRuntimeLib = getRuntimeLib(pInfo->arVendorData);
@@ -796,7 +796,6 @@ javaPluginError jfw_plugin_existJRE(const JavaInfo *pInfo, sal_Bool *exist)
                        + sRuntimeLib + " \n");
         }
     }
-#endif
     return ret;
 }
 
commit 56068a0467967d55118bd3ec64b05106a4d547f6
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu May 8 08:26:46 2014 +0200

    Handle bad SwWW8ImplReader::GetCol input
    
    With previously found offenders out of the way, looks like
    sw/qa/core/data/ww8/pass/CVE-2009-3302-2.doc is the only case that triggers
    this, and that is likely deliberately malformed input.
    
    As the whole ww8 parser appears not to be build around robust eager input
    validation and error signalling, there is little more we can do here than throw
    up our hands in despair.
    
    Change-Id: Idf61fcf14a784cef1539654f2825c013c218987f
    (cherry picked from commit 9beda5ab8feaeb6d5e1c64e094065b02551532a4)

diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 685feae..43c93cd 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -126,8 +126,10 @@ ColorData SwWW8ImplReader::GetCol(sal_uInt8 nIco)
         COL_CYAN, COL_GREEN, COL_MAGENTA, COL_RED, COL_BROWN, COL_GRAY,
         COL_LIGHTGRAY
     };
-
-    return eSwWW8ColA[nIco];
+    SAL_WARN_IF(
+        nIco >= SAL_N_ELEMENTS(eSwWW8ColA), "sw.ww8",
+        "ico " << sal_uInt32(nIco) << " >= " << SAL_N_ELEMENTS(eSwWW8ColA));
+    return nIco < SAL_N_ELEMENTS(eSwWW8ColA) ? eSwWW8ColA[nIco] : COL_AUTO;
 }
 
 inline sal_uInt32 MSRoundTweak(sal_uInt32 x)
commit 23dc5039cfebf0eee16f8b2365342f17755a1299
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jan 29 10:01:05 2014 +0100

    sw: CheckBookmarks: can't store OOo XML any more
    
    Change-Id: Ib9e92043d8483feb47f024ee067f2103625dd031
    (cherry picked from commit 00a63ba1c7e89563ea1aeeca46873e3e205e8632)
    Signed-off-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/sw/qa/complex/writer/CheckBookmarks.java b/sw/qa/complex/writer/CheckBookmarks.java
index 2a42711..a6dab9c 100644
--- a/sw/qa/complex/writer/CheckBookmarks.java
+++ b/sw/qa/complex/writer/CheckBookmarks.java
@@ -121,7 +121,7 @@ public class CheckBookmarks {
         actualHashes.m_nDeleteRandomHash = BookmarkHashes.getBookmarksHash(m_xDoc);
         insertLinebreaks(007);
         actualHashes.m_nLinebreakHash = BookmarkHashes.getBookmarksHash(m_xDoc);
-        m_xOdfReloadedDoc = reloadFrom("StarOffice XML (Writer)", "odf");
+        m_xOdfReloadedDoc = reloadFrom("writer8", "odf");
         actualHashes.m_nOdfReloadHash = BookmarkHashes.getBookmarksHash(m_xOdfReloadedDoc);
         //m_xMsWordReloadedDoc = reloadFrom("MS Word 97", "doc");
         //actualHashes.m_nMsWordReloadHash = BookmarkHashes.getBookmarksHash(m_xMsWordReloadedDoc);
commit 4203b0c07b72e3c30dfe3abd51e1fc31e60e052b
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue May 6 22:31:59 2014 +0200

    sw: call SwEditShell::CalcLayout to avoid crashes
    
    (i.e. similar to 83c0018dba00ae0c0cf5b179cfc7a47ce08ff2b7 on master)
    
    Change-Id: Ia24c7cadd382b89d43bc2e1081ef85751cb6eca6
    Reviewed-on: https://gerrit.libreoffice.org/9262
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx
index 316cb9c..dc5a750 100644
--- a/sw/qa/extras/inc/swmodeltestbase.hxx
+++ b/sw/qa/extras/inc/swmodeltestbase.hxx
@@ -30,6 +30,7 @@
 #include <docsh.hxx>
 #include <doc.hxx>
 #include <rootfrm.hxx>
+#include <editsh.hxx>
 
 #include <libxml/xmlwriter.h>
 #include <libxml/xpath.h>
@@ -211,7 +212,7 @@ private:
     {
         SwXTextDocument* pTxtDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get());
         SwDoc* pDoc = pTxtDoc->GetDocShell()->GetDoc();
-        pDoc->GetCurrentViewShell()->CalcLayout();
+        dynamic_cast<SwEditShell*>(pDoc->GetCurrentViewShell())->CalcLayout();
     }
 
 
commit 7f2801238d065bbaf8c2ada8301a8d906c07b165
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed May 7 14:54:54 2014 +0200

    fdo#75519: fix chapter cross references
    
    It would be possible to modify the condition in
    SwChapterField::ChangeExpansion() to check for rTxtNd.GetNumRule() as
    well and make the bugdoc work again, but do we really want to use
    "chapter reference" to refer to plain numbering?  Perhaps it would be
    better to add a "numbering reference" field type; without investigating
    what Word actually does here and what the actual problem is that was
    supposedly fixed here (which is not possible given there's no reproducer
    document) it's best for now to just revert it.
    
    (regression from commit 6319803762d051c4aa645692cde7245a1bbcf7ee)
    
    Change-Id: I7eb9ea46e42729c53c350ff450d49a1eb84ee8eb
    (cherry picked from commit cc0a7699bb79efad488094e33464d4793758ee3f)
    Reviewed-on: https://gerrit.libreoffice.org/9271
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/fields/chpfld.cxx b/sw/source/core/fields/chpfld.cxx
index e7fe520..86c6de2 100644
--- a/sw/source/core/fields/chpfld.cxx
+++ b/sw/source/core/fields/chpfld.cxx
@@ -122,41 +122,11 @@ void SwChapterField::ChangeExpansion(const SwFrm* pFrm,
 
 void SwChapterField::ChangeExpansion(const SwTxtNode &rTxtNd, sal_Bool bSrchNum)
 {
-    //i120759,this function is for both the reference chapter field and normal chapter field
-    //bSrchNum can distinguish the two types,to the latter type,the outline num rule is must...
     sNumber = OUString();
     sTitle = OUString();
     sPost = OUString();
     sPre = OUString();
-    //The reference chapter field of normal num rule will be handled in this code segment
-    if (bSrchNum && !rTxtNd.IsOutline())
-    {
-        SwNumRule* pRule(rTxtNd.GetNumRule());
-        if (rTxtNd.IsCountedInList() && pRule)
-        {
-            sNumber = rTxtNd.GetNumString(false);
-
-            int nListLevel = rTxtNd.GetActualListLevel();
-
-            if (nListLevel < 0)
-                nListLevel = 0;
 
-            if (nListLevel >= MAXLEVEL)
-                nListLevel = MAXLEVEL - 1;
-
-            const SwNumFmt& rNFmt = pRule->Get(static_cast<unsigned short>(nListLevel));
-            sPost = rNFmt.GetSuffix();
-            sPre = rNFmt.GetPrefix();
-        }
-        else
-        {
-            sNumber = "??";
-        }
-        sTitle = removeControlChars(rTxtNd.GetExpandTxt());
-    }
-    else
-    {
-    //End
     SwDoc* pDoc = (SwDoc*)rTxtNd.GetDoc();
     const SwTxtNode *pTxtNd = rTxtNd.FindOutlineNodeOfLevel( nLevel );
     if( pTxtNd )
@@ -216,7 +186,6 @@ void SwChapterField::ChangeExpansion(const SwTxtNode &rTxtNd, sal_Bool bSrchNum)
         sTitle = removeControlChars(pTxtNd->GetExpandTxt(0, -1, false, false, false, false));
 
     }
-    }
 }
 
 bool SwChapterField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
commit 2c09d3002791b4ce6c2f4a323fe71988306145a4
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed May 7 17:52:16 2014 +0200

    fdo#74790: sw: Compare Document: fix assertions about RSID-only hints
    
    For ordinary documents the SwTxtNode::MakeFrm() would set the
    m_bFormatIgnoreStart/End flags of the RSID-only hints, but the document
    loaded by Compare Document (and Merge Document) is special because it
    is loaded, there are editing operations on it, but it has no layout,
    so the assertions about these flags trigger.
    
    (regression from 6db39dbd7378351f6476f6db25eb7110c9cfb291)
    
    Change-Id: I8a6e02b68f22e609640adbe93ff194e4081d9856
    (cherry picked from commit 80b131038d2375c9855ee5fbe225e75bdad2645e)
    Reviewed-on: https://gerrit.libreoffice.org/9274
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index d8e1fbb..072aecb 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -280,6 +280,9 @@ public:
     // delete all attributes from SwpHintsArray.
     void    ClearSwpHintsArr( bool bDelFields );
 
+    /// initialize the hints after file loading (which takes shortcuts)
+    void    FileLoadedInitHints();
+
     /// Insert pAttr into hints array. @return true iff inserted successfully
     bool    InsertHint( SwTxtAttr * const pAttr,
                   const SetAttrMode nMode = nsSetAttrMode::SETATTR_DEFAULT );
diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx
index 0ae219b..6ee3340 100644
--- a/sw/source/core/doc/doccomp.cxx
+++ b/sw/source/core/doc/doccomp.cxx
@@ -1759,12 +1759,23 @@ void SwCompareData::SetRedlinesToDoc( sal_Bool bUseDocInfo )
     }
 }
 
+static bool lcl_MergePortions(SwNode *const& pNode, void *)
+{
+    if (pNode->IsTxtNode())
+    {
+        pNode->GetTxtNode()->FileLoadedInitHints();
+    }
+    return true;
+}
+
 // Returns (the difference count?) if something is different
 long SwDoc::CompareDoc( const SwDoc& rDoc )
 {
     if( &rDoc == this )
         return 0;
 
+    const_cast<SwDoc&>(rDoc).GetNodes().ForEach(&lcl_MergePortions);
+
     long nRet = 0;
 
     // Get comparison options
@@ -2008,6 +2019,8 @@ long SwDoc::MergeDoc( const SwDoc& rDoc )
 
     long nRet = 0;
 
+    const_cast<SwDoc&>(rDoc).GetNodes().ForEach(&lcl_MergePortions);
+
     GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
 
     SwDoc& rSrcDoc = (SwDoc&)rDoc;
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index ea5af25..a5a7031 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -257,14 +257,19 @@ SwTxtNode::~SwTxtNode()
     InitSwParaStatistics( false );
 }
 
-SwCntntFrm *SwTxtNode::MakeFrm( SwFrm* pSib )
+void SwTxtNode::FileLoadedInitHints()
 {
-    // fdo#52028: ODF file import does not result in MergePortions being called
-    // for every attribute, since that would be inefficient.  So call it here.
     if (m_pSwpHints)
     {
         m_pSwpHints->MergePortions(*this);
     }
+}
+
+SwCntntFrm *SwTxtNode::MakeFrm( SwFrm* pSib )
+{
+    // fdo#52028: ODF file import does not result in MergePortions being called
+    // for every attribute, since that would be inefficient.  So call it here.
+    FileLoadedInitHints();
     SwCntntFrm *pFrm = new SwTxtFrm( this, pSib );
     return pFrm;
 }
commit 7b8fc1f518af83ead36d679a6dc795a998735d7a
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed May 7 22:15:07 2014 +0200

    fdo#62176: Revert "n757419: Hidden/Non-wrapping text."
    
    This reverts commit 0f8f92a5b6fcba1fef456539bb929819a9162a85.
    
    Negative fo:text-indent values are explicitly allowed by ODF, so
    whatever problem was worked around here needs to be fixed differently.
    
    Conflicts:
    	svx/source/unodraw/unoshape.cxx
    
    Change-Id: I7e2ae38c4c950e37f0c96a32164a5b6ec10fd47d
    (cherry picked from commit 3b566ca82ebbe754902c1837e11da5fba1e6c93d)
    Reviewed-on: https://gerrit.libreoffice.org/9275
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 77fa691..40feb56 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -4295,18 +4295,11 @@ uno::Any SvxItemPropertySet_getPropertyValue( const SvxItemPropertySet& rPropSet
 
 void SvxItemPropertySet_setPropertyValue( const SvxItemPropertySet& rPropSet, const SfxItemPropertySimpleEntry* pMap, const uno::Any& rVal, SfxItemSet& rSet )
 {
-    uno::Any aVal(rVal);
     if(!pMap || !pMap->nWID)
         return;
 
     bool bDontConvertNegativeValues = ( pMap->nWID == XATTR_FILLBMP_SIZEX || pMap->nWID == XATTR_FILLBMP_SIZEY );
-    if( pMap->nWID == EE_PARA_LRSPACE ) // n#757419 Don't import negative values
-    {
-        sal_Int32 nVal = sal_Int32();
-        if( (aVal >>= nVal) && nVal < 0 )
-            aVal <<= ( sal_Int32 ) 0;
-    }
-    rPropSet.setPropertyValue( pMap, aVal, rSet, bDontConvertNegativeValues );
+    rPropSet.setPropertyValue( pMap, rVal, rSet, bDontConvertNegativeValues );
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 60f7e575de012f42e5c32870bd439bc03a6e8580
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed May 7 12:25:33 2014 +0100

    Resolves: fdo#68600 limit comment width
    
    (cherry picked from commit 087fcc43b13985b03d935dfd1e25a0d36d58cb1e)
    
    Conflicts:
    	sfx2/source/dialog/dinfdlg.cxx
    
    Change-Id: I7060ae18a98e0793a936834b398f1e232d336672
    Reviewed-on: https://gerrit.libreoffice.org/9269
    Reviewed-by: Kohei Yoshida <libreoffice at kohei.us>
    Tested-by: Kohei Yoshida <libreoffice at kohei.us>

diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 4975c61..a7c6c95 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -630,19 +630,18 @@ bool SfxDocumentInfoItem::PutValue( const Any& rVal, sal_uInt8 nMemberId )
     return bRet;
 }
 
-//------------------------------------------------------------------------
 SfxDocumentDescPage::SfxDocumentDescPage( Window * pParent, const SfxItemSet& rItemSet )
     : SfxTabPage(pParent, "DescriptionInfoPage", "sfx/ui/descriptioninfopage.ui", rItemSet)
     , m_pInfoItem   ( NULL )
-
 {
     get(m_pTitleEd, "title");
     get(m_pThemaEd, "subject");
     get(m_pKeywordsEd, "keywords");
     get(m_pCommentEd, "comments");
+    m_pCommentEd->set_width_request(m_pKeywordsEd->get_preferred_size().Width());
+    m_pCommentEd->set_height_request(m_pCommentEd->GetTextHeight() * 16);
 }
 
-//------------------------------------------------------------------------
 SfxTabPage *SfxDocumentDescPage::Create(Window *pParent, const SfxItemSet &rItemSet)
 {
      return new SfxDocumentDescPage(pParent, rItemSet);
commit c21334c1ee69aaec36ff99021eab0594d051535b
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed May 7 00:34:06 2014 -0400

    fdo#77944: No need to store updated formulas in undo document when moving.
    
    This causes crash with dbgutil build, and I'm sure would cause issues with the
    release build as well.
    
    We now use broadcasting to handle reference update during undo of block move,
    so this old way of handling undo for block move is redundant and obviously
    causes issues.
    
    (cherry picked from commit 6cc92a2fead337eef3d9cc3e5818cfcc505e4651)
    
    Conflicts:
    	sc/source/ui/docshell/docfunc.cxx
    
    Change-Id: I9dcbb9d9e3808da3f8510eab16ad21b626f881d9
    Reviewed-on: https://gerrit.libreoffice.org/9265
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 2ce4ab8..1454b89 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -2728,7 +2728,7 @@ sal_Bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos
         ScDrawLayer::MoveCells() which may move away inserted objects to wrong
         positions (e.g. if source and destination range overlaps).*/
     pDoc->CopyFromClip( aPasteDest, aDestMark, IDF_ALL & ~(IDF_OBJECTS),
-                        pRefUndoDoc, pClipDoc, sal_True, false, bIncludeFiltered );
+                        NULL, pClipDoc, true, false, bIncludeFiltered );
 
 
     // skipped rows and merged cells don't mix
commit 1f085a2cd68c92cf92c4f56ab1bf8916dca77b12
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Mar 3 11:57:34 2014 +0100

    Resolves: fdo#77899 fax etc wizards don't start
    
    Wizards should look for templates in Template_internal, not Template_user
    
    ...as only the former reliably denotes the share/template tree where the
    wizard templates are stored.  (Presumably the latter defaulted to the former as
    long as it wasn't explicitly set in the past, but is now always explicitly set
    since 838b77f5f3d6d8fd98891e99a23ff78a6a357cb2 "Resolves: rhbz#1065807 use xdg
    ~/Templates for default Template location.")
    
    Change-Id: I7d1ac47d821c778fe342865465d0505a94b824bf
    (cherry picked from commit 97822e3cbc63d3bd110bc3c654b3fbb4d4d1904c)
    
    actively search for wizards dir in all internal templates
    
    (cherry picked from commit 5fa18dc21644f2a719bf39ec948a586fa8837b6a)
    Signed-off-by: Stephan Bergmann <sbergman at redhat.com>
    
    Conflicts:
    	wizards/com/sun/star/wizards/ui/WizardDialog.py
    
    Change-Id: I4ef6da4d9d1931917e0aaa6e110fd273bd917b26
    Signed-off-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py
index 1ff5f1c..76921d0 100644
--- a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py
+++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py
@@ -773,7 +773,7 @@ class LetterWizardDialogImpl(LetterWizardDialog):
             return None
 
     def initializeTemplates(self, xMSF):
-        sLetterPath = self.sTemplatePath + "/../common/wizard/letter"
+        sLetterPath = self.sTemplatePath + "/wizard/letter"
         self.BusinessFiles = \
             FileAccess.getFolderTitles(
                 xMSF, "bus", sLetterPath, self.resources.dictBusinessTemplate)
diff --git a/wizards/com/sun/star/wizards/ui/WizardDialog.py b/wizards/com/sun/star/wizards/ui/WizardDialog.py
index fc1ce41..08a8c2d 100644
--- a/wizards/com/sun/star/wizards/ui/WizardDialog.py
+++ b/wizards/com/sun/star/wizards/ui/WizardDialog.py
@@ -23,6 +23,7 @@ from .UnoDialog2 import UnoDialog2, Desktop, PropertyNames, UIConsts, \
 from .event.CommonListener import TerminateListenerProcAdapter
 from ..common.Resource import Resource
 from ..common.HelpIds import HelpIds
+from ..common.FileAccess import FileAccess
 from ..document.OfficeDocument import OfficeDocument
 from ..text.TextDocument import TextDocument
 
@@ -114,10 +115,17 @@ class WizardDialog(UnoDialog2):
     def initializePaths(self):
         xPropertySet = \
             self.xMSF.createInstance("com.sun.star.util.PathSettings")
-        self.sTemplatePath = \
-            xPropertySet.getPropertyValue("Template_user")[0]
         self.sUserTemplatePath = \
             xPropertySet.getPropertyValue("Template_writable")
+        myFA = FileAccess(self.xMSF)
+        aInternalPaths = xPropertySet.getPropertyValue("Template_internal")
+        self.sTemplatePath = ""
+        for path in aInternalPaths:
+            if myFA.exists(path + "/wizard", False):
+                self.sTemplatePath = path
+                break
+        if self.sTemplatePath == "":
+            raise Exception("could not find wizard templates")
             
     def addRoadmap(self):
         try:
commit 9043807b60f6b5417d6c40fc9680408f0c51a68d
Author: Jacobo Aragunde Pérez <jaragunde at igalia.com>
Date:   Tue May 6 10:45:30 2014 +0200

    fdo#39944: improve mapping between ATK and UNO roles
    
    * UNO role GROUP_BOX was not mapped to any ATK role, now it's mapped
      to ATK_ROLE_GROUPING.
    
    * UNO role COMMENT was mapped to ATK_ROLE_SCROLL_PANE, we replaced it
      with ATK_ROLE_COMMENT.
    
    We use registerRole method to map these instead of doing a direct
    association to prevent a failure in case the installed version of ATK
    doesn't contain these roles.
    
    (cherry-picked from e031c8ae1ac046fcf165213d80e83311d80a71f5 to
    address fdo#77682)
    
    Change-Id: I7e266a7e92d59b282c51934df05b53414588cc7e
    Reviewed-on: https://gerrit.libreoffice.org/9267
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk/a11y/atkwrapper.cxx b/vcl/unx/gtk/a11y/atkwrapper.cxx
index a87fe6c..a568953 100644
--- a/vcl/unx/gtk/a11y/atkwrapper.cxx
+++ b/vcl/unx/gtk/a11y/atkwrapper.cxx
@@ -287,11 +287,12 @@ static AtkRole mapToAtkRole( sal_Int16 nRole )
         roleMap[accessibility::AccessibleRole::PAGE] = registerRole("page");
         roleMap[accessibility::AccessibleRole::SECTION] = registerRole("section");
         roleMap[accessibility::AccessibleRole::FORM] = registerRole("form");
+        roleMap[accessibility::AccessibleRole::GROUP_BOX] = registerRole("grouping");
+        roleMap[accessibility::AccessibleRole::COMMENT] = registerRole("comment");
 
         // these don't exist in ATK yet
         roleMap[accessibility::AccessibleRole::END_NOTE] = registerRole("end note");
         roleMap[accessibility::AccessibleRole::FOOTNOTE] = registerRole("foot note");
-        roleMap[accessibility::AccessibleRole::GROUP_BOX] = registerRole("group box");
         roleMap[accessibility::AccessibleRole::HYPER_LINK] = registerRole("hyper link");
         roleMap[accessibility::AccessibleRole::SHAPE] = registerRole("shape");
         roleMap[accessibility::AccessibleRole::TEXT_FRAME] = registerRole("text frame");
commit 02b469b3f7b5309a500a22236f4f5e0b907a1649
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue May 6 18:14:30 2014 +0200

    Application::PostUserEvent returns a pointer dressed as sal_uLong
    
    cherry picked from commit ce53796bfaf6df5c4415fda8f641cad8a3e144a6, plus more
    cases from 93f5d5a9190e0e03bf4822663652a4b068c44f75: "The opaque PostUserEvent
    IDs are actually pointers so declare them as such.  This avoids the recurring
    mistake of storing such IDs as sal_uInt32, truncating in 64 bit environments,
    causing RemoveUserEvent to potentially not remove the event, it thus firing 'too
    late' and probably causing a crash."
    
    Change-Id: Ia5ca45e35766a7cebf0b53bcac1bd9dff29ad6ea
    Reviewed-on: https://gerrit.libreoffice.org/9259
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/dbaccess/source/ui/inc/sbagrid.hxx b/dbaccess/source/ui/inc/sbagrid.hxx
index 2d482a3..9cd7015 100644
--- a/dbaccess/source/ui/inc/sbagrid.hxx
+++ b/dbaccess/source/ui/inc/sbagrid.hxx
@@ -222,7 +222,7 @@ namespace dbaui
         ::svx::ODataAccessDescriptor    m_aDataDescriptor;
         SbaGridListener*                m_pMasterListener;
 
-        sal_Int32                       m_nAsyncDropEvent;
+        sal_uLong                       m_nAsyncDropEvent;
 
         sal_uInt16                          m_nCurrentActionColId;
             // ui actions (e.g. a context menu) may be performed on columns which aren't the current one
diff --git a/forms/source/component/Edit.hxx b/forms/source/component/Edit.hxx
index 4e280eda..5dcb173 100644
--- a/forms/source/component/Edit.hxx
+++ b/forms/source/component/Edit.hxx
@@ -132,7 +132,7 @@ class OEditControl : public OBoundControl
                         m_aChangeListeners;
 
     OUString         m_aHtmlChangeValue;
-    sal_uInt32              m_nKeyEvent;
+    sal_uLong              m_nKeyEvent;
 
 public:
     OEditControl(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext);
diff --git a/forms/source/component/FormattedField.hxx b/forms/source/component/FormattedField.hxx
index 1ea82f6..737402a 100644
--- a/forms/source/component/FormattedField.hxx
+++ b/forms/source/component/FormattedField.hxx
@@ -151,7 +151,7 @@ namespace frm
     class OFormattedControl :    public OBoundControl
                                 ,public OFormattedControl_BASE
     {
-        sal_uInt32              m_nKeyEvent;
+        sal_uLong              m_nKeyEvent;
 
     public:
         OFormattedControl(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& _rxContext);
diff --git a/fpicker/source/office/commonpicker.hxx b/fpicker/source/office/commonpicker.hxx
index 5008f68..fb5bc56 100644
--- a/fpicker/source/office/commonpicker.hxx
+++ b/fpicker/source/office/commonpicker.hxx
@@ -65,7 +65,7 @@ namespace svt
         // </properties>
 
         SvtFileDialog*      m_pDlg;
-        sal_uInt32          m_nCancelEvent;
+        sal_uLong           m_nCancelEvent;
         sal_Bool            m_bExecuting;
 
         ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >  m_xDialogParent;
diff --git a/include/svx/gridctrl.hxx b/include/svx/gridctrl.hxx
index e3e59f1..905b9cd 100644
--- a/include/svx/gridctrl.hxx
+++ b/include/svx/gridctrl.hxx
@@ -233,7 +233,7 @@ private:
 
                     m_xEmptyRow;        // record set to insert
 
-    sal_uInt32          m_nAsynAdjustEvent;
+    sal_uLong          m_nAsynAdjustEvent;
 
     // if we modify the row for the new record, we automatically insert a "new new row".
     // But if somebody else inserts a new record into the data source, we have to do the same.
@@ -272,7 +272,7 @@ private:
 
     BrowserMode         m_nMode;
     sal_Int32           m_nCurrentPos;      // Current position;
-    sal_uInt32          m_nDeleteEvent;     // EventId for asychronous deletion of rows
+    sal_uLong           m_nDeleteEvent;     // EventId for asychronous deletion of rows
     sal_uInt16          m_nOptions;         // What is the able to do (Insert, Update, Delete)
                                         // default readonly
     sal_uInt16          m_nOptionMask;      // the mask of options to be enabled in setDataSource
diff --git a/sd/source/ui/inc/slideshow.hxx b/sd/source/ui/inc/slideshow.hxx
index f6567e1..19b5256 100644
--- a/sd/source/ui/inc/slideshow.hxx
+++ b/sd/source/ui/inc/slideshow.hxx
@@ -214,7 +214,7 @@ private:
     ViewShellBase* mpCurrentViewShellBase;
     ViewShellBase* mpFullScreenViewShellBase;
     FrameView* mpFullScreenFrameView;
-    sal_Int32   mnInPlaceConfigEvent;
+    sal_uLong   mnInPlaceConfigEvent;
 };
 
 namespace slideshowhelp
diff --git a/sd/source/ui/slideshow/SlideShowRestarter.hxx b/sd/source/ui/slideshow/SlideShowRestarter.hxx
index 928f1d1..b8bc7bb 100644
--- a/sd/source/ui/slideshow/SlideShowRestarter.hxx
+++ b/sd/source/ui/slideshow/SlideShowRestarter.hxx
@@ -59,7 +59,7 @@ public:
     void Restart (bool bForce);
 
 private:
-    sal_Int32 mnEventId;
+    sal_uLong mnEventId;
     ::rtl::Reference<SlideShow> mpSlideShow;
     ViewShellBase* mpViewShellBase;
     ::boost::shared_ptr<SlideShowRestarter> mpSelf;
commit 9de4b4a8d2796769ca03215a4490d820932faf82
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Tue May 6 18:25:56 2014 -0400

    fdo#77990: Intern strings for hybrid strings during import.
    
    Change-Id: I269497cac645e486ac08bb2b011df1b5b23dc021
    (cherry picked from commit 1899bd0c3b8a16ede2de0125e762b23ba013d81f)
    Reviewed-on: https://gerrit.libreoffice.org/9264
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx
index ff84ae4..326c4b8 100644
--- a/sc/inc/formulacell.hxx
+++ b/sc/inc/formulacell.hxx
@@ -339,7 +339,7 @@ public:
         If for whatever reason you have to use both, SetHybridDouble() and
         SetHybridString() or SetHybridFormula(), use SetHybridDouble() first
         for performance reasons.*/
-    void SetHybridString( const OUString& r );
+    void SetHybridString( const svl::SharedString& r );
     /** For import only: set a temporary formula string to be compiled later.
         If for whatever reason you have to use both, SetHybridDouble() and
         SetHybridString() or SetHybridFormula(), use SetHybridDouble() first
diff --git a/sc/inc/formularesult.hxx b/sc/inc/formularesult.hxx
index 3708c8a..1391244 100644
--- a/sc/inc/formularesult.hxx
+++ b/sc/inc/formularesult.hxx
@@ -196,7 +196,7 @@ public:
     /** Should only be used by import filters, best in the order
         SetHybridDouble(), SetHybridString()/SetHybridFormula(), or only
         SetHybridFormula() for formula string to be compiled later. */
-    SC_DLLPUBLIC void SetHybridString( const OUString & rStr );
+    SC_DLLPUBLIC void SetHybridString( const svl::SharedString & rStr );
 
     /** Should only be used by import filters, best in the order
         SetHybridDouble(), SetHybridString()/SetHybridFormula(), or only
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 9eccadb..3f3b18b 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -2075,7 +2075,7 @@ void ScFormulaCell::SetHybridDouble( double n )
     aResult.SetHybridDouble( n);
 }
 
-void ScFormulaCell::SetHybridString( const OUString& r )
+void ScFormulaCell::SetHybridString( const svl::SharedString& r )
 {
     aResult.SetHybridString( r);
 }
diff --git a/sc/source/core/tool/formularesult.cxx b/sc/source/core/tool/formularesult.cxx
index 35d5818..0237253 100644
--- a/sc/source/core/tool/formularesult.cxx
+++ b/sc/source/core/tool/formularesult.cxx
@@ -554,7 +554,7 @@ void ScFormulaResult::SetHybridDouble( double f )
     }
 }
 
-void ScFormulaResult::SetHybridString( const OUString & rStr )
+void ScFormulaResult::SetHybridString( const svl::SharedString& rStr )
 {
     // Obtain values before changing anything.
     double f = GetDouble();
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index cd1ad91..ec4b0df 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -20,6 +20,7 @@
 
 #include "formula/token.hxx"
 #include "tools/datetime.hxx"
+#include <svl/sharedstringpool.hxx>
 
 #include <com/sun/star/task/XStatusIndicator.hpp>
 
@@ -288,7 +289,7 @@ void ScOrcusSheet::set_formula_result(os::row_t row, os::col_t col, const char*
         return;
     }
     OUString aResult( p, n, RTL_TEXTENCODING_UTF8);
-    pCell->SetHybridString(aResult);
+    pCell->SetHybridString(mrDoc.getDoc().GetSharedStringPool().intern(aResult));
 }
 
 void ScOrcusSheet::set_shared_formula(
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index e40a527..41e6111 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -86,6 +86,7 @@
 #include "editeng/langitem.hxx"
 #include <svx/unoapi.hxx>
 #include <svl/languageoptions.hxx>
+#include <svl/sharedstringpool.hxx>
 #include <svtools/miscopt.hxx>
 #include <sax/tools/converter.hxx>
 
@@ -1021,7 +1022,8 @@ void ScXMLTableRowCellContext::SetFormulaCell(ScFormulaCell* pFCell) const
         {
             if( !IsPossibleErrorString() )
             {
-                pFCell->SetHybridString( *maStringValue );
+                ScDocument* pDoc = rXMLImport.GetDocument();
+                pFCell->SetHybridString(pDoc->GetSharedStringPool().intern(*maStringValue));
                 pFCell->ResetDirty();
             }
         }
@@ -1062,7 +1064,8 @@ void ScXMLTableRowCellContext::PutTextCell( const ScAddress& rCurrentPos,
             {
                 if (bDoIncrement && !IsPossibleErrorString())
                 {
-                    pFCell->SetHybridString( aCellString );
+                    ScDocument* pDoc = rXMLImport.GetDocument();
+                    pFCell->SetHybridString(pDoc->GetSharedStringPool().intern(aCellString));
                     pFCell->ResetDirty();
                 }
                 else
commit 58a2c51b211f1567ae1ecdbe8863553a9028ae86
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Tue May 6 15:24:50 2014 -0400

    fdo#77647: Fix the column insertion use case.
    
    Change-Id: I7c78f54c9386eced16113e69e625d23ed4acedd7
    (cherry picked from commit 7aa32a759fb7b440f870739f7bb680f405f338ce)
    Reviewed-on: https://gerrit.libreoffice.org/9261
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index f4064f9..8f51a72 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -2560,7 +2560,7 @@ bool expandRange( const sc::RefUpdateContext& rCxt, ScRange& rRefRange, const Sc
             // Selected range is only partially overlapping in vertical direction. Bail out.
             return false;
 
-        if (!rCxt.mrDoc.IsExpandRefs() && rSelectedRange.aStart.Col() == rRefRange.aStart.Col())
+        if (!rCxt.mrDoc.IsExpandRefs() && rSelectedRange.aStart.Col() <= rRefRange.aStart.Col())
             // Selected range is at the left end and the edge expansion is turned off.  No expansion.
             return false;
 
commit 57b2a8982fa0d156be545ec5863da3faa3b27fde
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Tue May 6 12:22:53 2014 -0400

    fdo#77944: Put updated formula cells into undo document.
    
    Change-Id: Ib9d6a73d485878bfe6c2a1875936025eb4d0a30a
    (cherry picked from commit 67563fd55b230eb68fef705ff645af7dab73af73)
    Reviewed-on: https://gerrit.libreoffice.org/9260
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 8302730..9eccadb 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -2882,7 +2882,7 @@ bool ScFormulaCell::UpdateReferenceOnMove(
          (bValChanged && bHasRelName && (bHasRelName || bInDeleteUndo || bRefSizeChanged)) || bOnRefMove)
         bNeedDirty = true;
 
-    if (pUndoDoc && (bValChanged || bOnRefMove))
+    if (pUndoDoc && (bValChanged || bRefModified || bOnRefMove))
         setOldCodeToUndo(pUndoDoc, aUndoPos, pOldCode.get(), eTempGrammar, cMatrixFlag);
 
     bValChanged = false;
commit c97e259dfee546749decd48735eb2b607a9e4443
Author: Andrzej Hunt <andrzej.hunt at collabora.com>
Date:   Mon May 5 20:48:58 2014 +0100

    fdo#76261 Get rid of unneeded and malfunctioning maItemListRect.
    
    maItemListRect serves as a sort of bounding box for what items /could/
    be visible on screen, however it is only used for determining the id
    of an item we have just clicked on -- given that we already know that
    we are clicking inside the visible area this is an unnecessary check.
    
    In fact this check is erronous as we no longer limit ourselves to "whole"
    rows as of 806919adf9c9bafbaba92c2d2ab35d2e2f9863f8 -- i.e. the previous
    assumption was that a view large enough for n rows will show precisely
    n (whole) rows, whereas we might be showing (n-1) complete rows, and a
    fraction of a row at the top and bottom of the screen, i.e. a total of
    n+1 rows, where maItemRect only encloses the top n rows, meaning we
    were erronously ignoring clicks on the (partly visible) lowest n+1 row.
    
    Change-Id: Ia52ed2e0d217a9f077cef86ee9c1847252844995
    (cherry picked from commit fb0ca7eff0e16fa8dd1a4c8d75fef23830903a3f)
    Reviewed-on: https://gerrit.libreoffice.org/9255
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx
index 851eba0..bac63c0 100644
--- a/include/sfx2/thumbnailview.hxx
+++ b/include/sfx2/thumbnailview.hxx
@@ -316,7 +316,6 @@ protected:
     ThumbnailValueItemList mFilteredItemList; ///< Cache to store the filtered items
     ThumbnailValueItemList::iterator mpStartSelRange;
     ScrollBar* mpScrBar;
-    Rectangle maItemListRect;
     long mnHeaderHeight;
     long mnItemWidth;
     long mnItemHeight;
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index 814a8d7..c97ecd6 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -364,11 +364,6 @@ void ThumbnailView::CalculateItemPositions (bool bScrollBarUsed)
     size_t nFirstItem = (bScrollBarUsed ? nHiddenLines : mnFirstLine) * mnCols;
     size_t nLastItem = nFirstItem + (mnVisLines + 1) * mnCols;
 
-    maItemListRect.Left() = x;
-    maItemListRect.Top() = y;
-    maItemListRect.Right() = x + mnCols*(mnItemWidth+nHItemSpace) - nHItemSpace - 1;
-    maItemListRect.Bottom() = y + mnVisLines*(mnItemHeight+nVItemSpace) - nVItemSpace - 1;
-
     // If want also draw parts of items in the last line,
     // then we add one more line if parts of these line are
     // visible
@@ -463,13 +458,10 @@ size_t ThumbnailView::ImplGetItem( const Point& rPos ) const
         return THUMBNAILVIEW_ITEM_NOTFOUND;
     }
 
-    if ( maItemListRect.IsInside( rPos ) )
+    for (size_t i = 0; i < mFilteredItemList.size(); ++i)
     {
-        for (size_t i = 0; i < mFilteredItemList.size(); ++i)
-        {
-            if (mFilteredItemList[i]->isVisible() && mFilteredItemList[i]->getDrawArea().IsInside(rPos))
-                return i;
-        }
+        if (mFilteredItemList[i]->isVisible() && mFilteredItemList[i]->getDrawArea().IsInside(rPos))
+            return i;
     }
 
     return THUMBNAILVIEW_ITEM_NOTFOUND;
commit 1885d08e0400e23d9663bcd6fc2924f0c7dd3fd3
Author: Andrzej Hunt <andrzej.hunt at collabora.com>
Date:   Tue May 6 15:17:29 2014 +0100

    fdo#73766 TemplateManager: construct toolbars in focus traversal order.
    
    Focus traversal happens in the order that UI items are initialised. As
    the "TemplateBar" (i.e. actions that can be used on a selected template)
    is to the left of the "ActionBar" (i.e. search/etc.), the TemplateBar
    would be expected to be first in the traversal order.
    
    This patch is only relevant for LibreOffice 4.2 -- in master (to become 4.3)
    this dialog has already been converted to .ui, and focus traversal works
    as expected.
    
    Change-Id: I3328f2e79a8e5a781aceb29f79d0c54d4b421e74
    Reviewed-on: https://gerrit.libreoffice.org/9257
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sfx2/inc/templatedlg.hxx b/sfx2/inc/templatedlg.hxx
index b36e96e..2f7ce6e 100644
--- a/sfx2/inc/templatedlg.hxx
+++ b/sfx2/inc/templatedlg.hxx
@@ -141,8 +141,8 @@ private:
 
     Edit *mpSearchEdit;
     ToolBox *mpViewBar;
-    ToolBox *mpActionBar;
     ToolBox *mpTemplateBar;
+    ToolBox *mpActionBar;
     TemplateSearchView *mpSearchView;
     TemplateAbstractView *mpCurView;
     TemplateLocalView *mpLocalView;
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 07c054f..759d2d4 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -153,8 +153,8 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
       maTabPage(&maTabControl, SfxResId(TAB_TEMPLATE_MANAGER)),
       mpSearchEdit(new Edit(&maTabPage,WB_HIDE | WB_BORDER)),
       mpViewBar( new ToolBox(&maTabPage, SfxResId(TBX_ACTION_VIEW))),
-      mpActionBar( new ToolBox(&maTabPage, SfxResId(TBX_ACTION_ACTION))),
       mpTemplateBar( new ToolBox(&maTabPage, SfxResId(TBX_ACTION_TEMPLATES))),
+      mpActionBar( new ToolBox(&maTabPage, SfxResId(TBX_ACTION_ACTION))),
       mpSearchView(new TemplateSearchView(&maTabPage)),
       mpLocalView(new TemplateLocalView(&maTabPage,SfxResId(TEMPLATE_VIEW))),
       mpRemoteView(new TemplateRemoteView(&maTabPage, WB_VSCROLL,false)),
commit 662d4a6bd9d61b078c34372f8a95afbb92ea66d0
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Mon May 5 15:22:15 2014 -0400

    fdo#78054: Initialize drawing layer when the document contains notes.
    
    Don't be fooled even when the document doesn't have a drawing layer
    initialized.  Sometimes a note creates caption on demand later, but if
    the drawing layer isn't there the caption will not get created, which
    ultimately causes this crash.
    
    (cherry picked from commit fe451fb94a33c914c0a7c1265c013d9704af850a)
    
    Conflicts:
    	sc/inc/document.hxx
    
    Change-Id: I37f4902fa84de91c9f793dc352127d9345a725e3
    Reviewed-on: https://gerrit.libreoffice.org/9254
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 365cffd..339bbb0 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -919,10 +919,11 @@ public:
     SC_DLLPUBLIC ScPostIt*       GetNote(SCCOL nCol, SCROW nRow, SCTAB nTab);
     void                         SetNote(const ScAddress& rPos, ScPostIt* pNote);
     void                         SetNote(SCCOL nCol, SCROW nRow, SCTAB nTab, ScPostIt* pNote);
-    bool                         HasNote(const ScAddress& rPos);
-    bool                         HasNote(SCCOL nCol, SCROW nRow, SCTAB nTab);
-    SC_DLLPUBLIC bool            HasColNotes(SCCOL nCol, SCTAB nTab);
-    SC_DLLPUBLIC bool            HasTabNotes(SCTAB nTab);
+    bool                         HasNote(const ScAddress& rPos) const;
+    bool                         HasNote(SCCOL nCol, SCROW nRow, SCTAB nTab) const;
+    SC_DLLPUBLIC bool            HasColNotes(SCCOL nCol, SCTAB nTab) const;
+    SC_DLLPUBLIC bool            HasTabNotes(SCTAB nTab) const;
+    bool HasNotes() const;
     SC_DLLPUBLIC ScPostIt*       ReleaseNote(const ScAddress& rPos);
     SC_DLLPUBLIC ScPostIt*       GetOrCreateNote(const ScAddress& rPos);
     SC_DLLPUBLIC ScPostIt*       CreateNote(const ScAddress& rPos);
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index bc66735..8c69412 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -6109,21 +6109,21 @@ void ScDocument::SetNote(SCCOL nCol, SCROW nRow, SCTAB nTab, ScPostIt* pNote)
         return maTabs[nTab]->aCol[nCol].SetCellNote(nRow, pNote);
 }
 
-bool ScDocument::HasNote(const ScAddress& rPos)
+bool ScDocument::HasNote(const ScAddress& rPos) const
 {
     return HasNote(rPos.Col(), rPos.Row(), rPos.Tab());
 }
-bool ScDocument::HasNote(SCCOL nCol, SCROW nRow, SCTAB nTab)
+bool ScDocument::HasNote(SCCOL nCol, SCROW nRow, SCTAB nTab) const
 {
-    ScPostIt* pNote = maTabs[nTab]->aCol[nCol].GetCellNote(nRow);
+    const ScPostIt* pNote = maTabs[nTab]->aCol[nCol].GetCellNote(nRow);
     return pNote != NULL;
 }
-bool ScDocument::HasColNotes(SCCOL nCol, SCTAB nTab)
+bool ScDocument::HasColNotes(SCCOL nCol, SCTAB nTab) const
 {
     return maTabs[nTab]->aCol[nCol].HasCellNotes();
 }
 
-bool ScDocument::HasTabNotes(SCTAB nTab)
+bool ScDocument::HasTabNotes(SCTAB nTab) const
 {
     bool hasNotes = false;
     for (SCCOL nCol=0; nCol<MAXCOLCOUNT && !hasNotes; ++nCol)
@@ -6132,6 +6132,16 @@ bool ScDocument::HasTabNotes(SCTAB nTab)
     return hasNotes;
 }
 
+bool ScDocument::HasNotes() const
+{
+    for (SCTAB i = 0; i <= MAXTAB; ++i)
+    {
+        if (HasTabNotes(i))
+            return true;
+    }
+    return false;
+}
+
 ScPostIt* ScDocument::ReleaseNote(const ScAddress& rPos)
 {
     ScTable* pTab = FetchTable(rPos.Tab());
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index b2187d5..ec6bb4a 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -643,7 +643,7 @@ void ScTransferObj::InitDocShell(bool bLimitToPageSize)
             }
         }
 
-        if ( pDoc->GetDrawLayer() )
+        if (pDoc->GetDrawLayer() || pDoc->HasNotes())
             pDocSh->MakeDrawLayer();
 
         //  cell range is copied to the original position, but on the first sheet
commit d6150032eacea4eb2ac6da27333c21187bf2c604
Author: Eike Rathke <erack at redhat.com>
Date:   Mon May 5 18:18:57 2014 +0100

    resolved fdo#78294 default null-date for document import is 1899-12-30
    
    Change-Id: I9dfe76d422ad732a081442b95a995d8d395a098e
    (cherry picked from commit 571cefca474e6b77d68f9fa31f805dcf692927fd)
    Reviewed-on: https://gerrit.libreoffice.org/9253
    Reviewed-by: Kohei Yoshida <libreoffice at kohei.us>
    Tested-by: Kohei Yoshida <libreoffice at kohei.us>

diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index fcb2760f..42817ee 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -428,6 +428,12 @@ void ScDocShell::InitOptions(bool bForLoading)      // called from InitNew and L
         // so it must not be taken from the global options.
         // Calculation settings are handled separately in ScXMLBodyContext::EndElement.
         aDocOpt.SetStdPrecision( SvNumberFormatter::UNLIMITED_PRECISION );
+
+        // fdo#78294 The default null-date if
+        // <table:null-date table:date-value='...' />
+        // is absent is 1899-12-30 regardless what the configuration is set to.
+        // Import filters may override this value.
+        aDocOpt.SetDate( 30, 12, 1899);
     }
 
     aDocument.SetDocOptions( aDocOpt );
commit cf2ee3b5d644cfc859496abd4b2f0a6b1c49c86b
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Apr 30 01:20:36 2014 +0200

    set graphic properties for error bars during import, fdo#78041
    
    Change-Id: I43138745b074dcacdafa090d97eeb9aa2ccecf78
    Reviewed-on: https://gerrit.libreoffice.org/9233
    Reviewed-by: Kohei Yoshida <libreoffice at kohei.us>
    Tested-by: Kohei Yoshida <libreoffice at kohei.us>

diff --git a/chart2/source/tools/ErrorBar.cxx b/chart2/source/tools/ErrorBar.cxx
index cd55836..5a639bf 100644
--- a/chart2/source/tools/ErrorBar.cxx
+++ b/chart2/source/tools/ErrorBar.cxx
@@ -165,7 +165,7 @@ void ErrorBar::setPropertyValue( const OUString& rPropName, const uno::Any& rAny
     else if(rPropName == "ShowNegativeError")
         rAny >>= mbShowNegativeError;
     else if(rPropName == "ErrorBarRangePositive" || rPropName == "ErrorBarRangeNegative")
-        throw uno::RuntimeException("read-only property", static_cast< uno::XWeak*>(this));
+        throw beans::UnknownPropertyException("read-only property", static_cast< uno::XWeak*>(this));
     else
         LineProperties::setPropertyValue(rPropName, rAny);
 
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
index c72f1af..e55b771 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
@@ -1011,6 +1011,19 @@ SchXMLStatisticsObjectContext::~SchXMLStatisticsObjectContext()
 
 namespace {
 
+void SetErrorBarStyleProperties( const OUString& rStyleName, uno::Reference< beans::XPropertySet > xBarProp,
+                                        SchXMLImportHelper& rImportHelper )
+{
+    const SvXMLStylesContext* pStylesCtxt = rImportHelper.GetAutoStylesContext();
+    const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(rImportHelper.GetChartFamilyID(),
+            rStyleName);
+
+    XMLPropStyleContext * pSeriesStyleContext =
+        const_cast< XMLPropStyleContext * >( dynamic_cast< const XMLPropStyleContext * >( pStyle ));
+
+    pSeriesStyleContext->FillPropertySet( xBarProp );
+}
+
 void SetErrorBarPropertiesFromStyleName( const OUString& aStyleName, uno::Reference< beans::XPropertySet> xBarProp,
                                             SchXMLImportHelper& rImportHelper, OUString& aPosRange, OUString& aNegRange)
 {
@@ -1177,6 +1190,8 @@ void SchXMLStatisticsObjectContext::StartElement( const uno::Reference< xml::sax
                     xBarProp->setPropertyValue("ShowNegativeError",uno::makeAny(sal_True));
 
                     // first import defaults from parent style
+                    SetErrorBarStyleProperties( maSeriesStyleName, xBarProp, mrImportHelper );
+                    SetErrorBarStyleProperties( sAutoStyleName, xBarProp, mrImportHelper );
                     SetErrorBarPropertiesFromStyleName( maSeriesStyleName, xBarProp, mrImportHelper, aPosRange, aNegRange );
                     SetErrorBarPropertiesFromStyleName( sAutoStyleName, xBarProp, mrImportHelper, aPosRange, aNegRange );
 
commit bb51e9b44274d89c744e0923346dd497f585b751
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Tue Apr 29 20:37:36 2014 +0200

    escape conditional formatting formulas during xlsx export, fdo#75168
    
    Change-Id: I9ebdb2315b51c2b53d8cfa0486b3ec22a8e0d88d
    Reviewed-on: https://gerrit.libreoffice.org/9232
    Tested-by: Kohei Yoshida <libreoffice at kohei.us>
    Reviewed-by: Kohei Yoshida <libreoffice at kohei.us>

diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index 4c4db7f..7ebf959 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -942,13 +942,13 @@ void XclExpCFImpl::SaveXml( XclExpXmlStream& rStrm )
     if(!IsTextRule(eOperation) && !IsTopBottomRule(eOperation))
     {
         rWorksheet->startElement( XML_formula, FSEND );
-        rWorksheet->write(XclXmlUtils::ToOUString( GetRoot().GetDoc(), mrFormatEntry.GetValidSrcPos(),
+        rWorksheet->writeEscaped(XclXmlUtils::ToOUString( GetRoot().GetDoc(), mrFormatEntry.GetValidSrcPos(),
                     mrFormatEntry.CreateTokenArry(0)));
         rWorksheet->endElement( XML_formula );
         if (bFmla2)
         {
             rWorksheet->startElement( XML_formula, FSEND );
-            rWorksheet->write(XclXmlUtils::ToOUString( GetRoot().GetDoc(), mrFormatEntry.GetValidSrcPos(),
+            rWorksheet->writeEscaped(XclXmlUtils::ToOUString( GetRoot().GetDoc(), mrFormatEntry.GetValidSrcPos(),
                         mrFormatEntry.CreateTokenArry(1)));
             rWorksheet->endElement( XML_formula );
         }
commit c7c094efaf14fb6558d4d1655bf87f5ecd9dd9a4
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Apr 30 02:33:02 2014 +0200

    be explicit about text rotations, fdo#70670
    
    Change-Id: I5090a49c2383e6a30165a8eca22b527972c0f507
    Reviewed-on: https://gerrit.libreoffice.org/9231
    Reviewed-by: Kohei Yoshida <libreoffice at kohei.us>
    Tested-by: Kohei Yoshida <libreoffice at kohei.us>

diff --git a/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx b/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
index 9ca382f..f15196e 100644
--- a/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx
@@ -502,7 +502,7 @@ const std::vector< WrappedProperty* > TitleWrapper::createWrappedProperties()
     ::std::vector< ::chart::WrappedProperty* > aWrappedProperties;
 
     aWrappedProperties.push_back( new WrappedTitleStringProperty( m_spChart2ModelContact->m_xContext ) );
-    aWrappedProperties.push_back( new WrappedTextRotationProperty( m_eTitleType==TitleHelper::Y_AXIS_TITLE || m_eTitleType==TitleHelper::X_AXIS_TITLE ) );
+    aWrappedProperties.push_back( new WrappedTextRotationProperty( true ) );
     aWrappedProperties.push_back( new WrappedStackedTextProperty() );
     WrappedCharacterHeightProperty::addWrappedProperties( aWrappedProperties, this );
     WrappedAutomaticPositionProperties::addWrappedProperties( aWrappedProperties );
commit 5368b2ac49d3a1d33d4a03915ca864f037109f8e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 29 12:58:56 2014 +0100

    fix crash found when exploring fdo#50697
    
    (cherry picked from commit b25871da62facc20387ebfa2b908422578ca8ce9)
    
    Conflicts:
    	sw/source/core/frmedt/fefly1.cxx
    
    Change-Id: Ie781c2534cb41104dd3d91d4370639e98baa8112
    Reviewed-on: https://gerrit.libreoffice.org/9202
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 7bef646..b7258ea 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -342,10 +342,11 @@ const SwFrmFmt* SwFEShell::IsFlyInFly()
         aPoint.setX(aPoint.getX() - 1);                    //do not land in the fly!!
         GetLayout()->GetCrsrOfst( &aPos, aPoint, &aState );
         // determine text frame by left-top-corner of object
-        pTxtFrm = aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(), &aTmpPos, 0, sal_False );
+        SwCntntNode *pNd = aPos.nNode.GetNode().GetCntntNode();
+        pTxtFrm = pNd ? pNd->getLayoutFrm(GetLayout(), &aTmpPos, 0, sal_False) : NULL;
     }
-    const SwFrm *pTmp = ::FindAnchor( pTxtFrm, aTmpPos );
-    const SwFlyFrm *pFly = pTmp->FindFlyFrm();
+    const SwFrm *pTmp = pTxtFrm ? ::FindAnchor(pTxtFrm, aTmpPos) : NULL;
+    const SwFlyFrm *pFly = pTmp ? pTmp->FindFlyFrm() : NULL;
     if( pFly )
         return pFly->GetFmt();
     return NULL;
commit 27b0b6ade0ddbbabba52ef0080aac07ca6cbd9aa
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 29 14:51:21 2014 +0100

    coverity#1210177 Uninitialized pointer field
    
    Change-Id: If4e8ddfa0a4dcb9875ce82fc82d196ff3dbd9657
    (cherry picked from commit f670aaaabf23f13ae5ebf61ba61824794137c597)
    Reviewed-on: https://gerrit.libreoffice.org/9201
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 6b3a1a1..5e826bd30 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -197,6 +197,7 @@ OfaMiscTabPage::OfaMiscTabPage(Window* pParent, const SfxItemSet& rSet)
     }
 #endif
     get(m_pFileDlgCB, "filedlg");
+    get(m_pFileDlgROImage, "lockimage");
     get(m_pPrintDlgCB, "printdlg");
     get(m_pDocStatusCB, "docstatus");
     get(m_pSaveAlwaysCB, "savealways");
diff --git a/cui/uiconfig/ui/optgeneralpage.ui b/cui/uiconfig/ui/optgeneralpage.ui
index 4888d95..bbe08e2 100644
--- a/cui/uiconfig/ui/optgeneralpage.ui
+++ b/cui/uiconfig/ui/optgeneralpage.ui
@@ -116,7 +116,7 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkImage" id="image1">
+                  <object class="GtkImage" id="lockimage">
                     <property name="can_focus">False</property>
                     <property name="no_show_all">True</property>
                     <property name="halign">center</property>
commit c3d841818c6ddd40ec4ba462c8e2d426ba675a25
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Thu May 1 01:15:02 2014 -0400

    fdo#78079: Re-work sort by column to get it to do the right thing.
    
    Also fixed reference update problem.
    
    (cherry picked from commit 3c4fb52d8fc89fe43983991ed2339295b2e0ef8c)
    
    Conflicts:
    	sc/inc/column.hxx
    
    Change-Id: I06e6115ef969a011fdd5c92d5eb1927fb7ae789b
    Reviewed-on: https://gerrit.libreoffice.org/9220
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx
index 608a505..b4ab629 100644
--- a/sc/inc/address.hxx
+++ b/sc/inc/address.hxx
@@ -27,6 +27,7 @@
 
 #include <limits>
 #include "scdllapi.h"
+#include <types.hxx>
 #include <formula/grammar.hxx>
 
 #include <com/sun/star/uno/Sequence.hxx>
@@ -39,18 +40,6 @@ namespace com { namespace sun { namespace star {
 
 class ScDocument;
 
-// The typedefs
-typedef sal_Int32 SCROW;
-typedef sal_Int16 SCCOL;
-typedef sal_Int16 SCTAB;
-typedef sal_Int32 SCCOLROW;     ///< a type capable of holding either SCCOL or SCROW
-
-// temporarily signed typedefs
-typedef sal_Int32 SCsROW;
-typedef sal_Int16 SCsCOL;
-typedef sal_Int16 SCsTAB;
-typedef sal_Int32 SCsCOLROW;
-
 /** size_t typedef to be able to find places where code was changed from USHORT
     to size_t and is used to read/write from/to streams. */
 typedef size_t SCSIZE;
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 53ca5cc..bfc7a54 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -182,7 +182,7 @@ public:
 
     void        Delete( SCROW nRow );
     void        FreeAll();
-    void        SwapCell( SCROW nRow, ScColumn& rCol);
+    void Swap( ScColumn& rOther, SCROW nRow1, SCROW nRow2, bool bPattern );
 
     bool        HasAttrib( SCROW nRow1, SCROW nRow2, sal_uInt16 nMask ) const;
     bool    HasAttribSelection( const ScMarkData& rMark, sal_uInt16 nMask ) const;
@@ -473,6 +473,7 @@ public:
     void BroadcastRecalcOnRefMove();
     void BroadcastRefMoved( const sc::RefMovedHint& rHint );
     void TransferListeners( ScColumn& rDestCol, SCROW nRow1, SCROW nRow2, SCROW nRowDelta );
+    void CollectListeners( std::vector<SvtListener*>& rListeners, SCROW nRow1, SCROW nRow2 );
 
     void CompileDBFormula( sc::CompileFormulaContext& rCxt );
     void CompileDBFormula( sc::CompileFormulaContext& rCxt, bool bCreateFormulaString );
@@ -567,6 +568,23 @@ public:
      */
     void RegroupFormulaCells();
 
+    /**
+     * Reset column position of formula cells within specified row range.
+     * Reference positions are also adjusted to reflect the new position so
+     * that the formula cells still reference the same cells or ranges after
+     * the the position change.  The position of a formula cell before the
+     * call is interpreted as the old position of that cell.
+     *
+     * Caller needs to ensure that no formula groups cross the top and bottom
+     * row boundaries.
+     *
+     * @param nRow1 top row boundary
+     * @param nRow2 bottom row boundary
+     */
+    void ResetFormulaCellPositions( SCROW nRow1, SCROW nRow2 );
+
+    void SplitFormulaGroupByRelativeRef( const ScRange& rBoundRange );
+
 #if DEBUG_COLUMN_STORAGE
     void DumpFormulaGroups() const;
 #endif
diff --git a/sc/inc/refhint.hxx b/sc/inc/refhint.hxx
index ec56735..3ffe861 100644
--- a/sc/inc/refhint.hxx
+++ b/sc/inc/refhint.hxx
@@ -18,7 +18,7 @@ namespace sc {
 class RefHint : public SfxSimpleHint
 {
 public:
-    enum Type { Moved };
+    enum Type { Moved, ColumnReordered };
 
 private:
     Type meType;
@@ -55,6 +55,24 @@ public:
     const ScAddress& getDelta() const;
 };
 
+class RefColReorderHint : public RefHint
+{
+    const sc::ColReorderMapType& mrColMap;
+    SCTAB mnTab;
+    SCROW mnRow1;
+    SCROW mnRow2;
+
+public:
+    RefColReorderHint( const sc::ColReorderMapType& rColMap, SCTAB nTab, SCROW nRow1, SCROW nRow2 );
+    virtual ~RefColReorderHint();
+
+    const sc::ColReorderMapType& getColMap() const;
+
+    SCTAB getTab() const;
+    SCROW getStartRow() const;
+    SCROW getEndRow() const;
+};
+
 }
 
 #endif
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 108637b..ba7745d 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -988,7 +988,6 @@ private:
                                 // use the global sort parameter:
     bool        IsSorted(SCCOLROW nStart, SCCOLROW nEnd) const;
     void        DecoladeRow( ScSortInfoArray*, SCROW nRow1, SCROW nRow2 );
-    void        SwapCol(SCCOL nCol1, SCCOL nCol2);
     short CompareCell(
         sal_uInt16 nSort,
         ScRefCellValue& rCell1, SCCOL nCell1Col, SCROW nCell1Row,
diff --git a/sc/inc/tokenarray.hxx b/sc/inc/tokenarray.hxx
index 3c7d7e8..8715e9c 100644
--- a/sc/inc/tokenarray.hxx
+++ b/sc/inc/tokenarray.hxx
@@ -158,6 +158,18 @@ public:
         const ScAddress& rPos, const ScRange& rMovedRange, const ScAddress& rDelta );
 
     /**
+     * Move reference positions in response to column reordering.  A range
+     * reference gets moved only when the whole range fits in a single column.
+     *
+     * @param rPos position of this formula cell
+     * @param nTab sheet where columns are reordered.
+     * @param nRow1 top row of reordered range.
+     * @param nRow2 bottom row of reordered range.
+     * @param rColMap old-to-new column mapping.
+     */
+    void MoveReference( const ScAddress& rPos, SCTAB nTab, SCROW nRow1, SCROW nRow2, const sc::ColReorderMapType& rColMap );
+
+    /**
      * Adjust all references in named expression. In named expression, we only
      * update absolute positions, and leave relative positions intact.
      *
@@ -185,6 +197,11 @@ public:
     sc::RefUpdateResult AdjustReferenceOnMovedTab( sc::RefUpdateMoveTabContext& rCxt, const ScAddress& rOldPos );
 
     /**
+     * Adjust all internal references on base position change.
+     */
+    void AdjustReferenceOnMovedOrigin( const ScAddress& rOldPos, const ScAddress& rNewPos );
+
+    /**
      * Clear sheet deleted flag from internal reference tokens if the sheet
      * index falls within specified range.  Note that when a reference is on a
      * sheet that's been deleted, its referenced sheet index retains the
@@ -199,6 +216,9 @@ public:
     void CheckRelativeReferenceBounds(
         const sc::RefUpdateContext& rCxt, const ScAddress& rPos, SCROW nGroupLen, std::vector<SCROW>& rBounds ) const;
 
+    void CheckRelativeReferenceBounds(
+        const ScAddress& rPos, SCROW nGroupLen, const ScRange& rRange, std::vector<SCROW>& rBounds ) const;
+
     /**
      * Create a string representation of formula token array without modifying
      * the internal state of the token array.
diff --git a/sc/inc/types.hxx b/sc/inc/types.hxx
index b6c4fa6..e0163aa 100644
--- a/sc/inc/types.hxx
+++ b/sc/inc/types.hxx
@@ -13,9 +13,22 @@
 #include "sal/types.h"
 
 #include <boost/intrusive_ptr.hpp>
+#include <boost/unordered_map.hpp>
 
 class ScMatrix;
 
+// The typedefs
+typedef sal_Int32 SCROW;
+typedef sal_Int16 SCCOL;
+typedef sal_Int16 SCTAB;
+typedef sal_Int32 SCCOLROW;     ///< a type capable of holding either SCCOL or SCROW
+
+// temporarily signed typedefs
+typedef sal_Int32 SCsROW;
+typedef sal_Int16 SCsCOL;
+typedef sal_Int16 SCsTAB;
+typedef sal_Int32 SCsCOLROW;
+
 typedef ::boost::intrusive_ptr<ScMatrix>        ScMatrixRef;
 typedef ::boost::intrusive_ptr<const ScMatrix>  ScConstMatrixRef;
 
@@ -85,6 +98,8 @@ struct RangeMatrix
     bool isRangeValid() const;
 };
 
+typedef boost::unordered_map<SCCOL,SCCOL> ColReorderMapType;
+
 }
 
 #endif
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 6c3e2a9..9835a6d 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -838,66 +838,6 @@ const sc::CellTextAttr* ScColumn::GetCellTextAttr( sc::ColumnBlockConstPosition&
     return &sc::celltextattr_block::at(*aPos.first->data, aPos.second);
 }
 
-namespace {
-
-/**
- * Adjust references in formula cell with respect to column-wise relocation.
- */
-void updateRefInFormulaCell( ScDocument* pDoc, ScFormulaCell& rCell, SCCOL nCol, SCTAB nTab, SCCOL nColDiff )
-{
-    rCell.aPos.SetCol(nCol);
-    sc::RefUpdateContext aCxt(*pDoc);
-    aCxt.meMode = URM_MOVE;
-    aCxt.maRange = ScRange(ScAddress(nCol, 0, nTab), ScAddress(nCol, MAXROW, nTab));
-    aCxt.mnColDelta = nColDiff;
-    rCell.UpdateReference(aCxt);
-}
-
-}
-
-void ScColumn::SwapCell( SCROW nRow, ScColumn& rCol)
-{
-    sc::CellStoreType::position_type aPos1 = maCells.position(nRow);
-    sc::CellStoreType::position_type aPos2 = rCol.maCells.position(nRow);
-
-    if (aPos1.first->type == sc::element_type_formula)
-    {
-        ScFormulaCell& rCell = *sc::formula_block::at(*aPos1.first->data, aPos1.second);
-        updateRefInFormulaCell(pDocument, rCell, rCol.nCol, nTab, rCol.nCol - nCol);
-        sc::SharedFormulaUtil::unshareFormulaCell(aPos1, rCell);
-    }
-
-    if (aPos2.first->type == sc::element_type_formula)
-    {
-        ScFormulaCell& rCell = *sc::formula_block::at(*aPos2.first->data, aPos2.second);
-        updateRefInFormulaCell(pDocument, rCell, nCol, nTab, nCol - rCol.nCol);
-        sc::SharedFormulaUtil::unshareFormulaCell(aPos2, rCell);
-    }
-
-    maCells.swap(nRow, nRow, rCol.maCells, nRow);
-    maCellTextAttrs.swap(nRow, nRow, rCol.maCellTextAttrs, nRow);
-    maCellNotes.swap(nRow, nRow, rCol.maCellNotes, nRow);
-
-    aPos1 = maCells.position(nRow);
-    aPos2 = rCol.maCells.position(nRow);
-
-    if (aPos1.first->type == sc::element_type_formula)
-    {
-        ScFormulaCell& rCell = *sc::formula_block::at(*aPos1.first->data, aPos1.second);
-        JoinNewFormulaCell(aPos1, rCell);
-    }
-
-    if (aPos2.first->type == sc::element_type_formula)
-    {
-        ScFormulaCell& rCell = *sc::formula_block::at(*aPos2.first->data, aPos2.second);
-        rCol.JoinNewFormulaCell(aPos2, rCell);
-    }
-
-    CellStorageModified();
-    rCol.CellStorageModified();
-}
-
-
 bool ScColumn::TestInsertCol( SCROW nStartRow, SCROW nEndRow) const
 {
     if (IsEmpty())
diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx
index baa00e0..7996cd8 100644
--- a/sc/source/core/data/column4.cxx
+++ b/sc/source/core/data/column4.cxx
@@ -27,6 +27,7 @@
 #include <globalnames.hxx>
 #include <scitems.hxx>
 #include <cellform.hxx>
+#include <sharedformula.hxx>
 
 #include <svl/sharedstringpool.hxx>
 
@@ -387,4 +388,132 @@ void ScColumn::UpdateScriptTypes( SCROW nRow1, SCROW nRow2 )
         CellStorageModified();
 }
 
+void ScColumn::Swap( ScColumn& rOther, SCROW nRow1, SCROW nRow2, bool bPattern )
+{
+    maCells.swap(nRow1, nRow2, rOther.maCells, nRow1);
+    maCellTextAttrs.swap(nRow1, nRow2, rOther.maCellTextAttrs, nRow1);
+    maCellNotes.swap(nRow1, nRow2, rOther.maCellNotes, nRow1);
+    maBroadcasters.swap(nRow1, nRow2, rOther.maBroadcasters, nRow1);
+
+    if (bPattern)
+    {
+        for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow)
+        {
+            const ScPatternAttr* pPat1 = GetPattern(nRow);
+            const ScPatternAttr* pPat2 = rOther.GetPattern(nRow);
+            if (pPat1 != pPat2)
+            {
+                SetPattern(nRow, *pPat2, true);
+                rOther.SetPattern(nRow, *pPat1, true);
+            }
+        }
+    }
+
+    CellStorageModified();
+    rOther.CellStorageModified();
+}
+
+namespace {
+
+class FormulaColPosSetter
+{
+    SCCOL mnCol;
+public:
+    FormulaColPosSetter( SCCOL nCol ) : mnCol(nCol) {}
+
+    void operator() ( size_t nRow, ScFormulaCell* pCell )
+    {
+        if (!pCell->IsShared() || pCell->IsSharedTop())
+        {
+            // Ensure that the references still point to the same locations
+            // after the position change.
+            ScAddress aOldPos = pCell->aPos;
+            pCell->aPos.SetCol(mnCol);
+            pCell->aPos.SetRow(nRow);
+            pCell->GetCode()->AdjustReferenceOnMovedOrigin(aOldPos, pCell->aPos);
+        }
+        else
+        {
+            pCell->aPos.SetCol(mnCol);
+            pCell->aPos.SetRow(nRow);
+        }
+    }
+};
+
+}
+
+void ScColumn::ResetFormulaCellPositions( SCROW nRow1, SCROW nRow2 )
+{
+    FormulaColPosSetter aFunc(nCol);
+    sc::ProcessFormula(maCells.begin(), maCells, nRow1, nRow2, aFunc);
+}
+
+namespace {
+
+class RelativeRefBoundChecker
+{
+    std::vector<SCROW> maBounds;
+    ScRange maBoundRange;
+
+public:
+    RelativeRefBoundChecker( const ScRange& rBoundRange ) :
+        maBoundRange(rBoundRange) {}
+
+    void operator() ( size_t /*nRow*/, ScFormulaCell* pCell )
+    {
+        if (!pCell->IsSharedTop())
+            return;
+
+        pCell->GetCode()->CheckRelativeReferenceBounds(
+            pCell->aPos, pCell->GetSharedLength(), maBoundRange, maBounds);
+    }
+
+    void swapBounds( std::vector<SCROW>& rBounds )
+    {
+        rBounds.swap(maBounds);
+    }
+};
+
+}
+
+void ScColumn::SplitFormulaGroupByRelativeRef( const ScRange& rBoundRange )
+{
+    std::vector<SCROW> aBounds;
+
+    // Cut at row boundaries first.
+    aBounds.push_back(rBoundRange.aStart.Row());
+    aBounds.push_back(rBoundRange.aEnd.Row()+1);
+    sc::SharedFormulaUtil::splitFormulaCellGroups(maCells, aBounds);
+
+    RelativeRefBoundChecker aFunc(rBoundRange);
+    sc::ProcessFormula(
+        maCells.begin(), maCells, rBoundRange.aStart.Row(), rBoundRange.aEnd.Row(), aFunc);
+    aFunc.swapBounds(aBounds);
+    sc::SharedFormulaUtil::splitFormulaCellGroups(maCells, aBounds);
+}
+
+namespace {
+
+class ListenerCollector
+{
+    std::vector<SvtListener*>& mrListeners;
+public:
+    ListenerCollector( std::vector<SvtListener*>& rListener ) :
+        mrListeners(rListener) {}
+
+    void operator() ( size_t /*nRow*/, SvtBroadcaster* p )
+    {
+        SvtBroadcaster::ListenersType& rLis = p->GetAllListeners();
+        std::copy(rLis.begin(), rLis.end(), std::back_inserter(mrListeners));
+    }
+};
+
+}
+
+void ScColumn::CollectListeners( std::vector<SvtListener*>& rListeners, SCROW nRow1, SCROW nRow2 )
+{
+    ListenerCollector aFunc(rListeners);
+    sc::ProcessBroadcaster(maBroadcasters.begin(), maBroadcasters, nRow1, nRow2, aFunc);
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 7250746..8302730 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -1888,12 +1888,28 @@ void ScFormulaCell::Notify( const SfxHint& rHint )
     {
         const sc::RefHint& rRefHint = static_cast<const sc::RefHint&>(rHint);
 
-        if (rRefHint.getType() == sc::RefHint::Moved)

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list