[Libreoffice-commits] core.git: Branch 'private/kohei/sort-ref-update' - 728 commits - accessibility/inc accessibility/source avmedia/Library_avmedia.mk avmedia/Library_avmediaogl.mk avmedia/source basctl/source basctl/uiconfig basegfx/source basic/source binaryurp/source bin/distro-install-file-lists bridges/Library_cpp_uno.mk canvas/source chart2/CppunitTest_chart2_export.mk chart2/CppunitTest_chart2_import.mk chart2/inc chart2/Library_chartcontroller.mk chart2/opengl chart2/Package_opengl.mk chart2/qa chart2/source chart2/uiconfig chart2/UIConfig_chart2.mk codemaker/source comphelper/source compilerplugins/clang config.guess config_host/config_features.h.in configmgr/source config.sub configure.ac connectivity/inc connectivity/source cppcanvas/CppunitTest_cppcanvas_emfplus.mk cppcanvas/CppunitTest_cppcanvas_test.mk cppcanvas/source cppuhelper/source cppu/source cui/AllLangResTarget_cui.mk cui/source cui/uiconfig cui/UIConfig_cui.mk dbaccess/source dbaccess/uiconfig desktop/Library_sofficeapp.m k desktop/source desktop/uiconfig desktop/UIConfig_deployment.mk download.lst drawinglayer/source editeng/source embeddedobj/source extensions/AllLangResTarget_bib.mk extensions/AllLangResTarget_scn.mk extensions/inc extensions/Module_extensions.mk extensions/source extensions/uiconfig extensions/UIConfig_sbibliography.mk extensions/UIConfig_scanner.mk external/boost external/collada2gltf external/icu external/libgltf external/libmwaw external/libodfgen external/librevenge external/libwps external/lpsolve external/rhino extras/source filter/source filter/uiconfig forms/source formula/inc formula/Module_formula.mk formula/source formula/uiconfig formula/UIConfig_formula.mk fpicker/source fpicker/uiconfig framework/source helpcompiler/inc helpcompiler/source helpcontent2 hwpfilter/source i18nlangtag/source i18npool/source idlc/inc idlc/source idl/source include/avmedia include/basebmp include/basegfx include/basic include/canvas include/codemaker include/com include/comphelper include /connectivity include/editeng include/filter include/formula include/jvmaccess include/LibreOfficeKit include/oox include/rtl include/sal include/sfx2 include/sot include/svl include/svtools include/svx include/tools include/unotest include/unotools include/vcl include/xmloff include/xmlreader instsetoo_native/inc_openoffice jvmaccess/source jvmfwk/source l10ntools/inc l10ntools/source libreofficekit/Executable_gtktiledviewer.mk libreofficekit/Library_libreofficekitgtk.mk libreofficekit/Library_libreofficekit.mk libreofficekit/Module_libreofficekit.mk libreofficekit/qa libreofficekit/source libreofficekit/StaticLibrary_libreofficekit.mk lingucomponent/source linguistic/source lotuswordpro/source Makefile.in odk/examples odk/Package_examples.mk odk/source offapi/com offapi/UnoApi_offapi.mk officecfg/CustomTarget_registry.mk officecfg/registry oovbaapi/ooo oox/inc oox/source postprocess/CppunitTest_services.mk postprocess/Module_postprocess.mk postprocess/qa qadevOOo/tests readlicense _oo/docs readlicense_oo/license registry/source reportdesign/inc reportdesign/source RepositoryExternal.mk Repository.mk rsc/inc rsc/source sal/osl sal/qa sax/source sc/CppunitTest_sc_annotationobj.mk sc/CppunitTest_sc_annotationshapeobj.mk sc/CppunitTest_sc_annotationsobj.mk sc/CppunitTest_sc_cellrangeobj.mk sc/CppunitTest_sc_chart_regression_test.mk sc/CppunitTest_sc_databaserangeobj.mk sc/CppunitTest_sc_datapilotfieldobj.mk sc/CppunitTest_sc_datapilottableobj.mk sc/CppunitTest_sc_editfieldobj_cell.mk sc/CppunitTest_sc_editfieldobj_header.mk sc/CppunitTest_sc_filters_test.mk sc/CppunitTest_sc_html_export_test.mk sc/CppunitTest_sc_macros_test.mk sc/CppunitTest_sc_modelobj.mk sc/CppunitTest_sc_namedrangeobj.mk sc/CppunitTest_sc_namedrangesobj.mk sc/CppunitTest_sc_opencl_test.mk sc/CppunitTest_sc_outlineobj.mk sc/CppunitTest_sc_rangelst_test.mk sc/CppunitTest_sc_subsequent_export_test.mk sc/CppunitTest_sc_subsequent_filters_test.mk sc/CppunitTest_sc_tableautoformatfield.mk sc/Cppunit Test_sc_tablesheetobj.mk sc/CppunitTest_sc_tablesheetsobj.mk sc/CppunitTest_sc_ucalc.mk sc/inc sc/Library_sc.mk scp2/AutoInstall.mk scp2/source sc/qa scripting/source scripting/workben sc/source sc/uiconfig sc/workben sd/AllLangResTarget_sd.mk sdext/source sd/inc sd/Library_sd.mk sd/qa sd/source sd/uiconfig sd/UIConfig_simpress.mk sd/workben sfx2/source sfx2/uiconfig shell/source slideshow/source smoketest/libtest.cxx solenv/gbuild soltools/cpp soltools/mkdepend sot/source starmath/inc starmath/source starmath/uiconfig stoc/source store/source svgio/source svl/CppunitTest_svl_itempool.mk svl/CppunitTest_svl_items.mk svl/CppunitTest_svl_qa_cppunit.mk svl/Library_svl.mk svl/Module_svl.mk svl/qa svl/source svtools/source svtools/uiconfig svx/inc svx/Library_svx.mk svx/source svx/uiconfig svx/UIConfig_svx.mk sw/CppunitTest_sw_tox.mk sw/CppunitTest_sw_uiwriter.mk sw/inc sw/Library_sw.mk sw/qa sw/sdi sw/source sw/uiconfig sw/UIConfig_swriter.mk sysui/desktop test/Library_subsequenttest.mk test/Library_test.mk test/source toolkit/Library_tk.mk toolkit/source tools/source ucb/source udkapi/com UnoControls/inc UnoControls/source unodevtools/source unotest/source unotools/source unusedcode.easy uui/AllLangResTarget_uui.mk uui/source uui/uiconfig uui/UIConfig_uui.mk vcl/generic vcl/headless vcl/inc vcl/Library_vcl.mk vcl/osx vcl/quartz vcl/source vcl/uiconfig vcl/unx wizards/com writerfilter/CustomTarget_source.mk writerfilter/inc writerfilter/Library_writerfilter.mk writerfilter/source xmloff/inc xmloff/source xmlreader/source xmlscript/source xmlsecurity/source xmlsecurity/uiconfig

Kohei Yoshida kohei.yoshida at collabora.com
Fri Jun 27 06:36:31 PDT 2014


Rebased ref, commits from common ancestor:
commit aa536599e128d27bee2dd530f2552385406e1813
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed Jun 4 16:40:35 2014 -0400

    Make reorder by row and reorder by column totally separate.
    
    We'll need to call these directly during undo and redo which is yet to
    be worked on.
    
    Change-Id: I2607c370358e1fd21eb9e283567c0be4c7731a48

diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 929ea6f..580b738 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -1019,7 +1019,7 @@ private:
     short       Compare( ScSortInfoArray*, SCCOLROW nIndex1, SCCOLROW nIndex2) const;
     ScSortInfoArray* CreateSortInfoArray( SCCOLROW nInd1, SCCOLROW nInd2, bool bKeepQuery );
     void        QuickSort( ScSortInfoArray*, SCsCOLROW nLo, SCsCOLROW nHi);
-    void SortReorder( ScSortInfoArray* pArray, ScProgress* pProgress );
+    void SortReorderByColumn( ScSortInfoArray* pArray, ScProgress* pProgress );
     void SortReorderByRow( ScSortInfoArray* pArray, ScProgress* pProgress );
 
     bool        CreateExcelQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScQueryParam& rQueryParam);
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 4ad3922..b107464 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -560,14 +560,8 @@ public:
 
 }
 
-void ScTable::SortReorder( ScSortInfoArray* pArray, ScProgress* pProgress )
+void ScTable::SortReorderByColumn( ScSortInfoArray* pArray, ScProgress* pProgress )
 {
-    if (aSortParam.bByRow)
-    {
-        SortReorderByRow(pArray, pProgress);
-        return;
-    }
-
     size_t nCount = pArray->GetCount();
     SCCOLROW nStart = pArray->GetStart();
     SCCOLROW nLast = pArray->GetLast();
@@ -1120,7 +1114,7 @@ void ScTable::Sort(const ScSortParam& rSortParam, bool bKeepQuery, ScProgress* p
                 DecoladeRow(pArray.get(), nRow1, nLastRow);
 
             QuickSort(pArray.get(), nRow1, nLastRow);
-            SortReorder(pArray.get(), pProgress);
+            SortReorderByRow(pArray.get(), pProgress);
 
             // #i59745# update position of caption objects of cell notes --> reported at (SortReorder) ScColumn::SwapCellNotes level
         }
@@ -1142,7 +1136,7 @@ void ScTable::Sort(const ScSortParam& rSortParam, bool bKeepQuery, ScProgress* p
             boost::scoped_ptr<ScSortInfoArray> pArray(CreateSortInfoArray(nCol1, nLastCol, bKeepQuery));
 
             QuickSort(pArray.get(), nCol1, nLastCol);
-            SortReorder(pArray.get(), pProgress);
+            SortReorderByColumn(pArray.get(), pProgress);
 
             // #i59745# update position of caption objects of cell notes --> reported at (SortReorder) ScColumn::SwapCellNotes level
         }
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx
index 0c8e5d1..3e5c6e1 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -51,6 +51,48 @@
 #include <set>
 #include <memory>
 
+#include <stdio.h>
+#include <string>
+#include <sys/time.h>
+
+namespace {
+
+class stack_printer
+{
+public:
+    explicit stack_printer(const char* msg) :
+        msMsg(msg)
+    {
+        fprintf(stdout, "%s: --begin\n", msMsg.c_str());
+        mfStartTime = getTime();
+    }
+
+    ~stack_printer()
+    {
+        double fEndTime = getTime();
+        fprintf(stdout, "%s: --end (duration: %g sec)\n", msMsg.c_str(), (fEndTime - mfStartTime));
+    }
+
+    void printTime(int line) const
+    {
+        double fEndTime = getTime();
+        fprintf(stdout, "%s: --(%d) (duration: %g sec)\n", msMsg.c_str(), line, (fEndTime - mfStartTime));
+    }
+
+private:
+    double getTime() const
+    {
+        timeval tv;
+        gettimeofday(&tv, NULL);
+        return tv.tv_sec + tv.tv_usec / 1000000.0;
+    }
+
+    ::std::string msMsg;
+    double mfStartTime;
+};
+
+}
+
 using namespace ::com::sun::star;
 
 bool ScDBDocFunc::AddDBRange( const OUString& rName, const ScRange& rRange, bool /* bApi */ )
@@ -425,6 +467,7 @@ bool ScDBDocFunc::RepeatDB( const OUString& rDBName, bool bRecord, bool bApi, bo
 bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam,
                             bool bRecord, bool bPaint, bool bApi )
 {
+    stack_printer __stack_printer__("ScDBDocFunc::Sort");
     ScDocShellModificator aModificator( rDocShell );
 
     ScDocument& rDoc = rDocShell.GetDocument();
commit b117eeea9fece5e57ecac97428d41d2e95f0ffd1
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed Jun 4 15:37:01 2014 -0400

    Adjust range references here as well.
    
    Change-Id: Iacc99fcc92ef5987f13716acd7ad899b6ba8c7cf

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 2d55882..cf406a0 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -2976,7 +2976,6 @@ void ScTokenArray::MoveReference( const ScAddress& rPos, SCTAB nTab, SCCOL nCol1
             break;
             case svDoubleRef:
             {
-#if 0
                 ScToken* pToken = static_cast<ScToken*>(*p);
                 ScComplexRefData& rRef = pToken->GetDoubleRef();
                 ScRange aAbs = rRef.toAbs(rPos);
@@ -2985,24 +2984,23 @@ void ScTokenArray::MoveReference( const ScAddress& rPos, SCTAB nTab, SCCOL nCol1
                     // Must be a single-sheet reference.
                     break;
 
-                if (aAbs.aStart.Col() != aAbs.aEnd.Col())
-                    // Whole range must fit in a single column.
+                if (aAbs.aStart.Row() != aAbs.aEnd.Row())
+                    // Whole range must fit in a single row.
                     break;
 
-                if (aAbs.aStart.Tab() == nTab && nRow1 <= aAbs.aStart.Row() && aAbs.aEnd.Row() <= nRow2)
+                if (aAbs.aStart.Tab() == nTab && nCol1 <= aAbs.aStart.Col() && aAbs.aEnd.Col() <= nCol2)
                 {
-                    // Inside reordered row range.
-                    sc::RowReorderMapType::const_iterator it = rRowMap.find(aAbs.aStart.Col());
-                    if (it != rColMap.end())
+                    // Inside reordered column range.
+                    sc::RowReorderMapType::const_iterator it = rRowMap.find(aAbs.aStart.Row());
+                    if (it != rRowMap.end())
                     {
-                        // This column is reordered.
-                        SCCOL nNewCol = it->second;
-                        aAbs.aStart.SetCol(nNewCol);
-                        aAbs.aEnd.SetCol(nNewCol);
+                        // This row is reordered.
+                        SCCOL nNewRow = it->second;
+                        aAbs.aStart.SetRow(nNewRow);
+                        aAbs.aEnd.SetRow(nNewRow);
                         rRef.SetRange(aAbs, rPos);
                     }
                 }
-#endif
             }
             break;
             default:
commit 9eec08cc52875e6703f8f4915ed4960028a6708f
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed Jun 4 15:24:34 2014 -0400

    No need to try to unshare formula cells within sorted range.
    
    Because they are already unshared during the sorting process.
    
    Change-Id: I3a485397c575deab620217505bbbad8c3307119a

diff --git a/sc/inc/listenerquery.hxx b/sc/inc/listenerquery.hxx
index f3178fc..2cbc957 100644
--- a/sc/inc/listenerquery.hxx
+++ b/sc/inc/listenerquery.hxx
@@ -10,12 +10,9 @@
 #ifndef SC_LISTENERQUERY_HXX
 #define SC_LISTENERQUERY_HXX
 
-#include <types.hxx>
-
+#include <address.hxx>
 #include <svl/listener.hxx>
 
-class ScAddress;
-
 namespace sc {
 
 /**
@@ -32,6 +29,7 @@ public:
     RefQueryFormulaGroup();
     virtual ~RefQueryFormulaGroup();
 
+    void setSkipRange( const ScRange& rRange );
     void add( const ScAddress& rPos );
 
     /**
@@ -41,7 +39,7 @@ public:
     const TabsType& getAllPositions() const;
 
 private:
-
+    ScRange maSkipRange;
     TabsType maTabs;
 };
 
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index d112954..4ad3922 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -845,6 +845,8 @@ void ScTable::SortReorderByRow( ScSortInfoArray* pArray, ScProgress* pProgress )
     // Collect positions of all shared formula cells outside the sorted range,
     // and make them unshared before notifying them.
     sc::RefQueryFormulaGroup aFormulaGroupPos;
+    aFormulaGroupPos.setSkipRange(ScRange(aSortParam.nCol1, nRow1, nTab, aSortParam.nCol2, nRow2, nTab));
+
     std::for_each(aListeners.begin(), aListeners.end(), FormulaGroupPosCollector(aFormulaGroupPos));
     const sc::RefQueryFormulaGroup::TabsType& rGroupTabs = aFormulaGroupPos.getAllPositions();
     sc::RefQueryFormulaGroup::TabsType::const_iterator itGroupTab = rGroupTabs.begin(), itGroupTabEnd = rGroupTabs.end();
diff --git a/sc/source/core/tool/listenerquery.cxx b/sc/source/core/tool/listenerquery.cxx
index a207762..bf9d38f 100644
--- a/sc/source/core/tool/listenerquery.cxx
+++ b/sc/source/core/tool/listenerquery.cxx
@@ -13,14 +13,26 @@
 
 namespace sc {
 
-RefQueryFormulaGroup::RefQueryFormulaGroup() : SvtListener::QueryBase(SC_LISTENER_QUERY_FORMULA_GROUP_POS) {}
+RefQueryFormulaGroup::RefQueryFormulaGroup() :
+    SvtListener::QueryBase(SC_LISTENER_QUERY_FORMULA_GROUP_POS),
+    maSkipRange(ScAddress::INITIALIZE_INVALID) {}
+
 RefQueryFormulaGroup::~RefQueryFormulaGroup() {}
 
+void RefQueryFormulaGroup::setSkipRange( const ScRange& rRange )
+{
+    maSkipRange = rRange;
+}
+
 void RefQueryFormulaGroup::add( const ScAddress& rPos )
 {
     if (!rPos.IsValid())
         return;
 
+    if (maSkipRange.IsValid() && maSkipRange.In(rPos))
+        // This is within the skip range.  Skip it.
+        return;
+
     TabsType::iterator itTab = maTabs.find(rPos.Tab());
     if (itTab == maTabs.end())
     {
commit 48c3c2cb6ccf149bee135f257b1ffc38c763823b
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed Jun 4 15:16:24 2014 -0400

    Don't forget to unshare formula cells on other sheets as well.
    
    Change-Id: I2a4f6545055f0230608c7765ff41de48de6d1065

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 8f8d3b0..5897fe3 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -2062,6 +2062,17 @@ public:
 
     size_t GetFormulaHash( const ScAddress& rPos ) const;
 
+    /**
+     * Make specified formula cells non-grouped.
+     *
+     * @param nTab sheet index
+     * @param nCol column index
+     * @param rRows list of row indices at which formula cells are to be
+     *              unshared. This call sorts the passed row indices and
+     *              removes duplicates, which is why the caller must pass it
+     *              as reference.
+     */
+    void UnshareFormulaCells( SCTAB nTab, SCCOL nCol, std::vector<SCROW>& rRows );
     void RegroupFormulaCells( SCTAB nTab, SCCOL nCol );
 
     ScFormulaVectorState GetFormulaVectorState( const ScAddress& rPos ) const;
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 8196b1f..929ea6f 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -880,6 +880,7 @@ public:
     formula::FormulaTokenRef ResolveStaticReference( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 );
     formula::VectorRefArray FetchVectorRefArray( SCCOL nCol, SCROW nRow1, SCROW nRow2 );
 
+    void UnshareFormulaCells( SCCOL nCol, std::vector<SCROW>& rRows );
     void RegroupFormulaCells( SCCOL nCol );
 
     ScRefCellValue GetRefCellValue( SCCOL nCol, SCROW nRow );
diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx
index 4eefc18..d44bc33 100644
--- a/sc/source/core/data/document10.cxx
+++ b/sc/source/core/data/document10.cxx
@@ -288,6 +288,15 @@ bool ScDocument::HasUniformRowHeight( SCTAB nTab, SCROW nRow1, SCROW nRow2 ) con
     return pTab->HasUniformRowHeight(nRow1, nRow2);
 }
 
+void ScDocument::UnshareFormulaCells( SCTAB nTab, SCCOL nCol, std::vector<SCROW>& rRows )
+{
+    ScTable* pTab = FetchTable(nTab);
+    if (!pTab)
+        return;
+
+    pTab->UnshareFormulaCells(nCol, rRows);
+}
+
 void ScDocument::RegroupFormulaCells( SCTAB nTab, SCCOL nCol )
 {
     ScTable* pTab = FetchTable(nTab);
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index bb24cec..d112954 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -856,7 +856,7 @@ void ScTable::SortReorderByRow( ScSortInfoArray* pArray, ScProgress* pProgress )
         {
             const sc::RefQueryFormulaGroup::ColType& rCol = itCol->second;
             std::vector<SCROW> aBounds(rCol);
-            sc::SharedFormulaUtil::unshareFormulaCells(aCol[itCol->first].maCells, aBounds);
+            pDocument->UnshareFormulaCells(itGroupTab->first, itCol->first, aBounds);
         }
     }
 
@@ -873,7 +873,7 @@ void ScTable::SortReorderByRow( ScSortInfoArray* pArray, ScProgress* pProgress )
             pDocument->RegroupFormulaCells(itGroupTab->first, itCol->first);
     }
 
-    // And columns in sorted range too.
+    // Re-group columns in the sorted range too.
     for (SCCOL i = aSortParam.nCol1; i <= aSortParam.nCol2; ++i)
         aCol[i].RegroupFormulaCells();
 }
diff --git a/sc/source/core/data/table7.cxx b/sc/source/core/data/table7.cxx
index 3eb13f0..f39e529 100644
--- a/sc/source/core/data/table7.cxx
+++ b/sc/source/core/data/table7.cxx
@@ -13,6 +13,7 @@
 #include <clipparam.hxx>
 #include <bcaslot.hxx>
 #include <segmenttree.hxx>
+#include <sharedformula.hxx>
 
 bool ScTable::IsMerged( SCCOL nCol, SCROW nRow ) const
 {
@@ -117,6 +118,14 @@ bool ScTable::HasUniformRowHeight( SCROW nRow1, SCROW nRow2 ) const
     return nRow2 <= aData.mnRow2;
 }
 
+void ScTable::UnshareFormulaCells( SCCOL nCol, std::vector<SCROW>& rRows )
+{
+    if (!ValidCol(nCol))
+        return;
+
+    sc::SharedFormulaUtil::unshareFormulaCells(aCol[nCol].maCells, rRows);
+}
+
 void ScTable::RegroupFormulaCells( SCCOL nCol )
 {
     if (!ValidCol(nCol))
commit 35b41d6da3c6c48395105d3ba740083b03cc248a
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Mon Jun 2 20:38:24 2014 -0400

    Regroup affected formula cells after sort.
    
    Change-Id: I06968502424130e53ffdf26b7d009f4525e2227d

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 00649b7..8f8d3b0 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -2062,6 +2062,8 @@ public:
 
     size_t GetFormulaHash( const ScAddress& rPos ) const;
 
+    void RegroupFormulaCells( SCTAB nTab, SCCOL nCol );
+
     ScFormulaVectorState GetFormulaVectorState( const ScAddress& rPos ) const;
 
     formula::FormulaTokenRef ResolveStaticReference( const ScAddress& rPos );
diff --git a/sc/inc/listenerquery.hxx b/sc/inc/listenerquery.hxx
index 013b430..f3178fc 100644
--- a/sc/inc/listenerquery.hxx
+++ b/sc/inc/listenerquery.hxx
@@ -38,7 +38,7 @@ public:
      * Row positions in each column may contain duplicates.  Caller must
      * remove duplicates if necessary.
      */
-    const TabsType& getAllPositions();
+    const TabsType& getAllPositions() const;
 
 private:
 
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 412c6ca..8196b1f 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -880,6 +880,8 @@ public:
     formula::FormulaTokenRef ResolveStaticReference( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 );
     formula::VectorRefArray FetchVectorRefArray( SCCOL nCol, SCROW nRow1, SCROW nRow2 );
 
+    void RegroupFormulaCells( SCCOL nCol );
+
     ScRefCellValue GetRefCellValue( SCCOL nCol, SCROW nRow );
 
     SvtBroadcaster* GetBroadcaster( SCCOL nCol, SCROW nRow );
diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx
index a173362..4eefc18 100644
--- a/sc/source/core/data/document10.cxx
+++ b/sc/source/core/data/document10.cxx
@@ -288,4 +288,13 @@ bool ScDocument::HasUniformRowHeight( SCTAB nTab, SCROW nRow1, SCROW nRow2 ) con
     return pTab->HasUniformRowHeight(nRow1, nRow2);
 }
 
+void ScDocument::RegroupFormulaCells( SCTAB nTab, SCCOL nCol )
+{
+    ScTable* pTab = FetchTable(nTab);
+    if (!pTab)
+        return;
+
+    pTab->RegroupFormulaCells(nCol);
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 1966f07..bb24cec 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -842,28 +842,40 @@ void ScTable::SortReorderByRow( ScSortInfoArray* pArray, ScProgress* pProgress )
     std::sort(aListeners.begin(), aListeners.end());
     aListeners.erase(std::unique(aListeners.begin(), aListeners.end()), aListeners.end());
 
-    // Collect positions of all shared formula cells outside the sorted range.
+    // Collect positions of all shared formula cells outside the sorted range,
+    // and make them unshared before notifying them.
     sc::RefQueryFormulaGroup aFormulaGroupPos;
     std::for_each(aListeners.begin(), aListeners.end(), FormulaGroupPosCollector(aFormulaGroupPos));
+    const sc::RefQueryFormulaGroup::TabsType& rGroupTabs = aFormulaGroupPos.getAllPositions();
+    sc::RefQueryFormulaGroup::TabsType::const_iterator itGroupTab = rGroupTabs.begin(), itGroupTabEnd = rGroupTabs.end();
+    for (; itGroupTab != itGroupTabEnd; ++itGroupTab)
     {
-        const sc::RefQueryFormulaGroup::TabsType& rTabs = aFormulaGroupPos.getAllPositions();
-        sc::RefQueryFormulaGroup::TabsType::const_iterator itTab = rTabs.begin(), itTabEnd = rTabs.end();
-        for (; itTab != itTabEnd; ++itTab)
+        const sc::RefQueryFormulaGroup::ColsType& rCols = itGroupTab->second;
+        sc::RefQueryFormulaGroup::ColsType::const_iterator itCol = rCols.begin(), itColEnd = rCols.end();
+        for (; itCol != itColEnd; ++itCol)
         {
-            const sc::RefQueryFormulaGroup::ColsType& rCols = itTab->second;
-            sc::RefQueryFormulaGroup::ColsType::const_iterator itCol = rCols.begin(), itColEnd = rCols.end();
-            for (; itCol != itColEnd; ++itCol)
-            {
-                const sc::RefQueryFormulaGroup::ColType& rCol = itCol->second;
-                std::vector<SCROW> aBounds(rCol);
-                sc::SharedFormulaUtil::unshareFormulaCells(aCol[itCol->first].maCells, aBounds);
-            }
+            const sc::RefQueryFormulaGroup::ColType& rCol = itCol->second;
+            std::vector<SCROW> aBounds(rCol);
+            sc::SharedFormulaUtil::unshareFormulaCells(aCol[itCol->first].maCells, aBounds);
         }
     }
 
     // Notify the listeners.
     RowReorderNotifier aFunc(aRowMap, nTab, aSortParam.nCol1, aSortParam.nCol2);
     std::for_each(aListeners.begin(), aListeners.end(), aFunc);
+
+    // Re-group formulas in affected columns.
+    for (itGroupTab = rGroupTabs.begin(); itGroupTab != itGroupTabEnd; ++itGroupTab)
+    {
+        const sc::RefQueryFormulaGroup::ColsType& rCols = itGroupTab->second;
+        sc::RefQueryFormulaGroup::ColsType::const_iterator itCol = rCols.begin(), itColEnd = rCols.end();
+        for (; itCol != itColEnd; ++itCol)
+            pDocument->RegroupFormulaCells(itGroupTab->first, itCol->first);
+    }
+
+    // And columns in sorted range too.
+    for (SCCOL i = aSortParam.nCol1; i <= aSortParam.nCol2; ++i)
+        aCol[i].RegroupFormulaCells();
 }
 
 short ScTable::CompareCell(
diff --git a/sc/source/core/data/table7.cxx b/sc/source/core/data/table7.cxx
index 845c720..3eb13f0 100644
--- a/sc/source/core/data/table7.cxx
+++ b/sc/source/core/data/table7.cxx
@@ -117,4 +117,12 @@ bool ScTable::HasUniformRowHeight( SCROW nRow1, SCROW nRow2 ) const
     return nRow2 <= aData.mnRow2;
 }
 
+void ScTable::RegroupFormulaCells( SCCOL nCol )
+{
+    if (!ValidCol(nCol))
+        return;
+
+    aCol[nCol].RegroupFormulaCells();
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/listenerquery.cxx b/sc/source/core/tool/listenerquery.cxx
index 549e500..a207762 100644
--- a/sc/source/core/tool/listenerquery.cxx
+++ b/sc/source/core/tool/listenerquery.cxx
@@ -50,7 +50,7 @@ void RefQueryFormulaGroup::add( const ScAddress& rPos )
     rCol.push_back(rPos.Row());
 }
 
-const RefQueryFormulaGroup::TabsType& RefQueryFormulaGroup::getAllPositions()
+const RefQueryFormulaGroup::TabsType& RefQueryFormulaGroup::getAllPositions() const
 {
     return maTabs;
 }
commit 7d28b4e6c69426475d044ea96c30bd582a20cfcb
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Mon Jun 2 18:29:27 2014 -0400

    First cut on reference update on sort by row.
    
    Change-Id: I641aff45a1dee35350f25a857952ed33c11d6a93

diff --git a/include/svl/listener.hxx b/include/svl/listener.hxx
index 1c98458..8b47fda 100644
--- a/include/svl/listener.hxx
+++ b/include/svl/listener.hxx
@@ -34,6 +34,16 @@ class SVL_DLLPUBLIC SvtListener
     const SvtListener&  operator=(const SvtListener &); // n.i., ist verboten
 
 public:
+    class SVL_DLLPUBLIC QueryBase
+    {
+        sal_uInt16 mnId;
+    public:
+        QueryBase( sal_uInt16 nId );
+        virtual ~QueryBase();
+
+        sal_uInt16 getId() const;
+    };
+
     SvtListener();
     SvtListener( const SvtListener &r );
     virtual ~SvtListener();
@@ -43,9 +53,11 @@ public:
     void EndListeningAll();
     bool IsListening( SvtBroadcaster& rBroadcaster ) const;
 
+    void CopyAllBroadcasters( const SvtListener& r );
     bool HasBroadcaster() const;
 
     virtual void Notify( const SfxHint& rHint );
+    virtual void Query( QueryBase& rQuery ) const;
 };
 
 
diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index 9b55aa4..8e42c63 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -237,6 +237,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
     sc/source/core/tool/interpr6 \
     sc/source/core/tool/interpr7 \
     sc/source/core/tool/jumpmatrix \
+    sc/source/core/tool/listenerquery \
     sc/source/core/tool/lookupcache \
     sc/source/core/tool/navicfg \
     sc/source/core/tool/odffmap \
diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx
index 9e55aec..d692ac6 100644
--- a/sc/inc/formulacell.hxx
+++ b/sc/inc/formulacell.hxx
@@ -321,6 +321,8 @@ public:
     void            SetNextTrack( ScFormulaCell* pF );
 
     virtual void Notify( const SfxHint& rHint ) SAL_OVERRIDE;
+    virtual void Query( SvtListener::QueryBase& rQuery ) const SAL_OVERRIDE;
+
     void SetCompile( bool bVal );
     ScDocument* GetDocument() const { return pDocument;}
     void            SetMatColsRows( SCCOL nCols, SCROW nRows, bool bDirtyFlag=true );
diff --git a/sc/inc/listenerquery.hxx b/sc/inc/listenerquery.hxx
new file mode 100644
index 0000000..013b430
--- /dev/null
+++ b/sc/inc/listenerquery.hxx
@@ -0,0 +1,52 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef SC_LISTENERQUERY_HXX
+#define SC_LISTENERQUERY_HXX
+
+#include <types.hxx>
+
+#include <svl/listener.hxx>
+
+class ScAddress;
+
+namespace sc {
+
+/**
+ * Used to collect positions of formula cells that belong to a formula
+ * group.
+ */
+class RefQueryFormulaGroup : public SvtListener::QueryBase
+{
+public:
+    typedef std::vector<SCROW> ColType;
+    typedef boost::unordered_map<SCCOL,ColType> ColsType;
+    typedef boost::unordered_map<SCTAB,ColsType> TabsType;
+
+    RefQueryFormulaGroup();
+    virtual ~RefQueryFormulaGroup();
+
+    void add( const ScAddress& rPos );
+
+    /**
+     * Row positions in each column may contain duplicates.  Caller must
+     * remove duplicates if necessary.
+     */
+    const TabsType& getAllPositions();
+
+private:
+
+    TabsType maTabs;
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/listenerqueryids.hxx b/sc/inc/listenerqueryids.hxx
new file mode 100644
index 0000000..48f240b
--- /dev/null
+++ b/sc/inc/listenerqueryids.hxx
@@ -0,0 +1,17 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef SC_LISTENERQUERYIDS_HXX
+#define SC_LISTENERQUERYIDS_HXX
+
+#define SC_LISTENER_QUERY_FORMULA_GROUP_POS 0
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/inc/refhint.hxx b/sc/inc/refhint.hxx
index 1f92731..81449ad 100644
--- a/sc/inc/refhint.hxx
+++ b/sc/inc/refhint.hxx
@@ -18,7 +18,11 @@ namespace sc {
 class RefHint : public SfxSimpleHint
 {
 public:
-    enum Type { Moved, ColumnReordered };
+    enum Type {
+        Moved,
+        ColumnReordered,
+        RowReordered
+    };
 
 private:
     Type meType;
@@ -73,6 +77,24 @@ public:
     SCROW getEndRow() const;
 };
 
+class RefRowReorderHint : public RefHint
+{
+    const sc::RowReorderMapType& mrRowMap;
+    SCTAB mnTab;
+    SCCOL mnCol1;
+    SCCOL mnCol2;
+
+public:
+    RefRowReorderHint( const sc::RowReorderMapType& rRowMap, SCTAB nTab, SCCOL nCol1, SCCOL nCol2 );
+    virtual ~RefRowReorderHint();
+
+    const sc::RowReorderMapType& getRowMap() const;
+
+    SCTAB getTab() const;
+    SCCOL getStartColumn() const;
+    SCCOL getEndColumn() const;
+};
+
 }
 
 #endif
diff --git a/sc/inc/sharedformula.hxx b/sc/inc/sharedformula.hxx
index 840b63b..b29843f 100644
--- a/sc/inc/sharedformula.hxx
+++ b/sc/inc/sharedformula.hxx
@@ -100,6 +100,15 @@ public:
      * @param rCell formula cell instance
      */
     static void unshareFormulaCell(const CellStoreType::position_type& aPos, ScFormulaCell& rCell);
+
+    /**
+     * Make specified formula cells non-shared ones, and split them off from
+     * their respective adjacent formula cell groups.
+     *
+     * @param rCells cell storage container
+     * @param rRows row positions at which to unshare formula cells.
+     */
+    static void unshareFormulaCells(CellStoreType& rCells, std::vector<SCROW>& rRows);
 };
 
 }
diff --git a/sc/inc/tokenarray.hxx b/sc/inc/tokenarray.hxx
index a83e115..082f152 100644
--- a/sc/inc/tokenarray.hxx
+++ b/sc/inc/tokenarray.hxx
@@ -170,6 +170,8 @@ public:
      */
     void MoveReference( const ScAddress& rPos, SCTAB nTab, SCROW nRow1, SCROW nRow2, const sc::ColReorderMapType& rColMap );
 
+    void MoveReference( const ScAddress& rPos, SCTAB nTab, SCCOL nCol1, SCCOL nCol2, const sc::RowReorderMapType& rRowMap );
+
     /**
      * Adjust all references in named expression. In named expression, we only
      * update absolute positions, and leave relative positions intact.
diff --git a/sc/inc/types.hxx b/sc/inc/types.hxx
index 8d37ad4..976baaf 100644
--- a/sc/inc/types.hxx
+++ b/sc/inc/types.hxx
@@ -99,6 +99,7 @@ struct RangeMatrix
 };
 
 typedef boost::unordered_map<SCCOL,SCCOL> ColReorderMapType;
+typedef boost::unordered_map<SCROW,SCROW> RowReorderMapType;
 
 }
 
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index f36eea3..0285630 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -56,6 +56,8 @@
 #include "refupdatecontext.hxx"
 #include <tokenstringcontext.hxx>
 #include <refhint.hxx>
+#include <listenerquery.hxx>
+#include <listenerqueryids.hxx>
 
 #include <boost/scoped_ptr.hpp>
 
@@ -1946,6 +1948,18 @@ void ScFormulaCell::Notify( const SfxHint& rHint )
                         aPos, rRefColReorder.getTab(), rRefColReorder.getStartRow(), rRefColReorder.getEndRow(), rRefColReorder.getColMap());
             }
             break;
+            case sc::RefHint::RowReordered:
+            {
+                const sc::RefRowReorderHint& rRefRowReorder =
+                    static_cast<const sc::RefRowReorderHint&>(rRefHint);
+                if (!IsShared() || IsSharedTop())
+                    pCode->MoveReference(
+                        aPos, rRefRowReorder.getTab(),
+                        rRefRowReorder.getStartColumn(),
+                        rRefRowReorder.getEndColumn(),
+                        rRefRowReorder.getRowMap());
+            }
+            break;
             default:
                 ;
         }
@@ -1988,6 +2002,23 @@ void ScFormulaCell::Notify( const SfxHint& rHint )
     }
 }
 
+void ScFormulaCell::Query( SvtListener::QueryBase& rQuery ) const
+{
+    switch (rQuery.getId())
+    {
+        case SC_LISTENER_QUERY_FORMULA_GROUP_POS:
+        {
+            sc::RefQueryFormulaGroup& rRefQuery =
+                static_cast<sc::RefQueryFormulaGroup&>(rQuery);
+            if (IsShared())
+                rRefQuery.add(aPos);
+        }
+        break;
+        default:
+            ;
+    }
+}
+
 void ScFormulaCell::SetDirty( bool bDirtyFlag )
 {
     if ( !IsInChangeTrack() )
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 959a919..1966f07 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -59,6 +59,7 @@
 #include <listenercontext.hxx>
 #include <sharedformula.hxx>
 #include <refhint.hxx>
+#include <listenerquery.hxx>
 
 #include <svl/sharedstringpool.hxx>
 
@@ -527,12 +528,13 @@ void ScTable::DestroySortCollator()
 
 namespace {
 
-class ColReorderNotifier : std::unary_function<SvtListener*, void>
+template<typename _Hint, typename _ReorderMap, typename _Index>
+class ReorderNotifier : std::unary_function<SvtListener*, void>
 {
-    sc::RefColReorderHint maHint;
+    _Hint maHint;
 public:
-    ColReorderNotifier( const sc::ColReorderMapType& rColMap, SCTAB nTab, SCROW nRow1, SCROW nRow2 ) :
-        maHint(rColMap, nTab, nRow1, nRow2) {}
+    ReorderNotifier( const _ReorderMap& rMap, SCTAB nTab, _Index nPos1, _Index nPos2 ) :
+        maHint(rMap, nTab, nPos1, nPos2) {}
 
     void operator() ( SvtListener* p )
     {
@@ -540,6 +542,22 @@ public:
     }
 };
 
+typedef ReorderNotifier<sc::RefColReorderHint, sc::ColReorderMapType, SCROW> ColReorderNotifier;
+typedef ReorderNotifier<sc::RefRowReorderHint, sc::RowReorderMapType, SCROW> RowReorderNotifier;
+
+class FormulaGroupPosCollector : std::unary_function<SvtListener*, void>
+{
+    sc::RefQueryFormulaGroup& mrQuery;
+
+public:
+    FormulaGroupPosCollector( sc::RefQueryFormulaGroup& rQuery ) : mrQuery(rQuery) {}
+
+    void operator() ( SvtListener* p )
+    {
+        p->Query(mrQuery);
+    }
+};
+
 }
 
 void ScTable::SortReorder( ScSortInfoArray* pArray, ScProgress* pProgress )
@@ -596,7 +614,7 @@ void ScTable::SortReorder( ScSortInfoArray* pArray, ScProgress* pProgress )
     for (size_t i = 0, n = rOldIndices.size(); i < n; ++i)
     {
         SCCOL nNew = i + nStart;
-        SCROW nOld = rOldIndices[i];
+        SCCOL nOld = rOldIndices[i];
         aColMap.insert(sc::ColReorderMapType::value_type(nOld, nNew));
     }
 
@@ -632,10 +650,6 @@ void ScTable::SortReorderByRow( ScSortInfoArray* pArray, ScProgress* pProgress )
     ScSortInfoArray::RowsType* pRows = pArray->GetDataRows();
     assert(pRows); // In sort-by-row mode we must have data rows already populated.
 
-    // Detach all formula cells within the sorted range first.
-    sc::EndListeningContext aCxt(*pDocument);
-    DetachFormulaCells(aCxt, aSortParam.nCol1, nRow1, aSortParam.nCol2, nRow2);
-
     // Cells in the data rows only reference values in the document. Make
     // a copy before updating the document.
 
@@ -678,13 +692,13 @@ void ScTable::SortReorderByRow( ScSortInfoArray* pArray, ScProgress* pProgress )
                 case CELLTYPE_FORMULA:
                 {
                     assert(rCell.mpAttr);
-                    size_t n = rCellStore.size();
-                    sc::CellStoreType::iterator itBlk = rCellStore.push_back(rCell.maCell.mpFormula->Clone(aCellPos));
+                    ScAddress aOldPos = rCell.maCell.mpFormula->aPos;
+
+                    ScFormulaCell* pNew = rCell.maCell.mpFormula->Clone(aCellPos);
+                    pNew->CopyAllBroadcasters(*rCell.maCell.mpFormula);
+                    pNew->GetCode()->AdjustReferenceOnMovedOrigin(aOldPos, aCellPos);
 
-                    // Join the formula cells as we fill the container.
-                    size_t nOffset = n - itBlk->position;
-                    sc::CellStoreType::position_type aPos(itBlk, nOffset);
-                    sc::SharedFormulaUtil::joinFormulaCellAbove(aPos);
+                    sc::CellStoreType::iterator itBlk = rCellStore.push_back(pNew);
                 }
                 break;
                 default:
@@ -808,10 +822,48 @@ void ScTable::SortReorderByRow( ScSortInfoArray* pArray, ScProgress* pProgress )
             SetRowFiltered(it->mnRow1, it->mnRow2, true);
     }
 
-    // Attach all formula cells within sorted range, to have them start listening again.
-    sc::StartListeningContext aStartListenCxt(*pDocument);
-    AttachFormulaCells(
-        aStartListenCxt, aSortParam.nCol1, nRow1, aSortParam.nCol2, nRow2);
+    // Set up row reorder map (for later broadcasting of reference updates).
+    sc::RowReorderMapType aRowMap;
+    const std::vector<SCCOLROW>& rOldIndices = pArray->GetOldIndices();
+    for (size_t i = 0, n = rOldIndices.size(); i < n; ++i)
+    {
+        SCROW nNew = i + nRow1;
+        SCROW nOld = rOldIndices[i];
+        aRowMap.insert(sc::RowReorderMapType::value_type(nOld, nNew));
+    }
+
+    // Collect all listeners within sorted range ahead of time.
+    std::vector<SvtListener*> aListeners;
+    for (SCCOL nCol = aSortParam.nCol1; nCol <= aSortParam.nCol2; ++nCol)
+        aCol[nCol].CollectListeners(aListeners, nRow1, nRow2);
+
+    // Remove any duplicate listener entries.  We must ensure that we notify
+    // each unique listener only once.
+    std::sort(aListeners.begin(), aListeners.end());
+    aListeners.erase(std::unique(aListeners.begin(), aListeners.end()), aListeners.end());
+
+    // Collect positions of all shared formula cells outside the sorted range.
+    sc::RefQueryFormulaGroup aFormulaGroupPos;
+    std::for_each(aListeners.begin(), aListeners.end(), FormulaGroupPosCollector(aFormulaGroupPos));
+    {
+        const sc::RefQueryFormulaGroup::TabsType& rTabs = aFormulaGroupPos.getAllPositions();
+        sc::RefQueryFormulaGroup::TabsType::const_iterator itTab = rTabs.begin(), itTabEnd = rTabs.end();
+        for (; itTab != itTabEnd; ++itTab)
+        {
+            const sc::RefQueryFormulaGroup::ColsType& rCols = itTab->second;
+            sc::RefQueryFormulaGroup::ColsType::const_iterator itCol = rCols.begin(), itColEnd = rCols.end();
+            for (; itCol != itColEnd; ++itCol)
+            {
+                const sc::RefQueryFormulaGroup::ColType& rCol = itCol->second;
+                std::vector<SCROW> aBounds(rCol);
+                sc::SharedFormulaUtil::unshareFormulaCells(aCol[itCol->first].maCells, aBounds);
+            }
+        }
+    }
+
+    // Notify the listeners.
+    RowReorderNotifier aFunc(aRowMap, nTab, aSortParam.nCol1, aSortParam.nCol2);
+    std::for_each(aListeners.begin(), aListeners.end(), aFunc);
 }
 
 short ScTable::CompareCell(
diff --git a/sc/source/core/tool/listenerquery.cxx b/sc/source/core/tool/listenerquery.cxx
new file mode 100644
index 0000000..549e500
--- /dev/null
+++ b/sc/source/core/tool/listenerquery.cxx
@@ -0,0 +1,60 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <listenerquery.hxx>
+#include <listenerqueryids.hxx>
+#include <address.hxx>
+
+namespace sc {
+
+RefQueryFormulaGroup::RefQueryFormulaGroup() : SvtListener::QueryBase(SC_LISTENER_QUERY_FORMULA_GROUP_POS) {}
+RefQueryFormulaGroup::~RefQueryFormulaGroup() {}
+
+void RefQueryFormulaGroup::add( const ScAddress& rPos )
+{
+    if (!rPos.IsValid())
+        return;
+
+    TabsType::iterator itTab = maTabs.find(rPos.Tab());
+    if (itTab == maTabs.end())
+    {
+        std::pair<TabsType::iterator,bool> r =
+            maTabs.insert(TabsType::value_type(rPos.Tab(), ColsType()));
+        if (!r.second)
+            // Insertion failed.
+            return;
+
+        itTab = r.first;
+    }
+
+    ColsType& rCols = itTab->second;
+    ColsType::iterator itCol = rCols.find(rPos.Col());
+    if (itCol == rCols.end())
+    {
+        std::pair<ColsType::iterator,bool> r =
+            rCols.insert(ColsType::value_type(rPos.Col(), ColType()));
+        if (!r.second)
+            // Insertion failed.
+            return;
+
+        itCol = r.first;
+    }
+
+    ColType& rCol = itCol->second;
+    rCol.push_back(rPos.Row());
+}
+
+const RefQueryFormulaGroup::TabsType& RefQueryFormulaGroup::getAllPositions()
+{
+    return maTabs;
+}
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/refhint.cxx b/sc/source/core/tool/refhint.cxx
index 80aef93..8e5540a 100644
--- a/sc/source/core/tool/refhint.cxx
+++ b/sc/source/core/tool/refhint.cxx
@@ -59,6 +59,31 @@ SCROW RefColReorderHint::getEndRow() const
     return mnRow2;
 }
 
+RefRowReorderHint::RefRowReorderHint( const sc::RowReorderMapType& rRowMap, SCTAB nTab, SCCOL nCol1, SCCOL nCol2 ) :
+    RefHint(RowReordered), mrRowMap(rRowMap), mnTab(nTab), mnCol1(nCol1), mnCol2(nCol2) {}
+
+RefRowReorderHint::~RefRowReorderHint() {}
+
+const sc::RowReorderMapType& RefRowReorderHint::getRowMap() const
+{
+    return mrRowMap;
+}
+
+SCTAB RefRowReorderHint::getTab() const
+{
+    return mnTab;
+}
+
+SCCOL RefRowReorderHint::getStartColumn() const
+{
+    return mnCol1;
+}
+
+SCCOL RefRowReorderHint::getEndColumn() const
+{
+    return mnCol2;
+}
+
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/sharedformula.cxx b/sc/source/core/tool/sharedformula.cxx
index ed35690..6f66365 100644
--- a/sc/source/core/tool/sharedformula.cxx
+++ b/sc/source/core/tool/sharedformula.cxx
@@ -297,6 +297,35 @@ void SharedFormulaUtil::unshareFormulaCell(const CellStoreType::position_type& a
     rCell.SetCellGroup(xNone);
 }
 
+void SharedFormulaUtil::unshareFormulaCells(CellStoreType& rCells, std::vector<SCROW>& rRows)
+{
+    if (rRows.empty())
+        return;
+
+    // Sort and remove duplicates.
+    std::sort(rRows.begin(), rRows.end());
+    rRows.erase(std::unique(rRows.begin(), rRows.end()), rRows.end());
+
+    // Add next cell positions to the list (to ensure that each position becomes a single cell).
+    std::vector<SCROW> aRows2;
+    std::vector<SCROW>::const_iterator it = rRows.begin(), itEnd = rRows.end();
+    for (; it != itEnd; ++it)
+    {
+        if (*it > MAXROW)
+            break;
+
+        aRows2.push_back(*it);
+
+        if (*it < MAXROW)
+            aRows2.push_back(*it+1);
+    }
+
+    // Remove duplicates again (the vector should still be sorted).
+    aRows2.erase(std::unique(aRows2.begin(), aRows2.end()), aRows2.end());
+
+    splitFormulaCellGroups(rCells, aRows2);
+}
+
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 8f8fe84..2d55882 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -2946,6 +2946,71 @@ void ScTokenArray::MoveReference(
     }
 }
 
+void ScTokenArray::MoveReference( const ScAddress& rPos, SCTAB nTab, SCCOL nCol1, SCCOL nCol2, const sc::RowReorderMapType& rRowMap )
+{
+    FormulaToken** p = pCode;
+    FormulaToken** pEnd = p + static_cast<size_t>(nLen);
+    for (; p != pEnd; ++p)
+    {
+        switch ((*p)->GetType())
+        {
+            case svSingleRef:
+            {
+                ScToken* pToken = static_cast<ScToken*>(*p);
+                ScSingleRefData& rRef = pToken->GetSingleRef();
+                ScAddress aAbs = rRef.toAbs(rPos);
+
+                if (aAbs.Tab() == nTab && nCol1 <= aAbs.Col() && aAbs.Col() <= nCol2)
+                {
+                    // Inside reordered column range.
+                    sc::RowReorderMapType::const_iterator it = rRowMap.find(aAbs.Row());
+                    if (it != rRowMap.end())
+                    {
+                        // This column is reordered.
+                        SCROW nNewRow = it->second;
+                        aAbs.SetRow(nNewRow);
+                        rRef.SetAddress(aAbs, rPos);
+                    }
+                }
+            }
+            break;
+            case svDoubleRef:
+            {
+#if 0
+                ScToken* pToken = static_cast<ScToken*>(*p);
+                ScComplexRefData& rRef = pToken->GetDoubleRef();
+                ScRange aAbs = rRef.toAbs(rPos);
+
+                if (aAbs.aStart.Tab() != aAbs.aEnd.Tab())
+                    // Must be a single-sheet reference.
+                    break;
+
+                if (aAbs.aStart.Col() != aAbs.aEnd.Col())
+                    // Whole range must fit in a single column.
+                    break;
+
+                if (aAbs.aStart.Tab() == nTab && nRow1 <= aAbs.aStart.Row() && aAbs.aEnd.Row() <= nRow2)
+                {
+                    // Inside reordered row range.
+                    sc::RowReorderMapType::const_iterator it = rRowMap.find(aAbs.aStart.Col());
+                    if (it != rColMap.end())
+                    {
+                        // This column is reordered.
+                        SCCOL nNewCol = it->second;
+                        aAbs.aStart.SetCol(nNewCol);
+                        aAbs.aEnd.SetCol(nNewCol);
+                        rRef.SetRange(aAbs, rPos);
+                    }
+                }
+#endif
+            }
+            break;
+            default:
+                ;
+        }
+    }
+}
+
 namespace {
 
 bool adjustSingleRefInName(
diff --git a/svl/source/notify/listener.cxx b/svl/source/notify/listener.cxx
index 66207bf..f905090 100644
--- a/svl/source/notify/listener.cxx
+++ b/svl/source/notify/listener.cxx
@@ -21,6 +21,14 @@
 #include <svl/broadcast.hxx>
 #include <tools/debug.hxx>
 
+SvtListener::QueryBase::QueryBase( sal_uInt16 nId ) : mnId(nId) {}
+SvtListener::QueryBase::~QueryBase() {}
+
+sal_uInt16 SvtListener::QueryBase::getId() const
+{
+    return mnId;
+}
+
 SvtListener::SvtListener() {}
 
 SvtListener::SvtListener( const SvtListener &r ) :
@@ -75,12 +83,26 @@ bool SvtListener::IsListening( SvtBroadcaster& rBroadcaster ) const
     return maBroadcasters.count(&rBroadcaster) > 0;
 }
 
+void SvtListener::CopyAllBroadcasters( const SvtListener& r )
+{
+    BroadcastersType aCopy(r.maBroadcasters);
+    maBroadcasters.swap(aCopy);
+    BroadcastersType::iterator it = maBroadcasters.begin(), itEnd = maBroadcasters.end();
+    for (; it != itEnd; ++it)
+    {
+        SvtBroadcaster* p = *it;
+        p->Add(this);
+    }
+}
+
 bool SvtListener::HasBroadcaster() const
 {
     return !maBroadcasters.empty();
 }
 
-void SvtListener::Notify( const SfxHint& ) {}
+void SvtListener::Notify( const SfxHint& /*rHint*/ ) {}
+
+void SvtListener::Query( QueryBase& /*rQuery*/ ) const {}
 
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 3c6e378fd81b2bfd8a35e12557a90fa40428920e
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Thu Jun 26 23:25:21 2014 -0400

    Make these non inline.
    
    Don't do this please...
    
    Change-Id: Id90490622bca10beabf7a1c92e51e55bc72a1db8

diff --git a/sc/inc/refhint.hxx b/sc/inc/refhint.hxx
index f8a6df7..1f92731 100644
--- a/sc/inc/refhint.hxx
+++ b/sc/inc/refhint.hxx
@@ -31,7 +31,7 @@ protected:
 public:
     virtual ~RefHint() = 0;
 
-    Type getType() const { return meType; }
+    Type getType() const;
 };
 
 class RefMovedHint : public RefHint
@@ -47,12 +47,12 @@ public:
     /**
      * Get the source range from which the references have moved.
      */
-    const ScRange& getRange() const { return maRange;}
+    const ScRange& getRange() const;
 
     /**
      * Get the movement vector.
      */
-    const ScAddress& getDelta() const { return maMoveDelta;}
+    const ScAddress& getDelta() const;
 };
 
 class RefColReorderHint : public RefHint
@@ -66,11 +66,11 @@ public:
     RefColReorderHint( const sc::ColReorderMapType& rColMap, SCTAB nTab, SCROW nRow1, SCROW nRow2 );
     virtual ~RefColReorderHint();
 
-    const sc::ColReorderMapType& getColMap() const { return mrColMap;}
+    const sc::ColReorderMapType& getColMap() const;
 
-    SCTAB getTab() const { return mnTab;}
-    SCROW getStartRow() const { return mnRow1;}
-    SCROW getEndRow() const { return mnRow2;}
+    SCTAB getTab() const;
+    SCROW getStartRow() const;
+    SCROW getEndRow() const;
 };
 
 }
diff --git a/sc/source/core/tool/refhint.cxx b/sc/source/core/tool/refhint.cxx
index 25dc699..80aef93 100644
--- a/sc/source/core/tool/refhint.cxx
+++ b/sc/source/core/tool/refhint.cxx
@@ -14,16 +14,51 @@ namespace sc {
 RefHint::RefHint( Type eType ) : SfxSimpleHint(SC_HINT_REFERENCE), meType(eType) {}
 RefHint::~RefHint() {}
 
+RefHint::Type RefHint::getType() const
+{
+    return meType;
+}
+
 RefMovedHint::RefMovedHint( const ScRange& rRange, const ScAddress& rMove ) :
     RefHint(Moved), maRange(rRange), maMoveDelta(rMove) {}
 
 RefMovedHint::~RefMovedHint() {}
 
+const ScRange& RefMovedHint::getRange() const
+{
+    return maRange;
+}
+
+const ScAddress& RefMovedHint::getDelta() const
+{
+    return maMoveDelta;
+}
+
 RefColReorderHint::RefColReorderHint( const sc::ColReorderMapType& rColMap, SCTAB nTab, SCROW nRow1, SCROW nRow2 ) :
     RefHint(ColumnReordered), mrColMap(rColMap), mnTab(nTab), mnRow1(nRow1), mnRow2(nRow2) {}
 
 RefColReorderHint::~RefColReorderHint() {}
 
+const sc::ColReorderMapType& RefColReorderHint::getColMap() const
+{
+    return mrColMap;
+}
+
+SCTAB RefColReorderHint::getTab() const
+{
+    return mnTab;
+}
+
+SCROW RefColReorderHint::getStartRow() const
+{
+    return mnRow1;
+}
+
+SCROW RefColReorderHint::getEndRow() const
+{
+    return mnRow2;
+}
+
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit ecde8155fefcdacb08177a10a4eddc24f6675b0b
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Thu Jun 26 14:51:47 2014 -0400

    fdo#79151: No need to offset column index by category labels.
    
    In fact, doing so would lead to a corrupt internal data table.  The
    internal data stores category labels separately from the column data, so
    there is no reason why we need to offset for category labels here.
    
    Change-Id: I29dd99e53837cba7a1e28d2a1ef39a5384378805

diff --git a/chart2/source/controller/dialogs/DataBrowserModel.cxx b/chart2/source/controller/dialogs/DataBrowserModel.cxx
index e2bff5b..16ac3a2 100644
--- a/chart2/source/controller/dialogs/DataBrowserModel.cxx
+++ b/chart2/source/controller/dialogs/DataBrowserModel.cxx
@@ -343,10 +343,6 @@ void DataBrowserModel::insertDataSeries( sal_Int32 nAfterColumnIndex )
     if (!xChartType.is())
         return;
 
-    sal_Int32 nOffset = 0;
-    if( xDiagram.is() && lcl_ShowCategories( xDiagram ))
-        nOffset = getCategoryColumnCount();
-
     // Get shared sequences of current series.  Normally multiple data series
     // only share "values-x" sequences. (TODO: simplify this logic).
     Reference< chart2::XDataSeriesContainer > xSeriesCnt( xChartType, uno::UNO_QUERY );
@@ -367,7 +363,6 @@ void DataBrowserModel::insertDataSeries( sal_Int32 nAfterColumnIndex )
         Sequence<Reference<chart2::data::XLabeledDataSequence> > aLSequences = xSource->getDataSequences();
         sal_Int32 nSeqIdx = 0;
         sal_Int32 nSeqSize = aLSequences.getLength();
-        nStartCol -= (nOffset - 1); // ???
         for (sal_Int32 nIndex = nStartCol; nSeqIdx < nSeqSize; ++nSeqIdx)
         {
             lcl_tSharedSeqVec::const_iterator aSharedIt(
commit 822d0e9db610ce3cbee2cf8d3154ee41218ea562
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Thu Jun 26 22:31:20 2014 -0400

    Use new GridPrinter instance for each table.
    
    resize() sometimes leads to a crash.  Need to debug later.
    
    Change-Id: Ia3809eb4f171369a58b84d5b44001692be1453a1

diff --git a/chart2/source/tools/InternalData.cxx b/chart2/source/tools/InternalData.cxx
index 72ce315..5265602 100644
--- a/chart2/source/tools/InternalData.cxx
+++ b/chart2/source/tools/InternalData.cxx
@@ -513,19 +513,37 @@ void InternalData::setComplexColumnLabels( const vector< vector< uno::Any > >& r
 void InternalData::dump() const
 {
     // Header
-    svl::GridPrinter aPrinter(1, m_nColumnCount, true);
-    for (sal_Int32 nCol = 0; nCol < m_nColumnCount; ++nCol)
+    if (!m_aColumnLabels.empty())
     {
-        if (m_aColumnLabels[nCol].empty())
-            continue;
+        svl::GridPrinter aPrinter(1, m_aColumnLabels.size(), true);
+        for (size_t nCol = 0; nCol < m_aColumnLabels.size(); ++nCol)
+        {
+            if (m_aColumnLabels[nCol].empty())
+                continue;
+
+            OUString aStr;
+            if (m_aColumnLabels[nCol][0] >>= aStr)
+                aPrinter.set(0, nCol, aStr);
+        }
+        aPrinter.print("Header");
+    }
 
-        OUString aStr;
-        if (m_aColumnLabels[nCol][0] >>= aStr)
-            aPrinter.set(0, nCol, aStr);
+    if (!m_aRowLabels.empty())
+    {
+        svl::GridPrinter aPrinter(m_aRowLabels.size(), m_aRowLabels[0].size());
+        for (size_t nRow = 0; nRow < m_aRowLabels.size(); ++nRow)
+        {
+            for (size_t nCol = 0; nCol < m_aRowLabels[nRow].size(); ++nCol)
+            {
+                OUString aStr;
+                if (m_aRowLabels[nRow].at(nCol) >>= aStr)
+                    aPrinter.set(nRow, nCol, aStr);
+            }
+        }
+        aPrinter.print("Row labels");
     }
-    aPrinter.print("Header");
 
-    aPrinter.resize(m_nRowCount, m_nColumnCount);
+    svl::GridPrinter aPrinter(m_nRowCount, m_nColumnCount);
 
     for (sal_Int32 nRow = 0; nRow < m_nRowCount; ++nRow)
     {
commit c6da1842956ceced501858d582f7dcaded0a324a
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Thu Jun 26 19:35:48 2014 -0400

    Track all uses of ErrorBarX and ErrorBarY UNO property names.
    
    Change-Id: I994424c98d977c3a8f9138cccc17348de813a9d7

diff --git a/chart2/CppunitTest_chart2_export.mk b/chart2/CppunitTest_chart2_export.mk
index c6bf682..3b941a9 100644
--- a/chart2/CppunitTest_chart2_export.mk
+++ b/chart2/CppunitTest_chart2_export.mk
@@ -60,6 +60,7 @@ $(eval $(call gb_CppunitTest_use_libraries,chart2_export, \
 ))
 
 $(eval $(call gb_CppunitTest_set_include,chart2_export,\
+    -I$(SRCDIR)/chart2/inc \
     $$(INCLUDE) \
 ))
 
diff --git a/chart2/CppunitTest_chart2_import.mk b/chart2/CppunitTest_chart2_import.mk
index 55ac39d..f925e58 100644
--- a/chart2/CppunitTest_chart2_import.mk
+++ b/chart2/CppunitTest_chart2_import.mk
@@ -59,6 +59,7 @@ $(eval $(call gb_CppunitTest_use_libraries,chart2_import, \
 ))
 
 $(eval $(call gb_CppunitTest_set_include,chart2_import,\
+    -I$(SRCDIR)/chart2/inc \
     $$(INCLUDE) \
 ))
 
diff --git a/chart2/inc/unonames.hxx b/chart2/inc/unonames.hxx
index 2b5f601..4975ed4 100644
--- a/chart2/inc/unonames.hxx
+++ b/chart2/inc/unonames.hxx
@@ -19,6 +19,8 @@
 #define CHART_UNONAME_CURVE_RESOLUTION      "CurveResolution"
 #define CHART_UNONAME_NUMFMT                "NumberFormat"
 #define CHART_UNONAME_LINK_TO_SRC_NUMFMT    "LinkNumberFormatToSource"
+#define CHART_UNONAME_ERRORBAR_X            "ErrorBarX"
+#define CHART_UNONAME_ERRORBAR_Y            "ErrorBarY"
 
 #endif
 
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index 80aab30..7ef8dc7 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -436,7 +436,7 @@ void Chart2ExportTest::testErrorBarXLSX()
 
         // test that y error bars are there
         Reference< beans::XPropertySet > xErrorBarYProps;
-        xPropSet->getPropertyValue("ErrorBarY") >>= xErrorBarYProps;
+        xPropSet->getPropertyValue(CHART_UNONAME_ERRORBAR_Y) >>= xErrorBarYProps;
         testErrorBar(xErrorBarYProps);
     }
 
@@ -453,7 +453,7 @@ void Chart2ExportTest::testErrorBarXLSX()
 
         // test that y error bars are there
         Reference< beans::XPropertySet > xErrorBarYProps;
-        xPropSet->getPropertyValue("ErrorBarY") >>= xErrorBarYProps;
+        xPropSet->getPropertyValue(CHART_UNONAME_ERRORBAR_Y) >>= xErrorBarYProps;
         testErrorBar(xErrorBarYProps);
     }
 }
@@ -832,7 +832,7 @@ void Chart2ExportTest::testErrorBarDataRangeODS()
 
     // test that y error bars are there
     Reference< beans::XPropertySet > xErrorBarYProps;
-    xPropSet->getPropertyValue("ErrorBarY") >>= xErrorBarYProps;
+    xPropSet->getPropertyValue(CHART_UNONAME_ERRORBAR_Y) >>= xErrorBarYProps;
     uno::Any aAny = xErrorBarYProps->getPropertyValue("ErrorBarRangePositive");
     CPPUNIT_ASSERT(aAny.hasValue());
     OUString aPosRange;
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index d5a42a1..1f31cad 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -89,7 +89,7 @@ void Chart2ImportTest::Fdo60083()
 
     // test that y error bars are there
     Reference< beans::XPropertySet > xErrorBarYProps;
-    xPropSet->getPropertyValue("ErrorBarY") >>= xErrorBarYProps;
+    xPropSet->getPropertyValue(CHART_UNONAME_ERRORBAR_Y) >>= xErrorBarYProps;
     CPPUNIT_ASSERT(xErrorBarYProps.is());
     {
         sal_Int32 nErrorBarStyle;
@@ -121,7 +121,7 @@ void Chart2ImportTest::Fdo60083()
 
     // test that x error bars are not imported
     Reference< beans::XPropertySet > xErrorBarXProps;
-    xPropSet->getPropertyValue("ErrorBarX") >>= xErrorBarXProps;
+    xPropSet->getPropertyValue(CHART_UNONAME_ERRORBAR_X) >>= xErrorBarXProps;
     CPPUNIT_ASSERT(!xErrorBarXProps.is());
 }
 
@@ -139,7 +139,7 @@ void Chart2ImportTest::testErrorBarRange()
 
     // test that y error bars are there
     Reference< beans::XPropertySet > xErrorBarYProps;
-    xPropSet->getPropertyValue("ErrorBarY") >>= xErrorBarYProps;
+    xPropSet->getPropertyValue(CHART_UNONAME_ERRORBAR_Y) >>= xErrorBarYProps;
     CPPUNIT_ASSERT(xErrorBarYProps.is());
 
     sal_Int32 nErrorBarStyle;
@@ -169,7 +169,7 @@ void Chart2ImportTest::testErrorBarFormatting()
 
     // test that y error bars are there
     Reference< beans::XPropertySet > xErrorBarYProps;
-    xPropSet->getPropertyValue("ErrorBarY") >>= xErrorBarYProps;
+    xPropSet->getPropertyValue(CHART_UNONAME_ERRORBAR_Y) >>= xErrorBarYProps;
     CPPUNIT_ASSERT(xErrorBarYProps.is());
 
     util::Color aColor(0);
diff --git a/chart2/qa/extras/charttest.hxx b/chart2/qa/extras/charttest.hxx
index e0969f4..97284542 100644
--- a/chart2/qa/extras/charttest.hxx
+++ b/chart2/qa/extras/charttest.hxx
@@ -49,6 +49,8 @@
 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
 #include <com/sun/star/util/NumberFormat.hpp>
 
+#include <unonames.hxx>
+
 #include <iostream>
 
 #include <libxml/xmlwriter.h>
diff --git a/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
index c7d808c..8dd0f80 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
@@ -25,6 +25,7 @@
 #include "DiagramHelper.hxx"
 #include "ErrorBar.hxx"
 #include "StatisticsHelper.hxx"
+#include <unonames.hxx>
 
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 #include <com/sun/star/chart/ChartErrorCategory.hpp>
@@ -184,7 +185,7 @@ protected:
         if(!xSeriesPropertySet.is())
             return 0;
         uno::Reference< beans::XPropertySet > xErrorBarProperties;
-        xSeriesPropertySet->getPropertyValue( "ErrorBarY" ) >>= xErrorBarProperties;
+        xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarProperties;
         if( !xErrorBarProperties.is() )
         {
             // todo: use a valid context
@@ -193,7 +194,7 @@ protected:
             xErrorBarProperties->setPropertyValue( "ShowPositiveError" , uno::makeAny(false) );
             xErrorBarProperties->setPropertyValue( "ShowNegativeError" , uno::makeAny(false) );
             xErrorBarProperties->setPropertyValue( "ErrorBarStyle" , uno::makeAny(::com::sun::star::chart::ErrorBarStyle::NONE) );
-            xSeriesPropertySet->setPropertyValue( "ErrorBarY" , uno::makeAny( xErrorBarProperties ) );
+            xSeriesPropertySet->setPropertyValue( CHART_UNONAME_ERRORBAR_Y , uno::makeAny( xErrorBarProperties ) );
         }
         return xErrorBarProperties;
     }
@@ -231,7 +232,7 @@ double WrappedConstantErrorLowProperty::getValueFromSeries( const Reference< bea
     double aRet = 0.0;
     m_aDefaultValue >>= aRet;
     uno::Reference< beans::XPropertySet > xErrorBarProperties;
-    if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( "ErrorBarY" ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
+    if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
     {
         if( ::com::sun::star::chart::ErrorBarStyle::ABSOLUTE == lcl_getErrorBarStyle( xErrorBarProperties ) )
             xErrorBarProperties->getPropertyValue( "NegativeError" ) >>= aRet;
@@ -285,7 +286,7 @@ double WrappedConstantErrorHighProperty::getValueFromSeries( const Reference< be
     double aRet = 0.0;
     m_aDefaultValue >>= aRet;
     uno::Reference< beans::XPropertySet > xErrorBarProperties;
-    if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( "ErrorBarY" ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
+    if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
     {
         if( ::com::sun::star::chart::ErrorBarStyle::ABSOLUTE == lcl_getErrorBarStyle( xErrorBarProperties ) )
             xErrorBarProperties->getPropertyValue( "PositiveError" ) >>= aRet;
@@ -380,7 +381,7 @@ WrappedErrorCategoryProperty::~WrappedErrorCategoryProperty()
     ::com::sun::star::chart::ChartErrorCategory aRet = ::com::sun::star::chart::ChartErrorCategory_NONE;
     m_aDefaultValue >>= aRet;
     uno::Reference< beans::XPropertySet > xErrorBarProperties;
-    if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( "ErrorBarY" ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
+    if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
     {
         sal_Int32 nStyle = ::com::sun::star::chart::ErrorBarStyle::NONE;
         xErrorBarProperties->getPropertyValue( "ErrorBarStyle" ) >>= nStyle;
@@ -481,7 +482,7 @@ double WrappedPercentageErrorProperty::getValueFromSeries( const Reference< bean
     double aRet = 0.0;
     m_aDefaultValue >>= aRet;
     uno::Reference< beans::XPropertySet > xErrorBarProperties;
-    if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( "ErrorBarY" ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
+    if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
     {
         if( ::com::sun::star::chart::ErrorBarStyle::RELATIVE == lcl_getErrorBarStyle( xErrorBarProperties ) )
             xErrorBarProperties->getPropertyValue( "PositiveError" ) >>= aRet;
@@ -535,7 +536,7 @@ double WrappedErrorMarginProperty::getValueFromSeries( const Reference< beans::X
     double aRet = 0.0;
     m_aDefaultValue >>= aRet;
     uno::Reference< beans::XPropertySet > xErrorBarProperties;
-    if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( "ErrorBarY" ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
+    if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
     {
         if( ::com::sun::star::chart::ErrorBarStyle::ERROR_MARGIN == lcl_getErrorBarStyle( xErrorBarProperties ) )
             xErrorBarProperties->getPropertyValue( "PositiveError" ) >>= aRet;
@@ -586,7 +587,7 @@ WrappedErrorIndicatorProperty::~WrappedErrorIndicatorProperty()
     ::com::sun::star::chart::ChartErrorIndicatorType aRet = ::com::sun::star::chart::ChartErrorIndicatorType_NONE;
     m_aDefaultValue >>= aRet;
     uno::Reference< beans::XPropertySet > xErrorBarProperties;
-    if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( "ErrorBarY" ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
+    if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
     {
         bool bPositive = false;
         bool bNegative = false;
@@ -659,7 +660,7 @@ sal_Int32 WrappedErrorBarStyleProperty::getValueFromSeries( const Reference< bea
     sal_Int32 nRet = ::com::sun::star::chart::ErrorBarStyle::NONE;
     m_aDefaultValue >>= nRet;
     uno::Reference< beans::XPropertySet > xErrorBarProperties;
-    if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( "ErrorBarY" ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
+    if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
     {
         xErrorBarProperties->getPropertyValue( "ErrorBarStyle" ) >>= nRet;
     }
@@ -709,7 +710,7 @@ OUString WrappedErrorBarRangePositiveProperty::getValueFromSeries( const Referen
     m_aDefaultValue >>= aRet;
     uno::Reference< chart2::data::XDataSource > xErrorBarDataSource;
     if( xSeriesPropertySet.is() &&
-        ( xSeriesPropertySet->getPropertyValue( "ErrorBarY" ) >>= xErrorBarDataSource ) &&
+        ( xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarDataSource ) &&
         xErrorBarDataSource.is())
     {
         uno::Reference< chart2::data::XDataSequence > xSeq(
@@ -776,7 +777,7 @@ OUString WrappedErrorBarRangeNegativeProperty::getValueFromSeries( const Referen
     m_aDefaultValue >>= aRet;
     uno::Reference< chart2::data::XDataSource > xErrorBarDataSource;
     if( xSeriesPropertySet.is() &&
-        ( xSeriesPropertySet->getPropertyValue( "ErrorBarY" ) >>= xErrorBarDataSource ) &&
+        ( xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarDataSource ) &&
         xErrorBarDataSource.is())
     {
         uno::Reference< chart2::data::XDataSequence > xSeq(
@@ -920,7 +921,7 @@ Reference< beans::XPropertySet > WrappedStatisticPropertySetProperty::getValueFr
             break;
         case PROPERTY_SET_TYPE_ERROR_BAR:
             if( xSeriesPropertySet.is())
-                xSeriesPropertySet->getPropertyValue( "ErrorBarY" ) >>= xResult;
+                xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xResult;
             break;
         case PROPERTY_SET_TYPE_MEAN_VALUE:
             if( xRegCnt.is() )
diff --git a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
index e5a9f35..1f24e8b 100644
--- a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
@@ -29,6 +29,7 @@
 #include "StatisticsHelper.hxx"
 
 #include "GraphicPropertyItemConverter.hxx"
+#include <unonames.hxx>
 
 #include <svl/stritem.hxx>
 #include <svx/chrtitem.hxx>
@@ -57,7 +58,7 @@ uno::Reference< beans::XPropertySet > lcl_GetErrorBar(
     if( xProp.is())
         try
         {
-        ( xProp->getPropertyValue( bYError ? OUString( "ErrorBarY" ) : OUString("ErrorBarX") ) >>= xResult );
+        ( xProp->getPropertyValue( bYError ? OUString(CHART_UNONAME_ERRORBAR_Y) : OUString(CHART_UNONAME_ERRORBAR_X) ) >>= xResult );
         }
         catch( const uno::Exception & ex )
         {
@@ -368,7 +369,7 @@ bool StatisticsItemConverter::ApplySpecialItem(
                 if( !xErrorBarProp.is() )
                 {
                     xErrorBarProp = lcl_GetDefaultErrorBar();
-                    GetPropertySet()->setPropertyValue( bYError ? OUString( "ErrorBarY" ) : OUString("ErrorBarX"),
+                    GetPropertySet()->setPropertyValue( bYError ? OUString(CHART_UNONAME_ERRORBAR_Y) : OUString(CHART_UNONAME_ERRORBAR_X),
                                                         uno::makeAny( xErrorBarProp ));
                 }
 
diff --git a/chart2/source/controller/main/ObjectHierarchy.cxx b/chart2/source/controller/main/ObjectHierarchy.cxx
index 26caf6e..9498d37 100644
--- a/chart2/source/controller/main/ObjectHierarchy.cxx
+++ b/chart2/source/controller/main/ObjectHierarchy.cxx
@@ -30,6 +30,7 @@
 #include "DataSeriesHelper.hxx"
 #include "LegendHelper.hxx"
 #include "chartview/DrawModelWrapper.hxx"
+#include <unonames.hxx>
 
 #include <map>
 #include <algorithm>
@@ -468,7 +469,7 @@ void ImplObjectHierarchy::createDataSeriesTree(
                             Reference< beans::XPropertySet > xSeriesProp( xSeries, uno::UNO_QUERY );
                             Reference< beans::XPropertySet > xErrorBarProp;
                             if( xSeriesProp.is() &&
-                                (xSeriesProp->getPropertyValue( "ErrorBarY") >>= xErrorBarProp) &&
+                                (xSeriesProp->getPropertyValue( CHART_UNONAME_ERRORBAR_Y) >>= xErrorBarProp) &&
                                 xErrorBarProp.is())
                             {
                                 sal_Int32 nStyle = ::com::sun::star::chart::ErrorBarStyle::NONE;
@@ -482,7 +483,7 @@ void ImplObjectHierarchy::createDataSeriesTree(
                             }
 
                             if( xSeriesProp.is() &&
-                                (xSeriesProp->getPropertyValue( "ErrorBarX") >>= xErrorBarProp) &&
+                                (xSeriesProp->getPropertyValue(CHART_UNONAME_ERRORBAR_X) >>= xErrorBarProp) &&
                                 xErrorBarProp.is())
                             {
                                 sal_Int32 nStyle = ::com::sun::star::chart::ErrorBarStyle::NONE;
diff --git a/chart2/source/model/main/DataPointProperties.cxx b/chart2/source/model/main/DataPointProperties.cxx
index e145d42..c2cb375 100644
--- a/chart2/source/model/main/DataPointProperties.cxx
+++ b/chart2/source/model/main/DataPointProperties.cxx
@@ -322,14 +322,14 @@ void DataPointProperties::AddPropertiesToVector(
 
     // statistics
     rOutProperties.push_back(
-        Property( "ErrorBarX",
+        Property( CHART_UNONAME_ERRORBAR_X,
                   PROP_DATAPOINT_ERROR_BAR_X,
                   // XPropertySet supporting service ErrorBar
                   cppu::UnoType<beans::XPropertySet>::get(),
                   beans::PropertyAttribute::BOUND
                   | beans::PropertyAttribute::MAYBEVOID ));
     rOutProperties.push_back(
-        Property( "ErrorBarY",
+        Property( CHART_UNONAME_ERRORBAR_Y,
                   PROP_DATAPOINT_ERROR_BAR_Y,
                   // XPropertySet supporting service ErrorBar
                   cppu::UnoType<beans::XPropertySet>::get(),
diff --git a/chart2/source/tools/DataSourceHelper.cxx b/chart2/source/tools/DataSourceHelper.cxx
index aad3aae..bb30a26 100644
--- a/chart2/source/tools/DataSourceHelper.cxx
+++ b/chart2/source/tools/DataSourceHelper.cxx
@@ -28,6 +28,7 @@
 #include "PropertyHelper.hxx"
 #include "CachedDataSequence.hxx"
 #include "LabeledDataSequence.hxx"
+#include <unonames.hxx>
 
 #include <com/sun/star/chart2/XChartDocument.hpp>
 #include <com/sun/star/chart2/data/XDataSource.hpp>
@@ -81,7 +82,7 @@ void lcl_addErrorBarRanges(
     try
     {
         uno::Reference< beans::XPropertySet > xErrorBarProp;
-        if( ( xSeriesProp->getPropertyValue( "ErrorBarY") >>= xErrorBarProp ) &&
+        if( ( xSeriesProp->getPropertyValue( CHART_UNONAME_ERRORBAR_Y) >>= xErrorBarProp ) &&
             xErrorBarProp.is())
         {
             sal_Int32 eStyle = ::com::sun::star::chart::ErrorBarStyle::NONE;
@@ -94,7 +95,7 @@ void lcl_addErrorBarRanges(
             }
         }
 
-        if( ( xSeriesProp->getPropertyValue("ErrorBarX") >>= xErrorBarProp ) && xErrorBarProp.is())
+        if( ( xSeriesProp->getPropertyValue(CHART_UNONAME_ERRORBAR_X) >>= xErrorBarProp ) && xErrorBarProp.is())
         {
             sal_Int32 eStyle = ::com::sun::star::chart::ErrorBarStyle::NONE;
             if( ( xErrorBarProp->getPropertyValue("ErrorBarStyle") >>= eStyle ) &&
diff --git a/chart2/source/tools/ObjectIdentifier.cxx b/chart2/source/tools/ObjectIdentifier.cxx
index 0ab0874..b0aee8b 100644
--- a/chart2/source/tools/ObjectIdentifier.cxx
+++ b/chart2/source/tools/ObjectIdentifier.cxx
@@ -25,6 +25,8 @@
 #include "servicenames_charttypes.hxx"
 #include "DiagramHelper.hxx"
 #include "AxisIndexDefines.hxx"
+#include <unonames.hxx>
+
 #include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
 #include <com/sun/star/chart2/XChartDocument.hpp>
 #include <com/sun/star/chart2/XChartTypeContainer.hpp>
@@ -1363,9 +1365,9 @@ Reference< beans::XPropertySet > ObjectIdentifier::getObjectPropertySet(
                             OUString errorBar;
 
                             if ( eObjectType == OBJECTTYPE_DATA_ERRORS_X)
-                                errorBar = "ErrorBarX";
+                                errorBar = CHART_UNONAME_ERRORBAR_X;
                             else if (eObjectType == OBJECTTYPE_DATA_ERRORS_Y)
-                                errorBar = "ErrorBarY";
+                                errorBar = CHART_UNONAME_ERRORBAR_Y;
                             else
                                 errorBar = "ErrorBarZ";
 
diff --git a/chart2/source/tools/StatisticsHelper.cxx b/chart2/source/tools/StatisticsHelper.cxx
index 724e01c..cbabbf1 100644
--- a/chart2/source/tools/StatisticsHelper.cxx
+++ b/chart2/source/tools/StatisticsHelper.cxx
@@ -21,6 +21,7 @@
 #include "DataSeriesHelper.hxx"
 #include "ErrorBar.hxx"
 #include "macros.hxx"
+#include <unonames.hxx>
 
 #include <rtl/math.hxx>
 #include <rtl/ustrbuf.hxx>
@@ -307,7 +308,7 @@ Reference< beans::XPropertySet > StatisticsHelper::addErrorBars(
         return xErrorBar;
 
     const OUString aPropName(
-            (bYError) ? OUString("ErrorBarY") : OUString("ErrorBarX"));
+            (bYError) ? OUString(CHART_UNONAME_ERRORBAR_Y) : OUString(CHART_UNONAME_ERRORBAR_X));
     if( !( xSeriesProp->getPropertyValue( aPropName ) >>= xErrorBar ) ||
         !xErrorBar.is())
     {
@@ -332,7 +333,7 @@ Reference< beans::XPropertySet > StatisticsHelper::getErrorBars(
     Reference< beans::XPropertySet > xSeriesProp( xDataSeries, uno::UNO_QUERY );
     Reference< beans::XPropertySet > xErrorBar;
     const OUString aPropName(
-            (bYError) ? OUString("ErrorBarY") : OUString("ErrorBarX"));
+            (bYError) ? OUString(CHART_UNONAME_ERRORBAR_Y) : OUString(CHART_UNONAME_ERRORBAR_X));
 
     if ( xSeriesProp.is())
         xSeriesProp->getPropertyValue( aPropName ) >>= xErrorBar;
diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx
index e799f22..73f8956 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -831,7 +831,7 @@ uno::Reference< beans::XPropertySet > VDataSeries::getXErrorBarProperties( sal_I
 
     uno::Reference< beans::XPropertySet > xPointProp( this->getPropertiesOfPoint( index ));
     if( xPointProp.is() )
-        xPointProp->getPropertyValue("ErrorBarX") >>= xErrorBarProp;
+        xPointProp->getPropertyValue(CHART_UNONAME_ERRORBAR_X) >>= xErrorBarProp;
     return xErrorBarProp;
 }
 
@@ -841,7 +841,7 @@ uno::Reference< beans::XPropertySet > VDataSeries::getYErrorBarProperties( sal_I
 
     uno::Reference< beans::XPropertySet > xPointProp( this->getPropertiesOfPoint( index ));
     if( xPointProp.is() )
-        xPointProp->getPropertyValue("ErrorBarY") >>= xErrorBarProp;
+        xPointProp->getPropertyValue(CHART_UNONAME_ERRORBAR_Y) >>= xErrorBarProp;
     return xErrorBarProp;
 }
 
commit 95272e7e5b7e38753ab07dbd6503b7cfa2974842
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Thu Jun 26 18:57:09 2014 -0400

    Prevent a crash while dumping internal data content.
    
    Change-Id: I0938b955b460d8c91607e6df0b9d9e1a4a971013

diff --git a/chart2/source/tools/InternalData.cxx b/chart2/source/tools/InternalData.cxx
index ac796a9..72ce315 100644
--- a/chart2/source/tools/InternalData.cxx
+++ b/chart2/source/tools/InternalData.cxx
@@ -516,6 +516,9 @@ void InternalData::dump() const
     svl::GridPrinter aPrinter(1, m_nColumnCount, true);
     for (sal_Int32 nCol = 0; nCol < m_nColumnCount; ++nCol)
     {
+        if (m_aColumnLabels[nCol].empty())
+            continue;
+
         OUString aStr;
         if (m_aColumnLabels[nCol][0] >>= aStr)
             aPrinter.set(0, nCol, aStr);
commit 4cda79cec3fe54b6859ec8ca550f4453ace7fcb2
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Jun 26 22:57:11 2014 +0200

    loplugin:staticcall
    
    Change-Id: Idea97df52106af64f6c5605460756d48296551e2

diff --git a/sfx2/source/appl/shutdowniconaqua.mm b/sfx2/source/appl/shutdowniconaqua.mm
index 7218061..24458ad 100644
--- a/sfx2/source/appl/shutdowniconaqua.mm
+++ b/sfx2/source/appl/shutdowniconaqua.mm
@@ -399,7 +399,7 @@ void aqua_init_systray()
 
     // disable shutdown
     pShutdownIcon->SetVeto( true );
-    pShutdownIcon->addTerminateListener();
+    ShutdownIcon::addTerminateListener();
     
     if( ! pDefMenu )
     {
commit 977c50178f804dad2817bca98cb9b26affd5bf9a
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Jun 26 22:49:40 2014 +0200

    idl: ignore -isystem args
    
    Change-Id: I0758fd3117795ed68789385576aee5a885639104

diff --git a/idl/source/prj/command.cxx b/idl/source/prj/command.cxx
index 896ed4d6..9eceab1 100644
--- a/idl/source/prj/command.cxx
+++ b/idl/source/prj/command.cxx
@@ -316,6 +316,18 @@ SvCommand::SvCommand( int argc, char ** argv )
                     while(SyntaxStrings[j])
                         printf("%s\n",SyntaxStrings[j++]);
                 }
+                else if (aParam == "isystem")
+                {
+                    // ignore "-isystem" and following arg
+                    if (i < aList.size())
+                    {
+                        ++i;
+                    }
+                }
+                else if (aParam.startsWith("isystem"))
+                {
+                    // ignore args starting with "-isystem"
+                }
                 else if( aParam.startsWithIgnoreAsciiCase( "i" ) )
                 { // define include paths
                     OUString aName( aParam.copy( 1 ) );
commit 7c5a21dd4142c414de4e5925533e8cfbb6f329b0
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Jun 26 22:32:13 2014 +0200

    rsc: ignore -isystem args
    
    Change-Id: Ic46b84d740159826542ead857d15230d54547d88

diff --git a/rsc/source/prj/start.cxx b/rsc/source/prj/start.cxx
index 46c62a7..7c7cc32 100644
--- a/rsc/source/prj/start.cxx
+++ b/rsc/source/prj/start.cxx
@@ -235,7 +235,20 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
     bool bSetSrs = false;
     while( ppStr && i < (aCmdLine.GetCount() -1) )
     {
-        if( '-' == **ppStr )
+        if (strcmp(*ppStr, "-isystem") == 0)
+        {
+            // ignore "-isystem" and following arg
+            if (i < aCmdLine.GetCount() - 1)
+            {
+                ++ppStr;
+                ++i;
+            }
+        }
+        else if (strncmp(*ppStr, "-isystem", strlen("-isystem")) == 0)
+        {
+            // ignore args starting with "-isystem"
+        }
+        else if( '-' == **ppStr )
         {
             if( !rsc_stricmp( (*ppStr) + 1, "p" )
               || !rsc_stricmp( (*ppStr) + 1, "l" ) )
diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx
index 0fac410..e5a7228 100644
--- a/rsc/source/rsc/rsc.cxx
+++ b/rsc/source/rsc/rsc.cxx
@@ -100,7 +100,20 @@ RscCmdLine::RscCmdLine( int argc, char ** argv, RscError * pEH )
 #if OSL_DEBUG_LEVEL > 1
         fprintf( stderr, "CmdLineArg: \"%s\"\n", *ppStr );
 #endif
-        if( '-' == **ppStr )
+        if (strcmp(*ppStr, "-isystem") == 0)
+        {
+            // ignore "-isystem" and following arg
+            if (i < aCmdLine.GetCount() - 1)
+            {
+                ++ppStr;
+                ++i;
+            }
+        }
+        else if (strncmp(*ppStr, "-isystem", strlen("-isystem")) == 0)
+        {
+            // ignore args starting with "-isystem"
+        }
+        else if( '-' == **ppStr )
         {
             if( !rsc_stricmp( (*ppStr) + 1, "h" )
               || !strcmp( (*ppStr) + 1, "?" ) )
diff --git a/rsc/source/rscpp/cpp3.c b/rsc/source/rscpp/cpp3.c
index 287b2a5..02361649 100644
--- a/rsc/source/rscpp/cpp3.c
+++ b/rsc/source/rscpp/cpp3.c
@@ -217,7 +217,19 @@ dooptions(int argc, char** argv)
         for (i = j = 1; i < argc; i++) {
             arg = ap = argv[i];
 
-            if (*ap++ != '-' || *ap == EOS)
+            if (strcmp(arg, "-isystem") == 0)
+            {
+                // ignore "-isystem" and following arg
+                if (i < argc)
+                {
+                    ++i;
+                }
+            }
+            else if (strncmp(arg, "-isystem", strlen("-isystem")) == 0)
+            {
+                // ignore args starting with "-isystem"
+            }
+            else if (*ap++ != '-' || *ap == EOS)
             {
                     argv[j++] = argv[i];
             }
commit aa6495b6fa231abfe8b55a806ff6d5a306843cd3
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Thu Jun 26 14:23:29 2014 -0400

    Better way to dump the content of InternalData.
    
    Row levels are currently not dumped, but that may change later.
    
    Change-Id: I849f8b65d6f419bc4d97e2af2d456e73c7e9a355

diff --git a/chart2/source/inc/InternalData.hxx b/chart2/source/inc/InternalData.hxx
index 082f6ee..94b7eee 100644
--- a/chart2/source/inc/InternalData.hxx
+++ b/chart2/source/inc/InternalData.hxx
@@ -76,9 +76,7 @@ public:
     void setComplexColumnLabels( const tVecVecAny& rNewColumnLabels );
     tVecVecAny getComplexColumnLabels() const { return m_aColumnLabels;}
 
-#if OSL_DEBUG_LEVEL > 1
-    void traceData() const;
-#endif
+    void dump() const;
 
 private: //methods
     /** resizes the data if at least one of the given dimensions is larger than
diff --git a/chart2/source/tools/InternalData.cxx b/chart2/source/tools/InternalData.cxx
index f79bd62..ac796a9 100644
--- a/chart2/source/tools/InternalData.cxx
+++ b/chart2/source/tools/InternalData.cxx
@@ -22,6 +22,14 @@
 #include "Strings.hrc"
 
 #include <rtl/math.hxx>
+#if OSL_DEBUG_LEVEL > 1
+#define DEBUG_INTERNAL_DATA 1
+#endif
+
+#ifdef DEBUG_INTERNAL_DATA
+#include <svl/gridprinter.hxx>
+#endif
+
 #include <algorithm>
 #include <iterator>
 
@@ -223,6 +231,8 @@ void InternalData::setComplexColumnLabel( sal_Int32 nColumnIndex, const vector<
         enlargeData( nColumnIndex+1, 0 );
     }
     m_aColumnLabels[nColumnIndex]=rComplexLabel;
+
+    dump();
 }
 
 void InternalData::setComplexRowLabel( sal_Int32 nRowIndex, const vector< uno::Any >& rComplexLabel )
@@ -351,9 +361,7 @@ void InternalData::insertColumn( sal_Int32 nAfterIndex )
     if( nAfterIndex < static_cast< sal_Int32 >( m_aColumnLabels.size()))
         m_aColumnLabels.insert( m_aColumnLabels.begin() + (nAfterIndex + 1), vector< uno::Any >(1) );
 
-#if OSL_DEBUG_LEVEL > 1
-    traceData();
-#endif
+    dump();
 }
 
 sal_Int32 InternalData::appendColumn()
@@ -403,9 +411,7 @@ void InternalData::insertRow( sal_Int32 nAfterIndex )
     if( nAfterIndex < static_cast< sal_Int32 >( m_aRowLabels.size()))
         m_aRowLabels.insert( m_aRowLabels.begin() + nIndex, vector< uno::Any > (1));
 
-#if OSL_DEBUG_LEVEL > 1
-    traceData();
-#endif
+    dump();
 }
 
 void InternalData::deleteColumn( sal_Int32 nAtIndex )
@@ -439,9 +445,7 @@ void InternalData::deleteColumn( sal_Int32 nAtIndex )
     if( nAtIndex < static_cast< sal_Int32 >( m_aColumnLabels.size()))
         m_aColumnLabels.erase( m_aColumnLabels.begin() + nAtIndex );
 
-#if OSL_DEBUG_LEVEL > 1
-    traceData();
-#endif
+    dump();
 }
 
 void InternalData::deleteRow( sal_Int32 nAtIndex )
@@ -479,9 +483,7 @@ void InternalData::deleteRow( sal_Int32 nAtIndex )
     if( nAtIndex < static_cast< sal_Int32 >( m_aRowLabels.size()))
         m_aRowLabels.erase( m_aRowLabels.begin() + nAtIndex );
 
-#if OSL_DEBUG_LEVEL > 1
-    traceData();
-#endif
+    dump();
 }
 
 
@@ -507,21 +509,32 @@ void InternalData::setComplexColumnLabels( const vector< vector< uno::Any > >& r
         enlargeData( nNewColumnCount, 0 );
 }
 
-
-#if OSL_DEBUG_LEVEL > 1
-void InternalData::traceData() const
+#ifdef DEBUG_INTERNAL_DATA
+void InternalData::dump() const
 {
-    OSL_TRACE( "InternalData: Data in rows" );
+    // Header
+    svl::GridPrinter aPrinter(1, m_nColumnCount, true);
+    for (sal_Int32 nCol = 0; nCol < m_nColumnCount; ++nCol)
+    {
+        OUString aStr;
+        if (m_aColumnLabels[nCol][0] >>= aStr)
+            aPrinter.set(0, nCol, aStr);
+    }
+    aPrinter.print("Header");
 
-    for( sal_Int32 i=0; i<m_nRowCount; ++i )
+    aPrinter.resize(m_nRowCount, m_nColumnCount);
+
+    for (sal_Int32 nRow = 0; nRow < m_nRowCount; ++nRow)
     {
-        tDataType aSlice( m_aData[ ::std::slice( i*m_nColumnCount, m_nColumnCount, 1 ) ] );
-        for( sal_Int32 j=0; j<m_nColumnCount; ++j )
-            OSL_TRACE( "%lf ", aSlice[j] );
-        OSL_TRACE( "\n" );
+        tDataType aSlice( m_aData[ ::std::slice( nRow*m_nColumnCount, m_nColumnCount, 1 ) ] );
+        for (sal_Int32 nCol = 0; nCol < m_nColumnCount; ++nCol)
+            aPrinter.set(nRow, nCol, OUString::number(aSlice[nCol]));
     }
-    OSL_TRACE( "\n" );
+
+    aPrinter.print("Column data");
 }
+#else
+void InternalData::dump() const {}
 #endif
 
 } //  namespace chart
commit 1fabecb123dcc91ebd9d43f3e5c163c7b12b37b0
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Thu Jun 26 13:50:17 2014 -0400

    svl now depends on mdds.
    
    Change-Id: Ifd0bde11ad7e72683e1b95106f487e1eb2a4b487

diff --git a/svl/Library_svl.mk b/svl/Library_svl.mk
index d00505e..f527701 100644
--- a/svl/Library_svl.mk
+++ b/svl/Library_svl.mk
@@ -19,7 +19,10 @@
 
 $(eval $(call gb_Library_Library,svl))
 
-$(eval $(call gb_Library_use_external,svl,boost_headers))
+$(eval $(call gb_Library_use_externals,svl,\
+    boost_headers \
+    mdds_headers \
+))
 
 $(eval $(call gb_Library_set_componentfile,svl,svl/util/svl))
 
commit b2bbd5375ab6ca6ddf4c133d2fdf0b5e38d818b5
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Thu Jun 26 13:36:15 2014 -0400

    Initialize it with empty OUString instances.
    
    Since we only store strings the matrix.
    
    Change-Id: Ie30e9ce0235810b3082ba13ac17c7d1b3c19375a

diff --git a/svl/source/misc/gridprinter.cxx b/svl/source/misc/gridprinter.cxx
index c36de35..a472649 100644
--- a/svl/source/misc/gridprinter.cxx
+++ b/svl/source/misc/gridprinter.cxx
@@ -56,7 +56,7 @@ struct GridPrinter::Impl
     bool mbPrint;
 
     Impl( size_t nRows, size_t nCols, bool bPrint ) :
-        maMatrix(nRows, nCols), mbPrint(bPrint) {}
+        maMatrix(nRows, nCols, OUString()), mbPrint(bPrint) {}
 };
 
 GridPrinter::GridPrinter( size_t nRows, size_t nCols, bool bPrint ) :
commit f15e440d148ed021091ef9b20f3aed2488f0fde3
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Thu Jun 26 13:33:09 2014 -0400

    Move SheetPrinter to svl and rename it to GridPrinter.
    
    I need to use this outside of sc.
    
    Change-Id: I153863d6c5c31e5ab5f25da2dba81bd4d4b6d3fe

diff --git a/include/svl/gridprinter.hxx b/include/svl/gridprinter.hxx
new file mode 100644
index 0000000..d63adfc
--- /dev/null
+++ b/include/svl/gridprinter.hxx
@@ -0,0 +1,44 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_SVL_GRIDPRINTER_HXX
+#define INCLUDED_SVL_GRIDPRINTER_HXX
+
+#include <rtl/ustring.hxx>
+#include <svl/svldllapi.h>
+
+namespace svl {
+
+/**
+ * Print 2-dimensional data in a nice and pleasant fashion.  Useful when
+ * debugging grid layout data.
+ */
+class SVL_DLLPUBLIC GridPrinter
+{
+    struct Impl;
+    Impl* mpImpl;
+
+public:
+    GridPrinter( size_t nRows, size_t nCols, bool bPrint = true );
+    ~GridPrinter();
+
+    void set( size_t nRow, size_t nCol, const OUString& rStr );
+
+    void print( const char* pHeader ) const;
+
+    void clear();
+
+    void resize( size_t nRows, size_t nCols );
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/qa/unit/helper/debughelper.hxx b/sc/qa/unit/helper/debughelper.hxx
index dc6e7bd..509f4af 100644
--- a/sc/qa/unit/helper/debughelper.hxx
+++ b/sc/qa/unit/helper/debughelper.hxx
@@ -23,10 +23,10 @@
 #undef NOMINMAX
 #endif
 
-#define MDDS_HASH_CONTAINER_BOOST 1
-#include <mdds/mixed_type_matrix.hpp>
-
 #include <iostream>
+#include <vector>
+
+#include <svl/gridprinter.hxx>
 
 #define CALC_DEBUG_OUTPUT 0
 #define CALC_TEST_PERF 0
@@ -37,113 +37,6 @@ using ::std::cerr;
 using ::std::endl;
 using ::std::vector;
 
-/**
- * Print nicely formatted sheet content to stdout.  Indispensable when
- * debugging the unit test code involving testing of sheet contents.
- */
-class SheetPrinter
-{
-    typedef ::mdds::mixed_type_matrix<OUString, bool> MatrixType;
-public:
-    SheetPrinter(size_t rows, size_t cols) :
-        maMatrix(rows, cols, ::mdds::matrix_density_sparse_empty) {}
-
-    void set(size_t row, size_t col, const OUString& aStr)
-    {
-        maMatrix.set_string(row, col, new OUString(aStr));
-    }
-
-#if CALC_DEBUG_OUTPUT
-    void print(const char* header) const
-    {
-        if (header)
-            cout << header << endl;
-
-        MatrixType::size_pair_type ns = maMatrix.size();
-        vector<sal_Int32> aColWidths(ns.second, 0);
-
-        // Calculate column widths first.
-        for (size_t row = 0; row < ns.first; ++row)
-        {
-            for (size_t col = 0; col < ns.second; ++col)
-            {
-                const OUString* p = maMatrix.get_string(row, col);
-                if (aColWidths[col] < p->getLength())
-                    aColWidths[col] = p->getLength();
-            }
-        }
-
-        // Make the row separator string.
-        OUStringBuffer aBuf;
-        aBuf.appendAscii("+");
-        for (size_t col = 0; col < ns.second; ++col)
-        {
-            aBuf.appendAscii("-");
-            for (sal_Int32 i = 0; i < aColWidths[col]; ++i)
-                aBuf.append(sal_Unicode('-'));
-            aBuf.appendAscii("-+");
-        }
-
-        OUString aSep = aBuf.makeStringAndClear();
-
-        // Now print to stdout.
-        cout << aSep << endl;
-        for (size_t row = 0; row < ns.first; ++row)
-        {
-            cout << "| ";
-            for (size_t col = 0; col < ns.second; ++col)
-            {
-                const OUString* p = maMatrix.get_string(row, col);
-                size_t nPadding = aColWidths[col] - p->getLength();
-                aBuf.append(*p);
-                for (size_t i = 0; i < nPadding; ++i)
-                    aBuf.append(sal_Unicode(' '));
-                cout << aBuf.makeStringAndClear() << " | ";
-            }
-            cout << endl;
-            cout << aSep << endl;
-        }
-    }
-#else
-    void print(const char*) const {}
-#endif
-
-    /**
-     * Print nested string array which can be copy-n-pasted into the test code
-     * for content verification.
-     */
-    void printArray() const
-    {
-#if CALC_DEBUG_OUTPUT
-        MatrixType::size_pair_type ns = maMatrix.size();
-        for (size_t row = 0; row < ns.first; ++row)
-        {
-            cout << "    { ";
-            for (size_t col = 0; col < ns.second; ++col)
-            {
-                const OUString* p = maMatrix.get_string(row, col);
-                if (p->getLength())
-                    cout << "\"" << *p << "\"";
-                else
-                    cout << "0";
-                if (col < ns.second - 1)
-                    cout << ", ";
-            }
-            cout << " }";
-            if (row < ns.first - 1)
-                cout << ",";
-            cout << endl;
-        }
-#endif
-    }
-
-    void clear() { maMatrix.clear(); }
-    void resize(size_t rows, size_t cols) { maMatrix.resize(rows, cols); }
-
-private:
-    MatrixType maMatrix;
-};
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/qa/unit/helper/qahelper.hxx b/sc/qa/unit/helper/qahelper.hxx
index a4273bc..8c96e36 100644
--- a/sc/qa/unit/helper/qahelper.hxx
+++ b/sc/qa/unit/helper/qahelper.hxx
@@ -136,7 +136,7 @@ bool checkOutput(ScDocument* pDoc, const ScRange& aOutRange, const char* aOutput
     bool bResult = true;
     const ScAddress& s = aOutRange.aStart;
     const ScAddress& e = aOutRange.aEnd;
-    SheetPrinter printer(e.Row() - s.Row() + 1, e.Col() - s.Col() + 1);
+    svl::GridPrinter printer(e.Row() - s.Row() + 1, e.Col() - s.Col() + 1, CALC_DEBUG_OUTPUT != 0);
     SCROW nOutRowSize = e.Row() - s.Row() + 1;
     SCCOL nOutColSize = e.Col() - s.Col() + 1;
     for (SCROW nRow = 0; nRow < nOutRowSize; ++nRow)
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 8d2dd47..d412abd 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -6410,7 +6410,7 @@ void Test::printRange(ScDocument* pDoc, const ScRange& rRange, const char* pCapt
 {
     SCROW nRow1 = rRange.aStart.Row(), nRow2 = rRange.aEnd.Row();
     SCCOL nCol1 = rRange.aStart.Col(), nCol2 = rRange.aEnd.Col();
-    SheetPrinter printer(nRow2 - nRow1 + 1, nCol2 - nCol1 + 1);
+    svl::GridPrinter printer(nRow2 - nRow1 + 1, nCol2 - nCol1 + 1, CALC_DEBUG_OUTPUT != 0);
     for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow)
     {
         for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
diff --git a/svl/Library_svl.mk b/svl/Library_svl.mk
index 2b337ff..d00505e 100644
--- a/svl/Library_svl.mk
+++ b/svl/Library_svl.mk
@@ -107,6 +107,7 @@ $(eval $(call gb_Library_add_exception_objects,svl,\
     svl/source/misc/filenotation \
     svl/source/misc/fstathelper \
     svl/source/misc/getstringresource \
+    svl/source/misc/gridprinter \
     svl/source/misc/inethist \
     svl/source/misc/inettype \
     svl/source/misc/lngmisc \
diff --git a/svl/source/misc/gridprinter.cxx b/svl/source/misc/gridprinter.cxx
new file mode 100644
index 0000000..c36de35
--- /dev/null
+++ b/svl/source/misc/gridprinter.cxx
@@ -0,0 +1,141 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <svl/gridprinter.hxx>
+#include <rtl/ustrbuf.hxx>
+
+#include <mdds/multi_type_vector_types.hpp>
+#include <mdds/multi_type_vector_trait.hpp>
+#include <mdds/multi_type_vector_custom_func1.hpp>
+#include <mdds/multi_type_matrix.hpp>
+
+#include <iostream>
+
+using namespace std;
+
+namespace svl {
+
+// String ID
+const mdds::mtv::element_t element_type_string = mdds::mtv::element_type_user_start;
+// String block
+typedef mdds::mtv::default_element_block<element_type_string, OUString> string_block;
+
+struct custom_string_trait
+{
+    typedef OUString string_type;
+    typedef string_block string_element_block;
+
+    static const mdds::mtv::element_t string_type_identifier = element_type_string;
+
+    typedef mdds::mtv::custom_block_func1<string_block> element_block_func;
+};
+
+}
+
+namespace rtl {
+
+// Callbacks for the string block. This needs to be in the same namespace as
+// OUString for argument dependent lookup.
+MDDS_MTV_DEFINE_ELEMENT_CALLBACKS(OUString, svl::element_type_string, OUString(), svl::string_block)
+
+}
+
+namespace svl {
+
+typedef mdds::multi_type_matrix<custom_string_trait> MatrixImplType;
+
+struct GridPrinter::Impl
+{
+    MatrixImplType maMatrix;
+    bool mbPrint;
+
+    Impl( size_t nRows, size_t nCols, bool bPrint ) :
+        maMatrix(nRows, nCols), mbPrint(bPrint) {}
+};
+
+GridPrinter::GridPrinter( size_t nRows, size_t nCols, bool bPrint ) :
+    mpImpl(new Impl(nRows, nCols, bPrint)) {}
+
+GridPrinter::~GridPrinter()
+{
+    delete mpImpl;
+}
+
+void GridPrinter::set( size_t nRow, size_t nCol, const OUString& rStr )
+{
+    mpImpl->maMatrix.set(nRow, nCol, rStr);
+}
+
+void GridPrinter::print( const char* pHeader ) const
+{
+    if (!mpImpl->mbPrint)
+        return;
+
+    if (pHeader)
+        cout << pHeader << endl;
+
+    MatrixImplType::size_pair_type ns = mpImpl->maMatrix.size();
+    vector<sal_Int32> aColWidths(ns.column, 0);
+
+    // Calculate column widths first.
+    for (size_t row = 0; row < ns.row; ++row)
+    {
+        for (size_t col = 0; col < ns.column; ++col)
+        {
+            OUString aStr = mpImpl->maMatrix.get_string(row, col);
+            if (aColWidths[col] < aStr.getLength())
+                aColWidths[col] = aStr.getLength();
+        }
+    }
+
+    // Make the row separator string.
+    OUStringBuffer aBuf;
+    aBuf.appendAscii("+");
+    for (size_t col = 0; col < ns.column; ++col)
+    {
+        aBuf.appendAscii("-");
+        for (sal_Int32 i = 0; i < aColWidths[col]; ++i)
+            aBuf.append(sal_Unicode('-'));
+        aBuf.appendAscii("-+");
+    }
+
+    OUString aSep = aBuf.makeStringAndClear();
+
+    // Now print to stdout.
+    cout << aSep << endl;
+    for (size_t row = 0; row < ns.row; ++row)
+    {
+        cout << "| ";
+        for (size_t col = 0; col < ns.column; ++col)
+        {
+            OUString aStr = mpImpl->maMatrix.get_string(row, col);
+            size_t nPadding = aColWidths[col] - aStr.getLength();
+            aBuf.append(aStr);
+            for (size_t i = 0; i < nPadding; ++i)
+                aBuf.append(sal_Unicode(' '));
+            cout << aBuf.makeStringAndClear() << " | ";
+        }
+        cout << endl;
+        cout << aSep << endl;
+    }
+}
+
+void GridPrinter::clear()
+{
+    mpImpl->maMatrix.clear();
+}
+
+void GridPrinter::resize( size_t nRows, size_t nCols )
+{
+    mpImpl->maMatrix.resize(nRows, nCols);
+}
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit b7de76d825b02005ab8cf02b3977e4be441200c5
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Jun 26 17:55:05 2014 +0200

    Mac OS X does provide localtime_r and gmtime_r
    
    Change-Id: I1142463972df76aac9e491abbfd08a67cf4db1f1

diff --git a/sal/osl/unx/system.h b/sal/osl/unx/system.h
index 3a0babd..33aef24 100644
--- a/sal/osl/unx/system.h
+++ b/sal/osl/unx/system.h
@@ -402,8 +402,10 @@ struct passwd *getpwent_r(struct passwd *pwd, char *buffer,  int buflen);
 extern struct spwd *getspnam_r(const char *name, struct spwd *result,
                                char *buffer, int buflen);
 
+#if !defined MACOSX
 struct tm *localtime_r(const time_t *timep, struct tm *buffer);
 struct tm *gmtime_r(const time_t *timep, struct tm *buffer);
+#endif
 #endif /* !defined FREEBSD || (__FreeBSD_version < 500112) */
 #if !defined(FREEBSD) || (__FreeBSD_version < 601103)
 struct hostent *gethostbyname_r(const char *name, struct hostent *result,
commit f899ce3db7d5b9127ca95ad0675d1e5b6147e70b
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Jun 26 17:54:05 2014 +0200

    ICU's RuleBasedCollator::cloneRuleData is deprecated
    
    Change-Id: Ifc4a74bca5cfe58e420824a8dd85e8c246bbfac3

diff --git a/i18npool/source/collator/gencoll_rule.cxx b/i18npool/source/collator/gencoll_rule.cxx
index 5ba9f5d..8c4abb3 100644
--- a/i18npool/source/collator/gencoll_rule.cxx
+++ b/i18npool/source/collator/gencoll_rule.cxx
@@ -17,7 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
 
+#include <vector>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -28,8 +30,6 @@
 
 #include <unicode/tblcoll.h>
 
-U_CAPI void U_EXPORT2 uprv_free(void *mem);
-
 using namespace ::rtl;
 
 /* Main Procedure */
@@ -117,17 +117,18 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
     RuleBasedCollator *coll = new RuleBasedCollator(reinterpret_cast<const UChar *>(Obuf.getStr()), status);    // UChar != sal_Unicode in MinGW
 
     if (U_SUCCESS(status)) {
-
-        int32_t len = 0;
-        uint8_t *data = coll->cloneRuleData(len, status);
-
-        if (U_SUCCESS(status) && data != NULL)
-            data_write(argv[2], argv[3], data, len);
+        std::vector<uint8_t> data;
+        int32_t len = coll->cloneBinary(0, 0, status);
+        if (status == U_BUFFER_OVERFLOW_ERROR) {
+            data.resize(len);
+            status = U_ZERO_ERROR;
+            len = coll->cloneBinary(data.empty() ? 0 : &data[0], len, status);
+        }
+        if (U_SUCCESS(status))
+            data_write(argv[2], argv[3], data.empty() ? 0 : &data[0], len);
         else {
             printf("Could not get rule data from collator\n");
         }
-
-    if (data) uprv_free(data);
     } else {
         printf("\nRule parsering error\n");
     }
commit 0ac652bbc01ab7c9304b5e230695f4193dfadd09
Author: Joren De Cuyper <jorendc at libreoffice.org>
Date:   Wed Jun 25 21:26:00 2014 +0200

    fdo#39111 - UI inconsistent concerning suppression of output for empty pages
    
    Change-Id: I6017e77e46298b45c7584830178455fe29016209
    Reviewed-on: https://gerrit.libreoffice.org/9907
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/ui/src/scstring.src b/sc/source/ui/src/scstring.src
index b083fff..cc07d2c 100644
--- a/sc/source/ui/src/scstring.src
+++ b/sc/source/ui/src/scstring.src
@@ -784,7 +784,7 @@ StringArray SCSTR_PRINT_OPTIONS
     ItemList [en-US] =
     {
         < "Pages"; >;
-        < "~Include output of empty pages"; >;
+        < "~Suppress output of empty pages"; >;
         < "Print content"; >;
         < "~All sheets"; >;
         < "~Selected sheets"; >;
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 57a80b5..2662e4c 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -242,10 +242,10 @@ ScPrintUIOptions::ScPrintUIOptions()
     m_aUIProperties[nIdx++].Value = setSubgroupControlOpt("pages", OUString(aStrings.GetString(0)), OUString());
 
     // create a bool option for empty pages
-    m_aUIProperties[nIdx++].Value = setBoolControlOpt("includeemptypages", OUString( aStrings.GetString( 1 ) ),
-                                                  ".HelpID:vcl:PrintDialog:IsIncludeEmptyPages:CheckBox",
-                                                  "IsIncludeEmptyPages",
-                                                  ! bSuppress);
+    m_aUIProperties[nIdx++].Value = setBoolControlOpt("suppressemptypages", OUString( aStrings.GetString( 1 ) ),
+                                                  ".HelpID:vcl:PrintDialog:IsSuppressEmptyPages:CheckBox",
+                                                  "IsSuppressEmptyPages",
+                                                  bSuppress);
     // show Subgroup for print content

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list