[Libreoffice-commits] core.git: Branch 'private/kohei/xlsx-import-speedup' - 287 commits - android/Bootstrap android/experimental avmedia/source basctl/source basebmp/CppunitTest_basebmp.mk basebmp/test basegfx/Library_basegfx.mk basegfx/source basegfx/test basic/source bin/fake_pom.xml bin/mvn.py bin/verify-custom-widgets-libs bridges/test canvas/source chart2/CppunitTest_chart2_import.mk chart2/qa codemaker/source comphelper/source compilerplugins/clang compilerplugins/Makefile config_host/config_clang.h.in config_host.mk.in configure.ac connectivity/Library_mozabdrv.mk connectivity/source cppcanvas/source cppuhelper/source cppuhelper/test cpputools/source crashrep/source cui/source cui/uiconfig cui/UIConfig_cui.mk cui/util dbaccess/source desktop/Executable_soffice.bin.mk desktop/Module_desktop.mk desktop/source distro-configs/OxygenOfficeLinux.conf download.lst dtrans/source editeng/source extensions/qa extensions/source external/apache-commons external/curl external/firebird external /icu external/jpeg external/languagetool external/libetonyek external/libfreehand external/libmwaw external/libodfgen external/Mesa external/misc_extensions external/Module_external.mk external/np_sdk external/nss external/openldap external/openssl external/poppler external/postgresql external/python3 external/redland external/rhino external/ucpp external/vigra external/xsltml external/zlib extras/Module_extras.mk extras/Package_extensions.mk extras/source filter/Configuration_filter.mk filter/source forms/source formula/source fpicker/Library_fpicker.mk fpicker/Module_fpicker.mk fpicker/source framework/source .gitignore helpcompiler/source helpcontent2 i18npool/qa i18npool/source idlc/source include/basegfx include/formula include/rtl include/sal include/svx include/touch include/vcl include/xmloff instsetoo_native/CustomTarget_install.mk instsetoo_native/util ios/CustomTarget_LibreOffice_app.mk ios/CustomTarget_MobileLibreOffice_app.mk ios/Executable_LibreOffice.mk ios/ex perimental ios/lo.xcconfig.in ios/MobileLibreOffice ios/qa ios/shared io/test jpeg/configs jpeg/Makefile jpeg/Module_jpeg.mk jpeg/patches jpeg/README jpeg/StaticLibrary_jpeg.mk jpeg/UnpackedTarball_jpeg.mk jvmfwk/plugins l10ntools/source languagetool/ExternalProject_languagetool.mk languagetool/JLanguageTool-1.4.0-no-hc.patch languagetool/JLanguageTool-1.7.0.patch languagetool/Makefile languagetool/MessageBox-apichange.patch languagetool/Module_languagetool.mk languagetool/Package_languagetool.mk languagetool/README languagetool/UnpackedTarball_languagetool.mk libxmlsec/ExternalProject_xmlsec.mk lingucomponent/source linguistic/source lotuswordpro/source Makefile.fetch Makefile.gbuild Makefile.in Mesa/inc Mesa/README mysqlc/Extension_mysql-connector-ooo.mk nlpsolver/Extension_nlpsolver.mk np_sdk/inc np_sdk/Makefile np_sdk/Module_np_sdk.mk np_sdk/npsdk np_sdk/README np_sdk/StaticLibrary_nputils.mk nss/ExternalPackage_nss.mk nss/ExternalProject_nss.mk nss/Makefile nss/Module_n ss.mk nss/nsinstall.py nss/nspr-4.9-build.patch.3 nss/nss-3.13.3-build.patch.3 nss/nss-3.13.5-zlib-werror.patch nss/nss.aix.patch nss/nss_macosx.patch nss/nss.mingw.patch.3 nss/nss.patch nss/nss.wheader-guard.patch.0 nss/nss.windows.patch nss/README nss/UnpackedTarball_nss.mk odk/Module_odk.mk odk/Package_config.mk odk/Package_config_notwin.mk odk/Package_share_readme_generated.mk odk/Package_share_readme.mk officecfg/registry oox/source openldap/ExternalProject_openldap.mk openldap/Makefile openldap/Module_openldap.mk openldap/openldap-2.4.31.patch openldap/UnpackedTarball_openldap.mk openssl/ExternalPackage_openssl.mk openssl/ExternalProject_openssl.mk openssl/Makefile openssl/Module_openssl.mk openssl/opensslios.patch openssl/openssllnx.patch openssl/opensslmingw.patch openssl/opensslsol.patch openssl/opensslwnt.patch openssl/README openssl/UnpackedTarball_openssl.mk package/source poppler/ExternalProject_poppler.mk poppler/Makefile poppler/Module_poppler.mk poppler/poppl er-mac-fake.patch.1 poppler/poppler-nochecknew.patch.1 poppler/poppler-notests.patch.1 poppler/poppler-snprintf.patch.1 poppler/README poppler/UnpackedTarball_poppler.mk postgresql/ExternalProject_postgresql.mk postgresql/Makefile postgresql/Module_postgresql.mk postgresql/postgresql-9.2.1-autoreconf.patch postgresql/postgresql-9.2.1-libreoffice.patch postgresql/postgresql-libs-leak.patch postgresql/README postgresql/UnpackedTarball_postgresql.mk postprocess/CustomTarget_images.mk postprocess/CustomTarget_registry.mk postprocess/CustomTarget_signing.mk postprocess/Rdb_services.mk python3/ExternalPackage_python3.mk python3/ExternalProject_python3.mk python3/GeneratedPackage_python3.mk python3/i100492-freebsd.patch.1 python3/Makefile python3/Module_python3.mk python3/python-3.3.0-15833.patch.1 python3/python-3.3.0-aix.patch.1 python3/python-3.3.0-clang.patch.1 python3/python-3.3.0-darwin.patch.1 python3/python-3.3.0-elf-rpath.patch.1 python3/python-3.3.0-ffi-clang.patch.1 pyth on3/python-3.3.0-gcc-4.8.patch.1 python3/python-3.3.0-i42553.patch.2 python3/python-3.3.0-implicit-int.patch.1 python3/python-3.3.0-msvc2012.patch.1 python3/python-3.3.0-msvc-disable.patch.1 python3/python-3.3.0-msvc-x64.patch.1 python3/python-3.3.0-pythreadstate.patch.1 python3/python-3.3.0-ssl.patch.1 python3/README python3/UnpackedTarball_python3.mk qadevOOo/tests readlicense_oo/Module_readlicense_oo.mk readlicense_oo/Package_files.mk readlicense_oo/Package_license.mk readlicense_oo/Package_readme.mk redland/ExternalPackage_raptor.mk redland/ExternalPackage_rasqal.mk redland/ExternalPackage_redland.mk redland/ExternalProject_raptor.mk redland/ExternalProject_rasqal.mk redland/ExternalProject_redland.mk redland/Library_raptor.mk redland/Library_rasqal.mk redland/Library_rdf.mk redland/Makefile redland/Module_redland.mk redland/raptor redland/rasqal redland/README redland/redland redland/UnpackedTarball_raptor.mk redland/UnpackedTarball_rasqal.mk redland/UnpackedTarball_red land.mk registry/tools reportdesign/source RepositoryExternal.mk RepositoryFixes.mk Repository.mk RepositoryModule_build.mk RepositoryModule_host.mk rhino/ExternalPackage_rhino.mk rhino/ExternalProject_rhino.mk rhino/Makefile rhino/Module_rhino.mk rhino/OfficeScriptInfo.java rhino/README rhino/rhino1_5R5-find_swing.patch rhino/rhino1_5R5.patch rhino/rhino1_5R5-updateToolTip.patch rhino/UnpackedTarball_rhino.mk rsc/source sal/osl sal/qa sc/inc scp2/InstallModule_extensions.mk scp2/source sc/qa scripting/source sc/source sc/uiconfig sdext/source sd/source sd/uiconfig setup_native/Module_setup_native.mk setup_native/Package_misc.mk setup_native/Package_packinfo.mk setup_native/Package_scripts_generated.mk setup_native/Package_scripts.mk setup_native/Package_ulf.mk setup_native/scripts setup_native/source sfx2/source shell/source slideshow/source smoketest/Executable_libtest.mk solenv/bin solenv/doc solenv/gbuild sot/source starmath/inc starmath/qa starmath/source starmath/uicon fig starmath/UIConfig_smath.mk stoc/test svgio/inc svgio/source svl/source svtools/Library_svt.mk svtools/source svtools/util svx/source swext/Extension_wiki-publisher.mk sw/inc sw/qa sw/source sw/uiconfig sysui/CustomTarget_share.mk sysui/desktop sysui/Module_sysui.mk sysui/Package_desktop.mk test/source testtools/CustomTarget_bridgetest.mk testtools/source tomcat/build.xml tomcat/ExternalProject_tomcat.mk tomcat/Makefile tomcat/Module_tomcat.mk tomcat/README tomcat/UnpackedTarball_tomcat.mk toolkit/source tools/source twain/inc ucbhelper/source ucb/source ucb/workben ucpp/Executable_ucpp.mk ucpp/Makefile ucpp/Module_ucpp.mk ucpp/ucpp.patch ucpp/UnpackedTarball_ucpp.mk unodevtools/source unotest/source unotools/source unoxml/source uui/source vbahelper/source vcl/aqua vcl/coretext vcl/generic vcl/inc vcl/source vcl/unx vcl/win vcl/WinResTarget_vcl.mk vigra/Makefile vigra/Module_vigra.mk vigra/README vigra/UnpackedTarball_vigra.mk vigra/vigra1.6.0.patch vigra/vigra1.6.0-unus ed-parameters.patch writerfilter/Library_writerfilter.mk writerfilter/qa writerfilter/source writerperfect/Library_wpftdraw.mk writerperfect/Library_wpftimpress.mk writerperfect/Library_wpftwriter.mk writerperfect/Module_writerperfect.mk writerperfect/source writerperfect/StaticLibrary_writerperfect.mk writerperfect/util xmlhelp/source xmloff/inc xmloff/source xmlsecurity/source xsltml/Makefile xsltml/Module_xsltml.mk xsltml/README xsltml/UnpackedTarball_xsltml.mk xsltml/xsltml_2.1.2.patch zlib/Makefile zlib/Module_zlib.mk zlib/README zlib/StaticLibrary_zlib.mk zlib/StaticLibrary_zlib_x64.mk zlib/UnpackedTarball_zlib.mk

Kohei Yoshida kohei.yoshida at collabora.com
Tue Nov 5 01:03:40 CET 2013


Rebased ref, commits from common ancestor:
commit 56e1690181636092dd3498c2238f0eb3346fe9df
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Mon Nov 4 19:03:43 2013 -0500

    Compile formulas using internal API directly...
    
    rather than via UNO API which does triple conversion per formula expression.
    
    Change-Id: Ib397c7976c06b98ce036caa7bfe2748e868299d9

diff --git a/sc/source/filter/oox/formulabuffer.cxx b/sc/source/filter/oox/formulabuffer.cxx
index ade158f..3256e0c 100644
--- a/sc/source/filter/oox/formulabuffer.cxx
+++ b/sc/source/filter/oox/formulabuffer.cxx
@@ -24,8 +24,11 @@
 #include "tokenuno.hxx"
 #include "tokenarray.hxx"
 #include "sharedformulagroups.hxx"
+#include "externalrefmgr.hxx"
 #include "oox/token/tokens.hxx"
 
+#include <boost/scoped_ptr.hpp>
+
 using namespace com::sun::star;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::table;
@@ -98,12 +101,19 @@ void FormulaBuffer::applyCellFormula( ScDocument& rDoc, const ApiTokenSequence&
 
 void FormulaBuffer::applyCellFormulas( const std::vector< TokenAddressItem >& rVector )
 {
-    ScDocument& rDoc = getScDocument();
+    ScDocumentImport& rDoc = getDocImport();
     for ( std::vector< TokenAddressItem >::const_iterator it = rVector.begin(), it_end = rVector.end(); it != it_end; ++it )
     {
-        const ::com::sun::star::table::CellAddress& rAddress = it->maCellAddress;
-        ApiTokenSequence aTokens = getFormulaParser().importFormula( rAddress, it->maTokenStr );
-        applyCellFormula( rDoc, aTokens, rAddress );
+        ScAddress aPos;
+        ScUnoConversion::FillScAddress(aPos, it->maCellAddress);
+        ScExternalRefManager::ApiGuard aExtRefGuard(&rDoc.getDoc());
+        ScCompiler aCompiler(&rDoc.getDoc(), aPos);
+        aCompiler.SetGrammar(formula::FormulaGrammar::GRAM_ENGLISH_XL_OOX);
+        boost::scoped_ptr<ScTokenArray> pCode(aCompiler.CompileString(it->maTokenStr));
+        if (!pCode)
+            continue;
+
+        rDoc.setFormulaCell(aPos, *pCode);
     }
 }
 
commit 2f75a279ccff70aa276e16e8c709c8b4b2924103
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Mon Nov 4 13:57:34 2013 -0500

    Two new test cases for importing data tables from XLSX.
    
    Change-Id: I87da806612ae50fe1d64b851c5180ff1792752cb

diff --git a/sc/qa/unit/data/xlsx/data-table/multi-table.xlsx b/sc/qa/unit/data/xlsx/data-table/multi-table.xlsx
new file mode 100644
index 0000000..c2bf488
Binary files /dev/null and b/sc/qa/unit/data/xlsx/data-table/multi-table.xlsx differ
diff --git a/sc/qa/unit/data/xlsx/data-table/one-variable.xlsx b/sc/qa/unit/data/xlsx/data-table/one-variable.xlsx
new file mode 100644
index 0000000..7ff098b2
Binary files /dev/null and b/sc/qa/unit/data/xlsx/data-table/one-variable.xlsx differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 3eae17d..4f7d702 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -109,6 +109,8 @@ public:
     void testRepeatedColumnsODS();
     void testDataValidityODS();
     void testDataTableMortgageXLS();
+    void testDataTableOneVarXLSX();
+    void testDataTableMultiTableXLSX();
 
     void testDataBarODS();
     void testDataBarXLSX();
@@ -174,6 +176,8 @@ public:
     CPPUNIT_TEST(testRepeatedColumnsODS);
     CPPUNIT_TEST(testDataValidityODS);
     CPPUNIT_TEST(testDataTableMortgageXLS);
+    CPPUNIT_TEST(testDataTableOneVarXLSX);
+    CPPUNIT_TEST(testDataTableMultiTableXLSX);
     CPPUNIT_TEST(testBrokenQuotesCSV);
     CPPUNIT_TEST(testCellValueXLSX);
     CPPUNIT_TEST(testControlImport);
@@ -1077,6 +1081,8 @@ void ScFiltersTest::testDataValidityODS()
 void ScFiltersTest::testDataTableMortgageXLS()
 {
     ScDocShellRef xDocSh = loadDoc("data-table/mortgage.", XLS);
+    CPPUNIT_ASSERT_MESSAGE("Failed to load the document.", xDocSh.Is());
+
     ScFormulaOptions aOptions;
     aOptions.SetFormulaSepArg(",");
     aOptions.SetFormulaSepArrayCol(",");
@@ -1125,6 +1131,87 @@ void ScFiltersTest::testDataTableMortgageXLS()
     xDocSh->DoClose();
 }
 
+void ScFiltersTest::testDataTableOneVarXLSX()
+{
+    ScDocShellRef xDocSh = loadDoc("data-table/one-variable.", XLSX);
+    CPPUNIT_ASSERT_MESSAGE("Failed to load the document.", xDocSh.Is());
+
+    ScFormulaOptions aOptions;
+    aOptions.SetFormulaSepArg(",");
+    aOptions.SetFormulaSepArrayCol(",");
+    aOptions.SetFormulaSepArrayRow(";");
+    xDocSh->SetFormulaOptions(aOptions);
+
+    ScDocument* pDoc = xDocSh->GetDocument();
+
+    // Right now, we have a bug that prevents Calc from re-calculating these
+    // cells automatically upon file load. We can remove this call if/when we
+    // fix the aforementioned bug.
+    pDoc->CalcAll();
+
+    // B5:B11 should have multiple operations formula cells.  Just check the
+    // top and bottom cells.
+
+    if (!checkFormula(*pDoc, ScAddress(1,4,0), "MULTIPLE.OPERATIONS(B$4,$A$2,$A5)"))
+        CPPUNIT_FAIL("Wrong formula!");
+
+    CPPUNIT_ASSERT_EQUAL(2.0, pDoc->GetValue(ScAddress(1,4,0)));
+
+    if (!checkFormula(*pDoc, ScAddress(1,10,0), "MULTIPLE.OPERATIONS(B$4,$A$2,$A11)"))
+        CPPUNIT_FAIL("Wrong formula!");
+
+    CPPUNIT_ASSERT_EQUAL(14.0, pDoc->GetValue(ScAddress(1,10,0)));
+
+    // Likewise, E5:I5 should have multiple operations formula cells.  Just
+    // check the left- and right-most cells.
+
+    if (!checkFormula(*pDoc, ScAddress(4,4,0), "MULTIPLE.OPERATIONS($D5,$B$2,E$4)"))
+        CPPUNIT_FAIL("Wrong formula!");
+
+    CPPUNIT_ASSERT_EQUAL(10.0, pDoc->GetValue(ScAddress(4,4,0)));
+
+    if (!checkFormula(*pDoc, ScAddress(8,4,0), "MULTIPLE.OPERATIONS($D5,$B$2,I$4)"))
+        CPPUNIT_FAIL("Wrong formula!");
+
+    CPPUNIT_ASSERT_EQUAL(50.0, pDoc->GetValue(ScAddress(8,4,0)));
+
+    xDocSh->DoClose();
+}
+
+void ScFiltersTest::testDataTableMultiTableXLSX()
+{
+    ScDocShellRef xDocSh = loadDoc("data-table/multi-table.", XLSX);
+    CPPUNIT_ASSERT_MESSAGE("Failed to load the document.", xDocSh.Is());
+
+    ScFormulaOptions aOptions;
+    aOptions.SetFormulaSepArg(",");
+    aOptions.SetFormulaSepArrayCol(",");
+    aOptions.SetFormulaSepArrayRow(";");
+    xDocSh->SetFormulaOptions(aOptions);
+
+    ScDocument* pDoc = xDocSh->GetDocument();
+
+    // Right now, we have a bug that prevents Calc from re-calculating these
+    // cells automatically upon file load. We can remove this call if/when we
+    // fix the aforementioned bug.
+    pDoc->CalcAll();
+
+    // B4:M15 should have multiple operations formula cells.  We'll just check
+    // the top-left and bottom-right ones.
+
+    if (!checkFormula(*pDoc, ScAddress(1,3,0), "MULTIPLE.OPERATIONS($A$3,$E$1,$A4,$D$1,B$3)"))
+        CPPUNIT_FAIL("Wrong formula!");
+
+    CPPUNIT_ASSERT_EQUAL(1.0, pDoc->GetValue(ScAddress(1,3,0)));
+
+    if (!checkFormula(*pDoc, ScAddress(12,14,0), "MULTIPLE.OPERATIONS($A$3,$E$1,$A15,$D$1,M$3)"))
+        CPPUNIT_FAIL("Wrong formula!");
+
+    CPPUNIT_ASSERT_EQUAL(144.0, pDoc->GetValue(ScAddress(12,14,0)));
+
+    xDocSh->DoClose();
+}
+
 void ScFiltersTest::testBrokenQuotesCSV()
 {
     const OUString aFileNameBase("fdo48621_broken_quotes.");
commit e77379bb2c0a6b3869b544b30d8f42137f82cf8b
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Mon Nov 4 13:27:44 2013 -0500

    Create data-table directory and move the test file into it.
    
    Change-Id: I1007525a7d2e1135f0388975f9cb7b0cef9b3142

diff --git a/sc/qa/unit/data/xls/data-table-mortgage.xls b/sc/qa/unit/data/xls/data-table/mortgage.xls
similarity index 100%
rename from sc/qa/unit/data/xls/data-table-mortgage.xls
rename to sc/qa/unit/data/xls/data-table/mortgage.xls
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index a9956e1..3eae17d 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -108,7 +108,7 @@ public:
     void testMergedCellsODS();
     void testRepeatedColumnsODS();
     void testDataValidityODS();
-    void testDataTableXLS();
+    void testDataTableMortgageXLS();
 
     void testDataBarODS();
     void testDataBarXLSX();
@@ -173,7 +173,7 @@ public:
     CPPUNIT_TEST(testMergedCellsODS);
     CPPUNIT_TEST(testRepeatedColumnsODS);
     CPPUNIT_TEST(testDataValidityODS);
-    CPPUNIT_TEST(testDataTableXLS);
+    CPPUNIT_TEST(testDataTableMortgageXLS);
     CPPUNIT_TEST(testBrokenQuotesCSV);
     CPPUNIT_TEST(testCellValueXLSX);
     CPPUNIT_TEST(testControlImport);
@@ -1074,9 +1074,9 @@ void ScFiltersTest::testDataValidityODS()
     xDocSh->DoClose();
 }
 
-void ScFiltersTest::testDataTableXLS()
+void ScFiltersTest::testDataTableMortgageXLS()
 {
-    ScDocShellRef xDocSh = loadDoc("data-table-mortgage.", XLS);
+    ScDocShellRef xDocSh = loadDoc("data-table/mortgage.", XLS);
     ScFormulaOptions aOptions;
     aOptions.SetFormulaSepArg(",");
     aOptions.SetFormulaSepArrayCol(",");
commit 370399c8304eb30254f1fa3b5fa773ddefd9b0c0
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Mon Nov 4 11:50:18 2013 -0500

    Import data tables from xlsx via ScDocumentImport.
    
    Change-Id: Id3d526720f99b7557476915beab35b429ec97c1d

diff --git a/sc/source/filter/inc/sheetdatabuffer.hxx b/sc/source/filter/inc/sheetdatabuffer.hxx
index 192f359..ceb3a80 100644
--- a/sc/source/filter/inc/sheetdatabuffer.hxx
+++ b/sc/source/filter/inc/sheetdatabuffer.hxx
@@ -176,9 +176,8 @@ private:
                             const ::com::sun::star::table::CellRangeAddress& rRange,
                             const ApiTokenSequence& rTokens ) const;
     /** Inserts the passed table operation into the sheet. */
-    void                finalizeTableOperation(
-                            const ::com::sun::star::table::CellRangeAddress& rRange,
-                            const DataTableModel& rModel ) const;
+    void finalizeTableOperation(
+        const ::com::sun::star::table::CellRangeAddress& rRange, const DataTableModel& rModel );
 
     /** Writes all cell formatting attributes to the passed cell range list. (depreciates writeXfIdRangeProperties) */
     void                applyCellMerging( const ::com::sun::star::table::CellRangeAddress& rRange );
diff --git a/sc/source/filter/oox/sheetdatabuffer.cxx b/sc/source/filter/oox/sheetdatabuffer.cxx
index f55d365..2b340c5 100644
--- a/sc/source/filter/oox/sheetdatabuffer.cxx
+++ b/sc/source/filter/oox/sheetdatabuffer.cxx
@@ -51,6 +51,8 @@
 #include "scitems.hxx"
 #include "formulacell.hxx"
 #include "docpool.hxx"
+#include "paramisc.hxx"
+#include "documentimport.hxx"
 
 namespace oox {
 namespace xls {
@@ -565,71 +567,79 @@ void SheetDataBuffer::finalizeArrayFormula( const CellRangeAddress& rRange, cons
         xTokens->setArrayTokens( rTokens );
 }
 
-void SheetDataBuffer::finalizeTableOperation( const CellRangeAddress& rRange, const DataTableModel& rModel ) const
+void SheetDataBuffer::finalizeTableOperation( const CellRangeAddress& rRange, const DataTableModel& rModel )
 {
+    if (rModel.mbRef1Deleted)
+        return;
+
+    if (rModel.maRef1.isEmpty())
+        return;
+
+    if (rRange.StartColumn <= 0 || rRange.StartRow <= 0)
+        return;
+
     sal_Int16 nSheet = getSheetIndex();
-    bool bOk = false;
-    if( !rModel.mbRef1Deleted && !rModel.maRef1.isEmpty() && (rRange.StartColumn > 0) && (rRange.StartRow > 0) )
+
+    CellAddress aRef1;
+    if (!getAddressConverter().convertToCellAddress(aRef1, rModel.maRef1, nSheet, true))
+        return;
+
+    ScDocumentImport& rDoc = getDocImport();
+    ScTabOpParam aParam;
+
+    ScRange aScRange;
+    ScUnoConversion::FillScRange(aScRange, rRange);
+
+    if (rModel.mb2dTable)
     {
-        CellRangeAddress aOpRange = rRange;
-        CellAddress aRef1;
-        if( getAddressConverter().convertToCellAddress( aRef1, rModel.maRef1, nSheet, true ) ) try
-        {
-            if( rModel.mb2dTable )
-            {
-                CellAddress aRef2;
-                if( !rModel.mbRef2Deleted && getAddressConverter().convertToCellAddress( aRef2, rModel.maRef2, nSheet, true ) )
-                {
-                    // API call expects input values inside operation range
-                    --aOpRange.StartColumn;
-                    --aOpRange.StartRow;
-                    // formula range is top-left cell of operation range
-                    CellRangeAddress aFormulaRange( nSheet, aOpRange.StartColumn, aOpRange.StartRow, aOpRange.StartColumn, aOpRange.StartRow );
-                    // set multiple operation
-                    Reference< XMultipleOperation > xMultOp( getCellRange( aOpRange ), UNO_QUERY_THROW );
-                    xMultOp->setTableOperation( aFormulaRange, TableOperationMode_BOTH, aRef2, aRef1 );
-                    bOk = true;
-                }
-            }
-            else if( rModel.mbRowTable )
-            {
-                // formula range is column to the left of operation range
-                CellRangeAddress aFormulaRange( nSheet, aOpRange.StartColumn - 1, aOpRange.StartRow, aOpRange.StartColumn - 1, aOpRange.EndRow );
-                // API call expects input values (top row) inside operation range
-                --aOpRange.StartRow;
-                // set multiple operation
-                Reference< XMultipleOperation > xMultOp( getCellRange( aOpRange ), UNO_QUERY_THROW );
-                xMultOp->setTableOperation( aFormulaRange, TableOperationMode_ROW, aRef1, aRef1 );
-                bOk = true;
-            }
-            else
-            {
-                // formula range is row above operation range
-                CellRangeAddress aFormulaRange( nSheet, aOpRange.StartColumn, aOpRange.StartRow - 1, aOpRange.EndColumn, aOpRange.StartRow - 1 );
-                // API call expects input values (left column) inside operation range
-                --aOpRange.StartColumn;
-                // set multiple operation
-                Reference< XMultipleOperation > xMultOp( getCellRange( aOpRange ), UNO_QUERY_THROW );
-                xMultOp->setTableOperation( aFormulaRange, TableOperationMode_COLUMN, aRef1, aRef1 );
-                bOk = true;
-            }
-        }
-        catch( Exception& )
-        {
-        }
+        // Two-variable data table.
+        if (rModel.mbRef2Deleted)
+            return;
+
+        if (rModel.maRef2.isEmpty())
+            return;
+
+        CellAddress aRef2;
+        if (!getAddressConverter().convertToCellAddress(aRef2, rModel.maRef2, nSheet, true))
+            return;
+
+        aParam.meMode = ScTabOpParam::Both;
+
+        aParam.aRefFormulaCell.Set(rRange.StartColumn-1, rRange.StartRow-1, nSheet, false, false, false);
+        aParam.aRefFormulaEnd = aParam.aRefFormulaCell;
+
+        aScRange.aStart.IncRow(-1);
+        aScRange.aStart.IncCol(-1);
+
+        // Ref1 is row input cell and Ref2 is column input cell.
+        aParam.aRefRowCell.Set(aRef1.Column, aRef1.Row, aRef1.Sheet, false, false, false);
+        aParam.aRefColCell.Set(aRef2.Column, aRef2.Row, aRef2.Sheet, false, false, false);
+        rDoc.setTableOpCells(aScRange, aParam);
+
+        return;
     }
 
-    // on error: fill cell range with #REF! error codes
-    if( !bOk ) try
+    // One-variable data table.
+
+    if (rModel.mbRowTable)
     {
-        Reference< XCellRangeData > xCellRangeData( getCellRange( rRange ), UNO_QUERY_THROW );
-        size_t nWidth = static_cast< size_t >( rRange.EndColumn - rRange.StartColumn + 1 );
-        size_t nHeight = static_cast< size_t >( rRange.EndRow - rRange.StartRow + 1 );
-        Matrix< Any > aErrorCells( nWidth, nHeight, Any( getFormulaParser().convertErrorToFormula( BIFF_ERR_REF ) ) );
-        xCellRangeData->setDataArray( ContainerHelper::matrixToSequenceSequence( aErrorCells ) );
+        // One-variable row input cell (horizontal).
+        aParam.meMode = ScTabOpParam::Row;
+        aParam.aRefRowCell.Set(aRef1.Column, aRef1.Row, aRef1.Sheet, false, false, false);
+        aParam.aRefFormulaCell.Set(rRange.StartColumn-1, rRange.StartRow, nSheet, false, true, false);
+        aParam.aRefFormulaEnd = aParam.aRefFormulaCell;
+        aScRange.aStart.IncRow(-1);
+        rDoc.setTableOpCells(aScRange, aParam);
     }
-    catch( Exception& )
+    else
     {
+        // One-variable column input cell (vertical).
+        aParam.meMode = ScTabOpParam::Column;
+        aParam.aRefColCell.Set(aRef1.Column, aRef1.Row, aRef1.Sheet, false, false, false);
+        aParam.aRefFormulaCell.Set(rRange.StartColumn, rRange.StartRow-1, nSheet, true, false, false);
+        aParam.aRefFormulaEnd = aParam.aRefFormulaCell;
+        aScRange.aStart.IncCol(-1);
+        rDoc.setTableOpCells(aScRange, aParam);
     }
 }
 
commit 96860b65d4bb95603549f72b1e82c6ee49458ba8
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Fri Nov 1 21:14:35 2013 -0400

    Renamed test file.
    
    Change-Id: I912778f2eedb162f2a04c0a7bc8a5220ea0fca2c

diff --git a/sc/qa/unit/data/xls/data-table.xls b/sc/qa/unit/data/xls/data-table-mortgage.xls
similarity index 100%
rename from sc/qa/unit/data/xls/data-table.xls
rename to sc/qa/unit/data/xls/data-table-mortgage.xls
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 08b57eb..a9956e1 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -1076,7 +1076,7 @@ void ScFiltersTest::testDataValidityODS()
 
 void ScFiltersTest::testDataTableXLS()
 {
-    ScDocShellRef xDocSh = loadDoc("data-table.", XLS);
+    ScDocShellRef xDocSh = loadDoc("data-table-mortgage.", XLS);
     ScFormulaOptions aOptions;
     aOptions.SetFormulaSepArg(",");
     aOptions.SetFormulaSepArrayCol(",");
commit 58b8d6d453a402f9e4068f055572da3c766af081
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Fri Nov 1 20:23:18 2013 -0400

    Use position hints for broadcasters when activating formula cells.
    
    No reason not to do this since we are bulk-registering formula cells.
    
    Change-Id: Ie0356c62a3c4698f5560272cb0c104f84cacde56

diff --git a/sc/source/core/data/documentimport.cxx b/sc/source/core/data/documentimport.cxx
index f52eb38..3b33f46 100644
--- a/sc/source/core/data/documentimport.cxx
+++ b/sc/source/core/data/documentimport.cxx
@@ -19,16 +19,22 @@
 #include "stringutil.hxx"
 #include "compiler.hxx"
 #include "paramisc.hxx"
+#include "listenercontext.hxx"
 
 #include "svl/sharedstringpool.hxx"
 
 struct ScDocumentImportImpl
 {
     ScDocument& mrDoc;
+    sc::StartListeningContext maListenCxt;
     sc::ColumnBlockPositionSet maBlockPosSet;
     sal_uInt16 mnDefaultScriptNumeric;
 
-    ScDocumentImportImpl(ScDocument& rDoc) : mrDoc(rDoc), maBlockPosSet(rDoc), mnDefaultScriptNumeric(SC_SCRIPTTYPE_UNKNOWN) {}
+    ScDocumentImportImpl(ScDocument& rDoc) :
+        mrDoc(rDoc),
+        maListenCxt(rDoc),
+        maBlockPosSet(rDoc),
+        mnDefaultScriptNumeric(SC_SCRIPTTYPE_UNKNOWN) {}
 };
 
 ScDocumentImport::ScDocumentImport(ScDocument& rDoc) : mpImpl(new ScDocumentImportImpl(rDoc)) {}
@@ -398,13 +404,15 @@ namespace {
 class CellStoreInitializer
 {
     ScDocument& mrDoc;
+    sc::StartListeningContext& mrListenCxt;
     sc::CellTextAttrStoreType maAttrs;
     sc::CellTextAttrStoreType::iterator miPos;
     sal_uInt16 mnScriptNumeric;
 
 public:
-    CellStoreInitializer(ScDocument& rDoc, sal_uInt16 nScriptNumeric) :
+    CellStoreInitializer(ScDocument& rDoc, sc::StartListeningContext& rCxt, sal_uInt16 nScriptNumeric) :
         mrDoc(rDoc),
+        mrListenCxt(rCxt),
         maAttrs(MAXROWCOUNT),
         miPos(maAttrs.begin()),
         mnScriptNumeric(nScriptNumeric) {}
@@ -429,7 +437,7 @@ public:
             for (; it != itEnd; ++it)
             {
                 ScFormulaCell& rFC = **it;
-                rFC.StartListeningTo(&mrDoc);
+                rFC.StartListeningTo(mrListenCxt);
             }
         }
     }
@@ -444,7 +452,8 @@ public:
 
 void ScDocumentImport::finalize()
 {
-    // Populate the text width and script type arrays in all columns.
+    // Populate the text width and script type arrays in all columns. Also
+    // activate all formula cells.
     ScDocument::TableContainer::iterator itTab = mpImpl->mrDoc.maTabs.begin(), itTabEnd = mpImpl->mrDoc.maTabs.end();
     for (; itTab != itTabEnd; ++itTab)
     {
@@ -461,7 +470,7 @@ void ScDocumentImport::finalize()
 
 void ScDocumentImport::initColumn(ScColumn& rCol)
 {
-    CellStoreInitializer aFunc(mpImpl->mrDoc, mpImpl->mnDefaultScriptNumeric);
+    CellStoreInitializer aFunc(mpImpl->mrDoc, mpImpl->maListenCxt, mpImpl->mnDefaultScriptNumeric);
     std::for_each(rCol.maCells.begin(), rCol.maCells.end(), aFunc);
     aFunc.swap(rCol.maCellTextAttrs);
     rCol.RegroupFormulaCells();
commit 8c6dd2cbcdf72b249051321dd7f7d3375e52f7b3
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Fri Nov 1 20:14:12 2013 -0400

    No point using the pimpl pattern here.
    
    The whole class is already hidden in the source file.
    
    Change-Id: Ib6157ae275217a95586735f74beee1700041a679

diff --git a/sc/source/core/data/documentimport.cxx b/sc/source/core/data/documentimport.cxx
index c2b951a..f52eb38 100644
--- a/sc/source/core/data/documentimport.cxx
+++ b/sc/source/core/data/documentimport.cxx
@@ -397,23 +397,17 @@ namespace {
 
 class CellStoreInitializer
 {
-    struct Impl
-    {
-        sc::CellTextAttrStoreType maAttrs;
-        sc::CellTextAttrStoreType::iterator miPos;
-        sal_uInt16 mnScriptNumeric;
-
-        Impl(const sal_uInt32 nMaxRowCount, const sal_uInt16 nScriptNumeric)
-            : maAttrs(nMaxRowCount), miPos(maAttrs.begin()), mnScriptNumeric(nScriptNumeric)
-        {}
-    };
-
     ScDocument& mrDoc;
-    boost::shared_ptr<Impl> mpImpl;
+    sc::CellTextAttrStoreType maAttrs;
+    sc::CellTextAttrStoreType::iterator miPos;
+    sal_uInt16 mnScriptNumeric;
 
 public:
     CellStoreInitializer(ScDocument& rDoc, sal_uInt16 nScriptNumeric) :
-        mrDoc(rDoc), mpImpl(new Impl(MAXROWCOUNT, nScriptNumeric)) {}
+        mrDoc(rDoc),
+        maAttrs(MAXROWCOUNT),
+        miPos(maAttrs.begin()),
+        mnScriptNumeric(nScriptNumeric) {}
 
     void operator() (const sc::CellStoreType::value_type& node)
     {
@@ -423,9 +417,9 @@ public:
         // Fill with default values for non-empty cell segments.
         sc::CellTextAttr aDefault;
         if (node.type == sc::element_type_numeric)
-            aDefault.mnScriptType = mpImpl->mnScriptNumeric;
+            aDefault.mnScriptType = mnScriptNumeric;
         std::vector<sc::CellTextAttr> aDefaults(node.size, aDefault);
-        mpImpl->miPos = mpImpl->maAttrs.set(mpImpl->miPos, node.position, aDefaults.begin(), aDefaults.end());
+        miPos = maAttrs.set(miPos, node.position, aDefaults.begin(), aDefaults.end());
 
         if (node.type == sc::element_type_formula)
         {
@@ -442,7 +436,7 @@ public:
 
     void swap(sc::CellTextAttrStoreType& rAttrs)
     {
-        mpImpl->maAttrs.swap(rAttrs);
+        maAttrs.swap(rAttrs);
     }
 };
 
commit 20a359ea3669b0f33edf7b9d66e56343e0624a0d
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Fri Nov 1 20:09:57 2013 -0400

    Have all formula cells start listening at once after the file load.
    
    Rather than doing it individually.
    
    Change-Id: I5ed55947b715bf6d7d61a1f8b751be7fdcf425fb

diff --git a/sc/source/core/data/documentimport.cxx b/sc/source/core/data/documentimport.cxx
index 323ccfb..c2b951a 100644
--- a/sc/source/core/data/documentimport.cxx
+++ b/sc/source/core/data/documentimport.cxx
@@ -395,7 +395,7 @@ void ScDocumentImport::setTableOpCells(const ScRange& rRange, const ScTabOpParam
 
 namespace {
 
-class CellTextAttrInitializer
+class CellStoreInitializer
 {
     struct Impl
     {
@@ -408,10 +408,12 @@ class CellTextAttrInitializer
         {}
     };
 
+    ScDocument& mrDoc;
     boost::shared_ptr<Impl> mpImpl;
 
 public:
-    CellTextAttrInitializer(sal_uInt16 nScriptNumeric) : mpImpl(new Impl(MAXROWCOUNT, nScriptNumeric)) {}
+    CellStoreInitializer(ScDocument& rDoc, sal_uInt16 nScriptNumeric) :
+        mrDoc(rDoc), mpImpl(new Impl(MAXROWCOUNT, nScriptNumeric)) {}
 
     void operator() (const sc::CellStoreType::value_type& node)
     {
@@ -424,6 +426,18 @@ public:
             aDefault.mnScriptType = mpImpl->mnScriptNumeric;
         std::vector<sc::CellTextAttr> aDefaults(node.size, aDefault);
         mpImpl->miPos = mpImpl->maAttrs.set(mpImpl->miPos, node.position, aDefaults.begin(), aDefaults.end());
+
+        if (node.type == sc::element_type_formula)
+        {
+            // Have all formula cells start listening to the document.
+            sc::formula_block::iterator it = sc::formula_block::begin(*node.data);
+            sc::formula_block::iterator itEnd = sc::formula_block::end(*node.data);
+            for (; it != itEnd; ++it)
+            {
+                ScFormulaCell& rFC = **it;
+                rFC.StartListeningTo(&mrDoc);
+            }
+        }
     }
 
     void swap(sc::CellTextAttrStoreType& rAttrs)
@@ -453,7 +467,7 @@ void ScDocumentImport::finalize()
 
 void ScDocumentImport::initColumn(ScColumn& rCol)
 {
-    CellTextAttrInitializer aFunc(mpImpl->mnDefaultScriptNumeric);
+    CellStoreInitializer aFunc(mpImpl->mrDoc, mpImpl->mnDefaultScriptNumeric);
     std::for_each(rCol.maCells.begin(), rCol.maCells.end(), aFunc);
     aFunc.swap(rCol.maCellTextAttrs);
     rCol.RegroupFormulaCells();
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index df2da17..1372d775 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -364,7 +364,6 @@ void ScOrcusSheet::set_shared_formula(
 
     // For now, orcus doesn't support setting cached result. Mark it for re-calculation.
     pCell->SetDirty(true);
-    pCell->StartListeningTo(&mrDoc.getDoc());
 }
 
 void ScOrcusSheet::set_shared_formula(
@@ -388,7 +387,6 @@ void ScOrcusSheet::set_shared_formula(os::row_t row, os::col_t col, size_t sinde
 
     // For now, orcus doesn't support setting cached result. Mark it for re-calculation.
     pCell->SetDirty(true);
-    pCell->StartListeningTo(&mrDoc.getDoc());
 }
 
 void ScOrcusSheet::set_array_formula(
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index 31e5bea9..a3f3a0f0 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -1027,7 +1027,6 @@ void ScXMLTableRowCellContext::SetFormulaCell(ScFormulaCell* pFCell) const
             pFCell->SetHybridDouble(fValue);
             pFCell->ResetDirty();
         }
-        pFCell->StartListeningTo(rXMLImport.GetDocument());
     }
 }
 
@@ -1075,7 +1074,6 @@ void ScXMLTableRowCellContext::PutTextCell( const ScAddress& rCurrentPos,
                         SAL_WARN("sc", "matrix cell without matrix");
                 }
             }
-            pFCell->StartListeningTo(rXMLImport.GetDocument());
         }
     }
     else //regular text cells
@@ -1437,7 +1435,6 @@ void ScXMLTableRowCellContext::AddFormulaCell( const ScAddress& rCellPos )
                         nMatrixCols, nMatrixRows, pMat, new formula::FormulaDoubleToken(fValue));
                     pFCell->ResetDirty();
                 }
-                pFCell->StartListeningTo(rXMLImport.GetDocument());
             }
         }
         else
commit 488b1ea1b9e780930802f5e4eead37552d1c3f6c
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Fri Nov 1 18:36:42 2013 -0400

    Fix multiple operations with formula cell with indirect dependency.
    
    Now the unit test passes.  Good.
    
    Change-Id: I23fa8355805c192f43db0199f3628f2bf457a645

diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 0a03ad9..c08236b 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -492,7 +492,7 @@ public:
     bool HasBroadcaster() const;
 
     void Broadcast( SCROW nRow );
-    void BroadcastCells( const std::vector<SCROW>& rRows );
+    void BroadcastCells( const std::vector<SCROW>& rRows, sal_uLong nHint );
 
     // cell notes
     ScPostIt* GetCellNote( SCROW nRow );
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 3cb9ab9..9f824e5 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -1387,11 +1387,10 @@ void Test::testMultipleOperations()
     aParam.aRefFormulaCell.Set(2,0,0,false,false,false);
     aParam.aRefFormulaEnd = aParam.aRefFormulaCell;
     m_pDoc->InsertTableOp(aParam, 0, 2, 1, 4, aMark);
-#if 0 // TODO: Make this pass.
     CPPUNIT_ASSERT_EQUAL(30.0, m_pDoc->GetValue(1,2,0));
     CPPUNIT_ASSERT_EQUAL(40.0, m_pDoc->GetValue(1,3,0));
     CPPUNIT_ASSERT_EQUAL(50.0, m_pDoc->GetValue(1,4,0));
-#endif
+
     m_pDoc->DeleteTab(0);
 }
 
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 018f9e1..512ccc5 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -890,7 +890,7 @@ void ScColumn::SwapRow(SCROW nRow1, SCROW nRow2)
         SwapCellTextAttrs(nRow1, nRow2);
         SwapCellNotes(nRow1, nRow2);
         CellStorageModified();
-        BroadcastCells(aRows);
+        BroadcastCells(aRows, SC_HINT_DATACHANGED);
         return;
     }
 
@@ -938,7 +938,7 @@ void ScColumn::SwapRow(SCROW nRow1, SCROW nRow2)
         SwapCellTextAttrs(nRow1, nRow2);
         SwapCellNotes(nRow1, nRow2);
         CellStorageModified();
-        BroadcastCells(aRows);
+        BroadcastCells(aRows, SC_HINT_DATACHANGED);
         return;
     }
 
@@ -983,7 +983,7 @@ void ScColumn::SwapRow(SCROW nRow1, SCROW nRow2)
         SwapCellTextAttrs(nRow1, nRow2);
         SwapCellNotes(nRow1, nRow2);
         CellStorageModified();
-        BroadcastCells(aRows);
+        BroadcastCells(aRows, SC_HINT_DATACHANGED);
         return;
     }
 
@@ -1117,7 +1117,7 @@ void ScColumn::SwapRow(SCROW nRow1, SCROW nRow2)
     SwapCellTextAttrs(nRow1, nRow2);
     SwapCellNotes(nRow1, nRow2);
     CellStorageModified();
-    BroadcastCells(aRows);
+    BroadcastCells(aRows, SC_HINT_DATACHANGED);
 }
 
 namespace {
@@ -2760,7 +2760,7 @@ public:
     {
         std::vector<SCROW> aRows;
         maValueRanges.getRows(aRows);
-        mrColumn.BroadcastCells(aRows);
+        mrColumn.BroadcastCells(aRows, SC_HINT_DATACHANGED);
     }
 };
 
@@ -2792,7 +2792,7 @@ public:
     {
         std::vector<SCROW> aRows;
         maValueRanges.getRows(aRows);
-        mrColumn.BroadcastCells(aRows);
+        mrColumn.BroadcastCells(aRows, SC_HINT_TABLEOPDIRTY);
     }
 };
 
@@ -3173,7 +3173,7 @@ void ScColumn::BroadcastRecalcOnRefMove()
     sc::AutoCalcSwitch aSwitch(*pDocument, false);
     RecalcOnRefMoveCollector aFunc;
     sc::ProcessFormula(maCells, aFunc);
-    BroadcastCells(aFunc.getDirtyRows());
+    BroadcastCells(aFunc.getDirtyRows(), SC_HINT_DATACHANGED);
 }
 
 void ScColumn::CalcAll()
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index ece9035..61f5326 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -74,13 +74,13 @@ void ScColumn::Broadcast( SCROW nRow )
     pDocument->Broadcast(aHint);
 }
 
-void ScColumn::BroadcastCells( const std::vector<SCROW>& rRows )
+void ScColumn::BroadcastCells( const std::vector<SCROW>& rRows, sal_uLong nHint )
 {
     if (rRows.empty())
         return;
 
     // Broadcast the changes.
-    ScHint aHint(SC_HINT_DATACHANGED, ScAddress(nCol, 0, nTab));
+    ScHint aHint(nHint, ScAddress(nCol, 0, nTab));
     std::vector<SCROW>::const_iterator itRow = rRows.begin(), itRowEnd = rRows.end();
     for (; itRow != itRowEnd; ++itRow)
     {
@@ -285,7 +285,7 @@ void ScColumn::DeleteRow( SCROW nStartRow, SCSIZE nSize )
     sc::SharedFormulaUtil::joinFormulaCellAbove(aPos);
 
     // Single cell broadcasts on deleted cells.
-    BroadcastCells(aDeleteRowsFunc.getNonEmptyRows());
+    BroadcastCells(aDeleteRowsFunc.getNonEmptyRows(), SC_HINT_DATACHANGED);
 
     // Shift the text attribute array too (before the broadcast).
     maCellTextAttrs.erase(nStartRow, nEndRow);
@@ -628,7 +628,7 @@ void ScColumn::DeleteArea(SCROW nStartRow, SCROW nEndRow, sal_uInt16 nDelFlag)
 
     // Broadcast on only cells that were deleted; no point broadcasting on
     // cells that were already empty before the deletion.
-    BroadcastCells(aDeletedRows);
+    BroadcastCells(aDeletedRows, SC_HINT_DATACHANGED);
 }
 
 bool ScColumn::InitBlockPosition( sc::ColumnBlockPosition& rBlockPos )
commit a364a87f73fc2730a987992a8d4242bc12f788d0
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Fri Nov 1 15:16:40 2013 -0400

    Add test for multiple operations.  Part of it fails currently.
    
    Change-Id: I90e3bbaae41fac51711b8502fbeb6ee2ebf19082

diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx
index 5689435..b9c1d42 100644
--- a/sc/qa/unit/ucalc.hxx
+++ b/sc/qa/unit/ucalc.hxx
@@ -93,6 +93,7 @@ public:
     void testFormulaRefUpdateSheets();
     void testFormulaRefUpdateMove();
     void testFormulaRefUpdateNamedExpression();
+    void testMultipleOperations();
     void testFuncCOLUMN();
     void testFuncROW();
     void testFuncSUM();
@@ -300,6 +301,7 @@ public:
     CPPUNIT_TEST(testFormulaRefUpdateSheets);
     CPPUNIT_TEST(testFormulaRefUpdateMove);
     CPPUNIT_TEST(testFormulaRefUpdateNamedExpression);
+    CPPUNIT_TEST(testMultipleOperations);
     CPPUNIT_TEST(testFuncCOLUMN);
     CPPUNIT_TEST(testFuncROW);
     CPPUNIT_TEST(testFuncSUM);
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 598c65d..3cb9ab9 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -21,6 +21,7 @@
 #include "scmod.hxx"
 #include "docsh.hxx"
 #include "docfunc.hxx"
+#include "paramisc.hxx"
 
 #include "formula/vectortoken.hxx"
 
@@ -1308,6 +1309,7 @@ void Test::testFormulaRefUpdateNamedExpression()
     m_pDoc->SetValue(ScAddress(3,9,1), 10);
     CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(ScAddress(2,7,1)));
 
+    // Delete the inserted sheet, which will shift the 'Formula' sheet to the left.
     m_pDoc->DeleteTab(0);
 
     aName = OUString();
@@ -1341,6 +1343,58 @@ void Test::testFormulaRefUpdateNamedExpression()
     m_pDoc->DeleteTab(0);
 }
 
+void Test::testMultipleOperations()
+{
+    m_pDoc->InsertTab(0, "MultiOp");
+
+    sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn auto calc on.
+
+    // Insert the reference formula at top row.
+    m_pDoc->SetValue(ScAddress(0,0,0), 1);
+    m_pDoc->SetString(ScAddress(1,0,0), "=A1*10");
+    CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(ScAddress(1,0,0)));
+
+    // Insert variable inputs in A3:A5.
+    m_pDoc->SetValue(ScAddress(0,2,0), 2);
+    m_pDoc->SetValue(ScAddress(0,3,0), 3);
+    m_pDoc->SetValue(ScAddress(0,4,0), 4);
+
+    // Set multiple operations range.
+    ScTabOpParam aParam;
+    aParam.aRefFormulaCell = ScRefAddress(1,0,0,false,false,false);
+    aParam.aRefFormulaEnd = aParam.aRefFormulaCell;
+    aParam.aRefColCell = ScRefAddress(0,0,0,false,false,false);
+    ScMarkData aMark;
+    aMark.SetMarkArea(ScRange(0,2,0,1,4,0)); // Select A3:B5.
+    m_pDoc->InsertTableOp(aParam, 0, 2, 1, 4, aMark);
+    CPPUNIT_ASSERT_EQUAL(20.0, m_pDoc->GetValue(1,2,0));
+    CPPUNIT_ASSERT_EQUAL(30.0, m_pDoc->GetValue(1,3,0));
+    CPPUNIT_ASSERT_EQUAL(40.0, m_pDoc->GetValue(1,4,0));
+
+    // Clear A3:B5.
+    clearRange(m_pDoc, ScRange(0,2,0,1,4,0));
+
+    // This time, use indirect reference formula cell.
+    m_pDoc->SetString(ScAddress(2,0,0), "=B1"); // C1 simply references B1.
+    CPPUNIT_ASSERT_EQUAL(10.0, m_pDoc->GetValue(ScAddress(2,0,0)));
+
+    // Insert variable inputs in A3:A5.
+    m_pDoc->SetValue(ScAddress(0,2,0), 3);
+    m_pDoc->SetValue(ScAddress(0,3,0), 4);
+    m_pDoc->SetValue(ScAddress(0,4,0), 5);
+
+    // Set multiple operations range again, but this time, we'll use C1 as the reference formula.
+    aParam.aRefFormulaCell.Set(2,0,0,false,false,false);
+    aParam.aRefFormulaEnd = aParam.aRefFormulaCell;
+    m_pDoc->InsertTableOp(aParam, 0, 2, 1, 4, aMark);
+#if 0 // TODO: Make this pass.
+    CPPUNIT_ASSERT_EQUAL(30.0, m_pDoc->GetValue(1,2,0));
+    CPPUNIT_ASSERT_EQUAL(40.0, m_pDoc->GetValue(1,3,0));
+    CPPUNIT_ASSERT_EQUAL(50.0, m_pDoc->GetValue(1,4,0));
+#endif
+    m_pDoc->DeleteTab(0);
+}
+
 void Test::testFuncCOLUMN()
 {
     m_pDoc->InsertTab(0, "Formula");
commit 13b69492716c506976a31a26fe0590aa06b3d1a3
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Fri Nov 1 13:28:00 2013 -0400

    We need to update sheet positions of range names when modifying sheets.
    
    And add Dump() to ScRangeData for debugging convenience and re-enable
    previously failed test cases.
    
    Change-Id: I9d8f41a8be4c9c301254ef300c7b7f0c1ea7f393

diff --git a/sc/inc/rangenam.hxx b/sc/inc/rangenam.hxx
index 65fae47..6113709 100644
--- a/sc/inc/rangenam.hxx
+++ b/sc/inc/rangenam.hxx
@@ -24,6 +24,7 @@
 #include "address.hxx"
 #include "formula/grammar.hxx"
 #include "scdllapi.h"
+#include "calcmacros.hxx"
 
 #include <map>
 #include <vector>
@@ -151,6 +152,10 @@ public:
     SCCOL GetMaxCol() const;
 
     void            CompileUnresolvedXML();
+
+#if DEBUG_FORMULA_COMPILER
+    void Dump() const;
+#endif
 };
 
 inline bool ScRangeData::HasType( RangeType nType ) const
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 92eebc2..598c65d 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -1296,20 +1296,29 @@ void Test::testFormulaRefUpdateNamedExpression()
     m_pDoc->SetValue(ScAddress(3,9,0), 20);
     CPPUNIT_ASSERT_EQUAL(43.0, m_pDoc->GetValue(ScAddress(2,7,0)));
 
-#if 0
     // Insert a new sheet before the current.
     m_pDoc->InsertTab(0, "New");
     OUString aName;
     m_pDoc->GetName(1, aName);
     CPPUNIT_ASSERT_EQUAL(OUString("Formula"), aName);
+
+    pName = pGlobalNames->findByUpperName("MYRANGE");
+    CPPUNIT_ASSERT_MESSAGE("Failed to find named expression 'MyRange' in the global scope.", pName);
+
     m_pDoc->SetValue(ScAddress(3,9,1), 10);
     CPPUNIT_ASSERT_EQUAL(33.0, m_pDoc->GetValue(ScAddress(2,7,1)));
 
     m_pDoc->DeleteTab(0);
 
+    aName = OUString();
+    m_pDoc->GetName(0, aName);
+    CPPUNIT_ASSERT_EQUAL(OUString("Formula"), aName);
+
+    pName = pGlobalNames->findByUpperName("MYRANGE");
+    CPPUNIT_ASSERT_MESSAGE("Failed to find named expression 'MyRange' in the global scope.", pName);
+
     m_pDoc->SetValue(ScAddress(3,9,0), 11);
     CPPUNIT_ASSERT_EQUAL(34.0, m_pDoc->GetValue(ScAddress(2,7,0)));
-#endif
 
     // Clear all and start over.
     clearRange(m_pDoc, ScRange(0,0,0,100,100,0));
diff --git a/sc/source/core/tool/rangenam.cxx b/sc/source/core/tool/rangenam.cxx
index b963eab..4389a4b 100644
--- a/sc/source/core/tool/rangenam.cxx
+++ b/sc/source/core/tool/rangenam.cxx
@@ -196,6 +196,18 @@ void ScRangeData::CompileUnresolvedXML()
     }
 }
 
+#if DEBUG_FORMULA_COMPILER
+void ScRangeData::Dump() const
+{
+    cout << "-- ScRangeData" << endl;
+    cout << "  name: " << aName << endl;
+    cout << "  ref position: (col=" << aPos.Col() << ", row=" << aPos.Row() << ", sheet=" << aPos.Tab() << ")" << endl;
+
+    if (pCode)
+        pCode->Dump();
+}
+#endif
+
 void ScRangeData::GuessPosition()
 {
     // set a position that allows "absoluting" of all relative references
@@ -392,6 +404,9 @@ void ScRangeData::UpdateInsertTab( sc::RefUpdateInsertTabContext& rCxt, SCTAB nL
     sc::RefUpdateResult aRes = pCode->AdjustReferenceOnInsertedTab(rCxt, aPos);
     if (aRes.mbReferenceModified)
         rCxt.maUpdatedNames.setUpdatedName(nLocalTab, nIndex);
+
+    if (rCxt.mnInsertPos <= aPos.Tab())
+        aPos.IncTab(rCxt.mnSheets);
 }
 
 void ScRangeData::UpdateDeleteTab( sc::RefUpdateDeleteTabContext& rCxt, SCTAB nLocalTab )
@@ -399,6 +414,9 @@ void ScRangeData::UpdateDeleteTab( sc::RefUpdateDeleteTabContext& rCxt, SCTAB nL
     sc::RefUpdateResult aRes = pCode->AdjustReferenceOnDeletedTab(rCxt, aPos);
     if (aRes.mbReferenceModified)
         rCxt.maUpdatedNames.setUpdatedName(nLocalTab, nIndex);
+
+    if (rCxt.mnDeletePos <= aPos.Tab())
+        aPos.IncTab(-rCxt.mnSheets);
 }
 
 void ScRangeData::UpdateMoveTab( sc::RefUpdateMoveTabContext& rCxt, SCTAB nLocalTab )
@@ -406,6 +424,8 @@ void ScRangeData::UpdateMoveTab( sc::RefUpdateMoveTabContext& rCxt, SCTAB nLocal
     sc::RefUpdateResult aRes = pCode->AdjustReferenceOnMovedTab(rCxt, aPos);
     if (aRes.mbReferenceModified)
         rCxt.maUpdatedNames.setUpdatedName(nLocalTab, nIndex);
+
+    aPos.SetTab(rCxt.getNewTab(aPos.Tab()));
 }
 
 void ScRangeData::MakeValidName( OUString& rName )
commit 07b66cd3ac1a9f6c7b61a1d7da6e9d266e6de92d
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Thu Oct 31 17:53:02 2013 -0400

    Insert matrix formula vis ScDocumentImport, and more formula imorts.
    
    Now SetGroupFormulaCell() is no longer used.
    
    Change-Id: I10a387da04724794974eaf491a8efa4cda09d82a

diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 3ee53d6..0a03ad9 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -284,7 +284,6 @@ public:
      */
     ScFormulaCell* SetFormulaCell( SCROW nRow, ScFormulaCell* pCell );
     ScFormulaCell* SetFormulaCell( sc::ColumnBlockPosition& rBlockPos, SCROW nRow, ScFormulaCell* pCell );
-    bool SetGroupFormulaCell( SCROW nRow, ScFormulaCell* pCell );
 
     svl::SharedString GetSharedString( SCROW nRow ) const;
 
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index fb3a175..6929e9b 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -825,16 +825,6 @@ public:
      */
     SC_DLLPUBLIC ScFormulaCell* SetFormulaCell( const ScAddress& rPos, ScFormulaCell* pCell );
 
-    /**
-     * Set formula cell, and transfer its ownership to the document.  Unlike
-     * SetFormulaCell(), this call will <i>not</i> attempt to group the passed
-     * formula cell with the adjacent cells or cell groups.
-     *
-     * @return true if the cell is inserted, false otherwise. The caller
-     *         should delete the cell instance if the method returns false.
-     */
-    SC_DLLPUBLIC bool SetGroupFormulaCell( const ScAddress& rPos, ScFormulaCell* pCell );
-
     SC_DLLPUBLIC void InsertMatrixFormula(SCCOL nCol1, SCROW nRow1,
                                         SCCOL nCol2, SCROW nRow2,
                                         const ScMarkData& rMark,
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 126b0ae..8eb75be 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -339,7 +339,6 @@ public:
      *         is deleted automatically on failure to insert.
      */
     ScFormulaCell* SetFormulaCell( SCCOL nCol, SCROW nRow, ScFormulaCell* pCell );
-    bool SetGroupFormulaCell( SCCOL nCol, SCROW nRow, ScFormulaCell* pCell );
 
     svl::SharedString GetSharedString( SCCOL nCol, SCROW nRow ) const;
 
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 991039c..ece9035 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -1769,21 +1769,6 @@ ScFormulaCell* ScColumn::SetFormulaCell( sc::ColumnBlockPosition& rBlockPos, SCR
     return pCell;
 }
 
-bool ScColumn::SetGroupFormulaCell( SCROW nRow, ScFormulaCell* pCell )
-{
-    sc::CellStoreType::iterator it = GetPositionToInsert(nRow);
-    sal_uInt32 nCellFormat = GetNumberFormat(nRow);
-    if( (nCellFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0)
-        pCell->SetNeedNumberFormat(true);
-    it = maCells.set(it, nRow, pCell);
-    maCellTextAttrs.set(nRow, sc::CellTextAttr());
-
-    CellStorageModified();
-
-    ActivateNewFormulaCell(it, nRow, *pCell, false);
-    return true;
-}
-
 svl::SharedString ScColumn::GetSharedString( SCROW nRow ) const
 {
     sc::CellStoreType::const_position_type aPos = maCells.position(nRow);
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 930c8d1..1e0bb87 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -1093,14 +1093,6 @@ ScFormulaCell* ScDocument::SetFormulaCell( const ScAddress& rPos, ScFormulaCell*
     return maTabs[rPos.Tab()]->SetFormulaCell(rPos.Col(), rPos.Row(), pCell);
 }
 
-bool ScDocument::SetGroupFormulaCell( const ScAddress& rPos, ScFormulaCell* pCell )
-{
-    if (!TableExists(rPos.Tab()))
-        return false;
-
-    return maTabs[rPos.Tab()]->SetGroupFormulaCell(rPos.Col(), rPos.Row(), pCell);
-}
-
 void ScDocument::SetConsolidateDlgData( const ScConsolidateParam* pData )
 {
     delete pConsolidateDlgData;
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 5295af6..c94d66a 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -1383,14 +1383,6 @@ ScFormulaCell* ScTable::SetFormulaCell( SCCOL nCol, SCROW nRow, ScFormulaCell* p
     return aCol[nCol].SetFormulaCell(nRow, pCell);
 }
 
-bool ScTable::SetGroupFormulaCell( SCCOL nCol, SCROW nRow, ScFormulaCell* pCell )
-{
-    if (!ValidColRow(nCol, nRow))
-        return false;
-
-    return aCol[nCol].SetGroupFormulaCell(nRow, pCell);
-}
-
 svl::SharedString ScTable::GetSharedString( SCCOL nCol, SCROW nRow ) const
 {
     if (!ValidColRow(nCol, nRow))
diff --git a/sc/source/filter/oox/formulabuffer.cxx b/sc/source/filter/oox/formulabuffer.cxx
index a4e3b7b..ade158f 100644
--- a/sc/source/filter/oox/formulabuffer.cxx
+++ b/sc/source/filter/oox/formulabuffer.cxx
@@ -16,6 +16,7 @@
 #include <com/sun/star/table/XCell2.hpp>
 #include "formulacell.hxx"
 #include "document.hxx"
+#include "documentimport.hxx"
 #include "convuno.hxx"
 
 #include "rangelst.hxx"
@@ -92,9 +93,7 @@ void FormulaBuffer::applyCellFormula( ScDocument& rDoc, const ApiTokenSequence&
     ScUnoConversion::FillScAddress( aCellPos, rAddress );
     ScTokenConversion::ConvertToTokenArray( rDoc, aTokenArray, rTokens );
     ScFormulaCell* pNewCell = new ScFormulaCell( &rDoc, aCellPos, &aTokenArray );
-    pNewCell->StartListeningTo( &rDoc );
-    rDoc.EnsureTable(aCellPos.Tab());
-    rDoc.SetGroupFormulaCell(aCellPos, pNewCell);
+    getDocImport().setFormulaCell(aCellPos, pNewCell);
 }
 
 void FormulaBuffer::applyCellFormulas( const std::vector< TokenAddressItem >& rVector )
@@ -140,7 +139,7 @@ void FormulaBuffer::applySharedFormulas( sal_Int32 nTab )
     const std::vector<SharedFormulaEntry>& rSharedFormulas = itShared->second;
     const std::vector<SharedFormulaDesc>& rCells = itCells->second;
 
-    ScDocument& rDoc = getScDocument();
+    ScDocumentImport& rDoc = getDocImport();
 
     sc::SharedFormulaGroups aGroups;
     {
@@ -154,7 +153,7 @@ void FormulaBuffer::applySharedFormulas( sal_Int32 nTab )
 
             ScAddress aPos;
             ScUnoConversion::FillScAddress(aPos, rAddr);
-            ScCompiler aComp(&rDoc, aPos);
+            ScCompiler aComp(&rDoc.getDoc(), aPos);
             aComp.SetGrammar(formula::FormulaGrammar::GRAM_ENGLISH_XL_OOX);
             ScTokenArray* pArray = aComp.CompileString(rTokenStr);
             if (pArray)
@@ -174,17 +173,8 @@ void FormulaBuffer::applySharedFormulas( sal_Int32 nTab )
 
             ScAddress aPos;
             ScUnoConversion::FillScAddress(aPos, rAddr);
-            ScFormulaCell* pCell = new ScFormulaCell(&rDoc, aPos, pArray);
-            bool bInserted = rDoc.SetGroupFormulaCell(aPos, pCell);
-            if (!bInserted)
-            {
-                // Insertion failed.
-                delete pCell;
-                continue;
-            }
-
-            pCell->StartListeningTo(&rDoc);
-
+            ScFormulaCell* pCell = new ScFormulaCell(&rDoc.getDoc(), aPos, pArray);
+            rDoc.setFormulaCell(aPos, pCell);
             if (it->maCellValue.isEmpty())
             {
                 // No cached cell value. Mark it for re-calculation.
@@ -210,7 +200,7 @@ void FormulaBuffer::applySharedFormulas( sal_Int32 nTab )
 
 void FormulaBuffer::applyArrayFormulas( const std::vector< TokenRangeAddressItem >& rVector )
 {
-    ScDocument& rDoc = getScDocument();
+    ScDocumentImport& rDocImport = getDocImport();
     std::vector<TokenRangeAddressItem>::const_iterator it = rVector.begin(), itEnd = rVector.end();
     for (; it != itEnd; ++it)
     {
@@ -219,21 +209,11 @@ void FormulaBuffer::applyArrayFormulas( const std::vector< TokenRangeAddressItem
         ScRange aRange;
         ScUnoConversion::FillScRange(aRange, it->maCellRangeAddress);
 
-        ScCompiler aComp(&rDoc, aPos);
+        ScCompiler aComp(&rDocImport.getDoc(), aPos);
         aComp.SetGrammar(formula::FormulaGrammar::GRAM_ENGLISH_XL_OOX);
         ScTokenArray* pArray = aComp.CompileString(it->maTokenAndAddress.maTokenStr);
         if (pArray)
-        {
-            ScMarkData aMark;
-            aMark.SelectOneTable(aPos.Tab());
-            rDoc.InsertMatrixFormula(
-                aRange.aStart.Col(), aRange.aStart.Row(), aRange.aEnd.Col(), aRange.aEnd.Row(),
-                aMark, it->maTokenAndAddress.maTokenStr, pArray, formula::FormulaGrammar::GRAM_ENGLISH_XL_OOX);
-
-            ScFormulaCell* pFC = rDoc.GetFormulaCell(aPos);
-            if (pFC)
-                pFC->StartListeningTo(&rDoc);
-        }
+            rDocImport.setMatrixCells(aRange, *pArray, formula::FormulaGrammar::GRAM_ENGLISH_XL_OOX);
     }
 }
 
diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx
index fe02efa..fb5eadd 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -1578,12 +1578,12 @@ void WorksheetHelper::putRichString( const CellAddress& rAddress, const RichStri
 
 void WorksheetHelper::putFormulaTokens( const CellAddress& rAddress, const ApiTokenSequence& rTokens )
 {
-    ScDocument& rDoc = getScDocument();
+    ScDocumentImport& rDoc = getDocImport();
     ScTokenArray aTokenArray;
     ScAddress aCellPos;
     ScUnoConversion::FillScAddress( aCellPos, rAddress );
-    ScTokenConversion::ConvertToTokenArray( rDoc, aTokenArray, rTokens );
-    getDocImport().setFormulaCell(aCellPos, aTokenArray);
+    ScTokenConversion::ConvertToTokenArray(rDoc.getDoc(), aTokenArray, rTokens);
+    rDoc.setFormulaCell(aCellPos, aTokenArray);
 }
 
 void WorksheetHelper::initializeWorksheetImport()
commit 835fee82efb70b40b94f6babc2706ee1eb66dcf7
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Thu Oct 31 16:25:32 2013 -0400

    Populate raw cell values using ScDocumentImport.
    
    Also fix incorrect const methods. Methods that populate the document
    model should not be marked const even if the compiler allows it.
    
    Change-Id: Ic5d1670ce93c166d0f44ace04494fccab6eac275

diff --git a/sc/inc/tokenuno.hxx b/sc/inc/tokenuno.hxx
index a323b62..4287405 100644
--- a/sc/inc/tokenuno.hxx
+++ b/sc/inc/tokenuno.hxx
@@ -43,7 +43,7 @@ public:
                         ScTokenArray& rTokenArray,
                         const com::sun::star::uno::Sequence< com::sun::star::sheet::FormulaToken >& rSequence );
     static SC_DLLPUBLIC bool ConvertToTokenSequence(
-                        ScDocument& rDoc,
+                        const ScDocument& rDoc,
                         com::sun::star::uno::Sequence< com::sun::star::sheet::FormulaToken >& rSequence,
                         const ScTokenArray& rTokenArray );
 };
diff --git a/sc/source/filter/inc/workbookhelper.hxx b/sc/source/filter/inc/workbookhelper.hxx
index 4db98ce..a905612 100644
--- a/sc/source/filter/inc/workbookhelper.hxx
+++ b/sc/source/filter/inc/workbookhelper.hxx
@@ -149,7 +149,11 @@ public:
     void                useInternalChartDataTable( bool bInternal );
 
     // document model ---------------------------------------------------------
-    ScDocument& getScDocument() const;
+    ScDocument& getScDocument();
+    const ScDocument& getScDocument() const;
+
+    ScDocumentImport& getDocImport();
+
     ScEditEngineDefaulter& getEditEngine() const;
     /** Returns a reference to the source/target spreadsheet document model. */
     ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheetDocument >
diff --git a/sc/source/filter/inc/worksheethelper.hxx b/sc/source/filter/inc/worksheethelper.hxx
index 270cafe..8cda876 100644
--- a/sc/source/filter/inc/worksheethelper.hxx
+++ b/sc/source/filter/inc/worksheethelper.hxx
@@ -281,23 +281,17 @@ public:
     void                setManualRowHeight( sal_Int32 nRow );
 
     /** Inserts a value cell directly into the Calc sheet. */
-    void                putValue(
-                            const ::com::sun::star::table::CellAddress& rAddress,
-                            double fValue ) const;
+    void putValue( const com::sun::star::table::CellAddress& rAddress, double fValue );
 
     /** Inserts a string cell directly into the Calc sheet. */
-    void                putString(
-                            const ::com::sun::star::table::CellAddress& rAddress,
-                            const OUString& rText ) const;
+    void putString( const com::sun::star::table::CellAddress& rAddress, const OUString& rText );
     /** Inserts a rich-string cell directly into the Calc sheet. */
-    void                putRichString(
-                            const ::com::sun::star::table::CellAddress& rAddress,
-                            const RichString& rString,
-                            const Font* pFirstPortionFont ) const;
+    void putRichString(
+        const com::sun::star::table::CellAddress& rAddress,
+        const RichString& rString, const Font* pFirstPortionFont );
     /** Inserts a formula cell directly into the Calc sheet. */
-    void                putFormulaTokens(
-                            const ::com::sun::star::table::CellAddress& rAddress,
-                            const ApiTokenSequence& rTokens ) const;
+    void putFormulaTokens(
+        const com::sun::star::table::CellAddress& rAddress, const ApiTokenSequence& rTokens );
 
     /** Initial conversion before importing the worksheet. */
     void                initializeWorksheetImport();
diff --git a/sc/source/filter/oox/defnamesbuffer.cxx b/sc/source/filter/oox/defnamesbuffer.cxx
index 3c3dd09..94203a8 100644
--- a/sc/source/filter/oox/defnamesbuffer.cxx
+++ b/sc/source/filter/oox/defnamesbuffer.cxx
@@ -458,7 +458,7 @@ bool DefinedName::getAbsoluteRange( CellRangeAddress& orRange ) const
 {
     ScTokenArray* pTokenArray = mpScRangeData->GetCode();
     Sequence< FormulaToken > aFTokenSeq;
-    ScTokenConversion::ConvertToTokenSequence( this->getScDocument(), aFTokenSeq, *pTokenArray );
+    ScTokenConversion::ConvertToTokenSequence(getScDocument(), aFTokenSeq, *pTokenArray);
     return getFormulaParser().extractCellRange( orRange, aFTokenSeq, false );
 }
 
diff --git a/sc/source/filter/oox/numberformatsbuffer.cxx b/sc/source/filter/oox/numberformatsbuffer.cxx
index d6992f5..2b6f271 100644
--- a/sc/source/filter/oox/numberformatsbuffer.cxx
+++ b/sc/source/filter/oox/numberformatsbuffer.cxx
@@ -1936,7 +1936,7 @@ sal_Int32 NumberFormat::finalizeImport( const Reference< XNumberFormats >& rxNum
 
 void NumberFormat::fillToItemSet( SfxItemSet& rItemSet, bool bSkipPoolDefs ) const
 {
-    ScDocument& rDoc = getScDocument();
+    const ScDocument& rDoc = getScDocument();
     static sal_uLong  nDflt = rDoc.GetFormatTable()->GetStandardFormat( ScGlobal::eLnge );
     sal_uLong nScNumFmt = nDflt;
     if ( maApiData.mnIndex )
diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx
index f7fc225..496be44 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -662,7 +662,7 @@ void WorkbookGlobals::finalize()
         //stop preventing establishment of listeners as is done in
         //ScDocShell::AfterXMLLoading() for ods
         getScDocument().SetInsertingFromOtherDoc(false);
-        getScDocument().RebuildFormulaGroups();
+        getDocImport().finalize();
 
         if (mxCLKernelThread.is())
             mxCLKernelThread->join();
@@ -755,11 +755,21 @@ void WorkbookHelper::finalizeWorkbookImport()
 
 // document model -------------------------------------------------------------
 
-ScDocument& WorkbookHelper::getScDocument() const
+ScDocument& WorkbookHelper::getScDocument()
 {
     return mrBookGlob.getScDocument();
 }
 
+const ScDocument& WorkbookHelper::getScDocument() const
+{
+    return mrBookGlob.getScDocument();
+}
+
+ScDocumentImport& WorkbookHelper::getDocImport()
+{
+    return mrBookGlob.getDocImport();
+}
+
 ScEditEngineDefaulter& WorkbookHelper::getEditEngine() const
 {
     return mrBookGlob.getEditEngine();
diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx
index ee8201f..fe02efa 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -69,6 +69,7 @@
 #include "editutil.hxx"
 #include "tokenarray.hxx"
 #include "tablebuffer.hxx"
+#include "documentimport.hxx"
 
 #include <svl/stritem.hxx>
 #include <editeng/editobj.hxx>
@@ -355,11 +356,11 @@ private:
     typedef ::std::list< ValidationModel >              ValidationModelList;
 
     /** Inserts all imported hyperlinks into their cell ranges. */
-    void                finalizeHyperlinkRanges() const;
+    void finalizeHyperlinkRanges();
     /** Generates the final URL for the passed hyperlink. */
     OUString            getHyperlinkUrl( const HyperlinkModel& rHyperlink ) const;
     /** Inserts a hyperlinks into the specified cell. */
-    void                insertHyperlink( const CellAddress& rAddress, const OUString& rUrl ) const;
+    void insertHyperlink( const CellAddress& rAddress, const OUString& rUrl );
 
     /** Inserts all imported data validations into their cell ranges. */
     void                finalizeValidationRanges() const;
@@ -977,7 +978,7 @@ void WorksheetGlobals::finalizeDrawingImport()
 
 // private --------------------------------------------------------------------
 
-void WorksheetGlobals::finalizeHyperlinkRanges() const
+void WorksheetGlobals::finalizeHyperlinkRanges()
 {
     for( HyperlinkModelList::const_iterator aIt = maHyperlinks.begin(), aEnd = maHyperlinks.end(); aIt != aEnd; ++aIt )
     {
@@ -1018,7 +1019,7 @@ OUString WorksheetGlobals::getHyperlinkUrl( const HyperlinkModel& rHyperlink ) c
     return aUrl;
 }
 
-void WorksheetGlobals::insertHyperlink( const CellAddress& rAddress, const OUString& rUrl ) const
+void WorksheetGlobals::insertHyperlink( const CellAddress& rAddress, const OUString& rUrl )
 {
     Reference< XCell > xCell = getCell( rAddress );
     if( xCell.is() ) switch( xCell->getType() )
@@ -1544,11 +1545,11 @@ void WorksheetHelper::setRowModel( const RowModel& rModel )
     mrSheetGlob.setRowModel( rModel );
 }
 
-void WorksheetHelper::putValue( const CellAddress& rAddress, double fValue ) const
+void WorksheetHelper::putValue( const CellAddress& rAddress, double fValue )
 {
     ScAddress aAddress;
     ScUnoConversion::FillScAddress( aAddress, rAddress );
-    getScDocument().SetValue( aAddress.Col(), aAddress.Row(), aAddress.Tab(), fValue );
+    getDocImport().setNumericCell(aAddress, fValue);
 }
 
 void WorksheetHelper::setCellFormulaValue( const ::com::sun::star::table::CellAddress& rAddress,
@@ -1557,34 +1558,32 @@ void WorksheetHelper::setCellFormulaValue( const ::com::sun::star::table::CellAd
     getFormulaBuffer().setCellFormulaValue( rAddress, fValue );
 }
 
-void WorksheetHelper::putString( const CellAddress& rAddress, const OUString& rText ) const
+void WorksheetHelper::putString( const CellAddress& rAddress, const OUString& rText )
 {
     ScAddress aAddress;
     ScUnoConversion::FillScAddress( aAddress, rAddress );
-    ScDocument& rDoc = getScDocument();
     if ( !rText.isEmpty() )
-        rDoc.SetTextCell(aAddress, rText);
+        getDocImport().setStringCell(aAddress, rText);
 }
 
-void WorksheetHelper::putRichString( const CellAddress& rAddress, const RichString& rString, const Font* pFirstPortionFont ) const
+void WorksheetHelper::putRichString( const CellAddress& rAddress, const RichString& rString, const Font* pFirstPortionFont )
 {
-    ScDocument& rDoc = getScDocument();
     ScEditEngineDefaulter& rEE = getEditEngine();
 
     // The cell will own the text object instance returned from convert().
     ScAddress aAddress;
     ScUnoConversion::FillScAddress( aAddress, rAddress );
-    rDoc.SetEditText(aAddress, rString.convert(rEE, pFirstPortionFont));
+    getDocImport().setEditCell(aAddress, rString.convert(rEE, pFirstPortionFont));
 }
 
-void WorksheetHelper::putFormulaTokens( const CellAddress& rAddress, const ApiTokenSequence& rTokens ) const
+void WorksheetHelper::putFormulaTokens( const CellAddress& rAddress, const ApiTokenSequence& rTokens )
 {
     ScDocument& rDoc = getScDocument();
     ScTokenArray aTokenArray;
     ScAddress aCellPos;
     ScUnoConversion::FillScAddress( aCellPos, rAddress );
     ScTokenConversion::ConvertToTokenArray( rDoc, aTokenArray, rTokens );
-    rDoc.SetFormula(aCellPos, aTokenArray);
+    getDocImport().setFormulaCell(aCellPos, aTokenArray);
 }
 
 void WorksheetHelper::initializeWorksheetImport()
diff --git a/sc/source/ui/unoobj/tokenuno.cxx b/sc/source/ui/unoobj/tokenuno.cxx
index 1694981..ff1b417 100644
--- a/sc/source/ui/unoobj/tokenuno.cxx
+++ b/sc/source/ui/unoobj/tokenuno.cxx
@@ -372,7 +372,7 @@ bool ScTokenConversion::ConvertToTokenArray( ScDocument& rDoc,
     return !rTokenArray.Fill(rSequence,rDoc.GetExternalRefManager());
 }
 
-bool ScTokenConversion::ConvertToTokenSequence( ScDocument& rDoc,
+bool ScTokenConversion::ConvertToTokenSequence( const ScDocument& rDoc,
         uno::Sequence<sheet::FormulaToken>& rSequence, const ScTokenArray& rTokenArray )
 {
     bool bError = false;
commit 8228f6736b91da06f439080665bdc389297bb5b7
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Thu Oct 31 14:30:18 2013 -0400

    Set up ScDocumentImport accessor and initialize it.
    
    Also, those createFoo() methods shouldn't be const since it does
    modify the state of the document model.
    
    Change-Id: I6a9267c54710f359506ca39c1e213f82595ebfe3

diff --git a/sc/source/filter/inc/workbookhelper.hxx b/sc/source/filter/inc/workbookhelper.hxx
index 9ea2353..4db98ce 100644
--- a/sc/source/filter/inc/workbookhelper.hxx
+++ b/sc/source/filter/inc/workbookhelper.hxx
@@ -56,6 +56,7 @@ namespace oox { namespace core {
 } }
 
 class ScDocument;
+class ScDocumentImport;
 class ScEditEngineDefaulter;
 
 namespace oox {
diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx
index 9ae6fea..f7fc225 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -72,6 +72,7 @@
 #include "datauno.hxx"
 #include "globalnames.hxx"
 #include "clkernelthread.hxx"
+#include "documentimport.hxx"
 #include "rtl/ref.hxx"
 
 #include "formulabuffer.hxx"
@@ -80,6 +81,7 @@
 #include "editeng/editstat.hxx"
 
 #include <boost/noncopyable.hpp>
+#include <boost/scoped_ptr.hpp>
 
 namespace oox {
 namespace xls {
@@ -147,7 +149,10 @@ public:
         return *mxEditEngine.get();
     }
 
-    ScDocument& getScDocument() const { return *mpDoc; }
+    ScDocument& getScDocument() { return *mpDoc; }
+    const ScDocument& getScDocument() const { return *mpDoc; }
+
+    ScDocumentImport& getDocImport();
 
     /** Returns a reference to the source/target spreadsheet document model. */
     inline Reference< XSpreadsheetDocument > getDocument() const { return mxDoc; }
@@ -156,15 +161,15 @@ public:
     /** Returns the specified cell or page style from the Calc document. */
     Reference< XStyle > getStyleObject( const OUString& rStyleName, bool bPageStyle ) const;
     /** Creates and returns a defined name on-the-fly in the Calc document. */
-    ScRangeData* createNamedRangeObject( OUString& orName, const Sequence< FormulaToken>& rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags ) const;
+    ScRangeData* createNamedRangeObject( OUString& orName, const Sequence< FormulaToken>& rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags );
     /** Creates and returns a defined name on the-fly in the correct Calc sheet. */
-    ScRangeData* createLocalNamedRangeObject( OUString& orName, const Sequence< FormulaToken>& rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags, sal_Int32 nTab ) const;
+    ScRangeData* createLocalNamedRangeObject( OUString& orName, const Sequence< FormulaToken>& rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags, sal_Int32 nTab );
     /** Creates and returns a database range on-the-fly in the Calc document. */
-    Reference< XDatabaseRange > createDatabaseRangeObject( OUString& orName, const CellRangeAddress& rRangeAddr ) const;
+    Reference< XDatabaseRange > createDatabaseRangeObject( OUString& orName, const CellRangeAddress& rRangeAddr );
     /** Creates and returns an unnamed database range on-the-fly in the Calc document. */
-    Reference< XDatabaseRange > createUnnamedDatabaseRangeObject( const CellRangeAddress& rRangeAddr ) const;
+    Reference< XDatabaseRange > createUnnamedDatabaseRangeObject( const CellRangeAddress& rRangeAddr );
     /** Creates and returns a com.sun.star.style.Style object for cells or pages. */
-    Reference< XStyle > createStyleObject( OUString& orStyleName, bool bPageStyle ) const;
+    Reference< XStyle > createStyleObject( OUString& orStyleName, bool bPageStyle );
     /** Helper to switch chart data table - specifically for xlsx imports */
     void useInternalChartDataTable( bool bInternal );
 
@@ -306,6 +311,7 @@ private:
     rtl_TextEncoding    meTextEnc;              /// BIFF byte string text encoding.
     bool                mbHasCodePage;          /// True = CODEPAGE record exists in imported stream.
     ScDocument* mpDoc;
+    boost::scoped_ptr<ScDocumentImport> mxDocImport;
 };
 
 // ----------------------------------------------------------------------------
@@ -329,6 +335,10 @@ WorkbookGlobals::~WorkbookGlobals()
     mrExcelFilter.unregisterWorkbookGlobals();
 }
 
+ScDocumentImport& WorkbookGlobals::getDocImport()
+{
+    return *mxDocImport;
+}
 
 Reference< XNameContainer > WorkbookGlobals::getStyleFamily( bool bPageStyles ) const
 {
@@ -396,7 +406,8 @@ OUString findUnusedName( const ScRangeName* pRangeName, const OUString& rSuggest
 
 }
 
-ScRangeData* WorkbookGlobals::createNamedRangeObject( OUString& orName, const Sequence< FormulaToken>& rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags ) const
+ScRangeData* WorkbookGlobals::createNamedRangeObject(
+    OUString& orName, const Sequence< FormulaToken>& rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags )
 {
     // create the name and insert it into the Calc document
     ScRangeData* pScRangeData = NULL;
@@ -412,7 +423,8 @@ ScRangeData* WorkbookGlobals::createNamedRangeObject( OUString& orName, const Se
     return pScRangeData;
 }
 
-ScRangeData* WorkbookGlobals::createLocalNamedRangeObject( OUString& orName, const Sequence< FormulaToken >&  rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags, sal_Int32 nTab ) const
+ScRangeData* WorkbookGlobals::createLocalNamedRangeObject(
+    OUString& orName, const Sequence< FormulaToken >&  rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags, sal_Int32 nTab )
 {
     // create the name and insert it into the Calc document
     ScRangeData* pScRangeData = NULL;
@@ -428,7 +440,7 @@ ScRangeData* WorkbookGlobals::createLocalNamedRangeObject( OUString& orName, con
     return pScRangeData;
 }
 
-Reference< XDatabaseRange > WorkbookGlobals::createDatabaseRangeObject( OUString& orName, const CellRangeAddress& rRangeAddr ) const
+Reference< XDatabaseRange > WorkbookGlobals::createDatabaseRangeObject( OUString& orName, const CellRangeAddress& rRangeAddr )
 {
     // validate cell range
     CellRangeAddress aDestRange = rRangeAddr;
@@ -453,7 +465,7 @@ Reference< XDatabaseRange > WorkbookGlobals::createDatabaseRangeObject( OUString
     return xDatabaseRange;
 }
 
-Reference< XDatabaseRange > WorkbookGlobals::createUnnamedDatabaseRangeObject( const CellRangeAddress& rRangeAddr ) const
+Reference< XDatabaseRange > WorkbookGlobals::createUnnamedDatabaseRangeObject( const CellRangeAddress& rRangeAddr )
 {
     // validate cell range
     CellRangeAddress aDestRange = rRangeAddr;
@@ -482,7 +494,7 @@ Reference< XDatabaseRange > WorkbookGlobals::createUnnamedDatabaseRangeObject( c
     return xDatabaseRange;
 }
 
-Reference< XStyle > WorkbookGlobals::createStyleObject( OUString& orStyleName, bool bPageStyle ) const
+Reference< XStyle > WorkbookGlobals::createStyleObject( OUString& orStyleName, bool bPageStyle )
 {
     Reference< XStyle > xStyle;
     try
@@ -547,6 +559,8 @@ void WorkbookGlobals::initialize( bool bWorkbookFile )
     if (!mpDoc)
         throw RuntimeException("Workbookhelper::getScDocument(): Failed to access ScDocument from model", Reference<XInterface>());
 
+    mxDocImport.reset(new ScDocumentImport(*mpDoc));
+
     mxFormulaBuffer.reset( new FormulaBuffer( *this ) );
     mxWorkbookSettings.reset( new WorkbookSettings( *this ) );
     mxViewSettings.reset( new ViewSettings( *this ) );
commit a25d360b3e08751ea24f1c5ae4dea799d38a668b
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Nov 4 18:24:25 2013 +0100

    Try make this more robust in slow environments
    
    ...where the previous .uno:PrintPreview request has not yet been processed, the
    same way it had been made more robust for ScAccessiblePageHeader.java in
    5b5c52a3a4d048bba8c18dfb06ffca25c670d099 "Try make this more robust in slow
    environments" plus b5dd2b4218f966e177d880bcc29fa5fba3bfe1c1 "Also cope with
    intermittend DisposedExceptions."
    
    Change-Id: I5244e8f8af9560ae986ed3a836bdf9571574420f

diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewTable.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewTable.java
index 7b93d27..9f5b3b0 100644
--- a/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewTable.java
+++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePreviewTable.java
@@ -39,6 +39,7 @@ import com.sun.star.frame.XController;
 import com.sun.star.frame.XDispatch;
 import com.sun.star.frame.XDispatchProvider;
 import com.sun.star.frame.XModel;
+import com.sun.star.lang.DisposedException;
 import com.sun.star.lang.XComponent;
 import com.sun.star.lang.XMultiServiceFactory;
 import com.sun.star.sheet.XSpreadsheet;
@@ -113,7 +114,6 @@ public class ScAccessiblePreviewTable extends TestCase {
      */
     protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
 
-        XInterface oObj = null;
         XCell xCell = null;
 
         try {
@@ -163,16 +163,34 @@ public class ScAccessiblePreviewTable extends TestCase {
             throw new StatusException(Status.failed("Couldn't change mode"));
         }
 
-        shortWait();
-
-        AccessibilityTools at = new AccessibilityTools();
-
-        XWindow xWindow = AccessibilityTools.getCurrentContainerWindow((XMultiServiceFactory)Param.getMSF(), xModel);
-        XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow);
-
-        AccessibilityTools.printAccessibleTree(log,xRoot, Param.getBool(PropertyName.DEBUG_IS_ACTIVE));
-
-        oObj = AccessibilityTools.getAccessibleObjectForRole(xRoot, AccessibleRole.TABLE);
+        XAccessible xRoot;
+        XInterface oObj;
+        for (int i = 0;; ++i) {
+            try {
+                Thread.sleep(500);
+            } catch (InterruptedException e) {
+                throw new RuntimeException(e);
+            }
+            try {
+                xRoot = AccessibilityTools.getAccessibleObject(
+                    AccessibilityTools.getCurrentContainerWindow(
+                        (XMultiServiceFactory)Param.getMSF(), xModel));
+                if (xRoot != null) {
+                    oObj = AccessibilityTools.getAccessibleObjectForRole(
+                        xRoot, AccessibleRole.TABLE);
+                    if (oObj != null) {
+                        break;
+                    }
+                }
+            } catch (DisposedException e) {
+                log.println("Ignoring DisposedException");
+            }
+            if (i == 20) { // give up after 10 sec
+                throw new RuntimeException(
+                    "Couldn't get AccessibleRole.TABLE/PUSH_BUTTON object");
+            }
+            log.println("No TABLE/PUSH_BUTTON found yet, retrying");
+        }
 
         log.println("ImplementationName " + utils.getImplName(oObj));
 
@@ -195,12 +213,4 @@ public class ScAccessiblePreviewTable extends TestCase {
 
         return tEnv;
     }
-
-    protected void shortWait() {
-        try {
-            Thread.sleep(1000) ;
-        } catch (InterruptedException e) {
-            System.out.println("While waiting :" + e);
-        }
-    }
 }
commit e362bc7892e0fd193e541838be4bd26b7ff42fdd
Author: Winfried Donkers <winfrieddonkers at libreoffice.org>
Date:   Fri Nov 1 20:29:06 2013 +0100

    fdo#71081 add Excel 2010 functions BINOM.DIST and BINOM.INV
    
    Change-Id: Iaecccd9ec6ab6a08c6c7ee8c024a3eba48ca1682
    Reviewed-on: https://gerrit.libreoffice.org/6521
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/formula/source/core/resource/core_resource.src b/formula/source/core/resource/core_resource.src
index 8f49229..3843d25 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -196,6 +196,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
     String SC_OPCODE_NORM_DIST { Text = "NORMDIST" ; };
     String SC_OPCODE_EXP_DIST { Text = "EXPONDIST" ; };
     String SC_OPCODE_BINOM_DIST { Text = "BINOMDIST" ; };
+    String SC_OPCODE_BINOM_DIST_MS { Text = "COM.MICROSOFT.BINOM.DIST" ; };
     String SC_OPCODE_POISSON_DIST { Text = "POISSON" ; };
     String SC_OPCODE_KOMBIN { Text = "COMBIN" ; };
     String SC_OPCODE_KOMBIN_2 { Text = "COMBINA" ; };
@@ -287,6 +288,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
     String SC_OPCODE_WEIBULL { Text = "WEIBULL" ; };
     String SC_OPCODE_NEG_BINOM_VERT { Text = "NEGBINOMDIST" ; };
     String SC_OPCODE_KRIT_BINOM { Text = "CRITBINOM" ; };
+    String SC_OPCODE_BINOM_INV { Text = "COM.MICROSOFT.BINOM.INV" ; };
     String SC_OPCODE_KURT { Text = "KURT" ; };
     String SC_OPCODE_HAR_MEAN { Text = "HARMEAN" ; };
     String SC_OPCODE_GEO_MEAN { Text = "GEOMEAN" ; };
@@ -552,6 +554,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
     String SC_OPCODE_NORM_DIST { Text = "NORMDIST" ; };
     String SC_OPCODE_EXP_DIST { Text = "EXPONDIST" ; };
     String SC_OPCODE_BINOM_DIST { Text = "BINOMDIST" ; };
+    String SC_OPCODE_BINOM_DIST_MS { Text = "BINOM.DIST" ; };
     String SC_OPCODE_POISSON_DIST { Text = "POISSON" ; };
     String SC_OPCODE_KOMBIN { Text = "COMBIN" ; };
     String SC_OPCODE_KOMBIN_2 { Text = "COMBINA" ; };
@@ -643,6 +646,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
     String SC_OPCODE_WEIBULL { Text = "WEIBULL" ; };
     String SC_OPCODE_NEG_BINOM_VERT { Text = "NEGBINOMDIST" ; };
     String SC_OPCODE_KRIT_BINOM { Text = "CRITBINOM" ; };
+    String SC_OPCODE_BINOM_INV { Text = "BINOM.INV" ; };
     String SC_OPCODE_KURT { Text = "KURT" ; };
     String SC_OPCODE_HAR_MEAN { Text = "HARMEAN" ; };
     String SC_OPCODE_GEO_MEAN { Text = "GEOMEAN" ; };
@@ -1351,6 +1355,10 @@ Resource RID_STRLIST_FUNCTION_NAMES
     {
         Text [ en-US ] = "BINOMDIST" ;
     };
+    String SC_OPCODE_BINOM_DIST_MS
+    {
+        Text [ en-US ] = "BINOM.DIST" ;
+    };
     String SC_OPCODE_POISSON_DIST
     {
         Text [ en-US ] = "POISSON" ;
@@ -1716,6 +1724,10 @@ Resource RID_STRLIST_FUNCTION_NAMES
     {
         Text [ en-US ] = "CRITBINOM" ;
     };
+    String SC_OPCODE_BINOM_INV
+    {
+        Text [ en-US ] = "BINOM.INV" ;
+    };
     String SC_OPCODE_KURT
     {
         Text [ en-US ] = "KURT" ;
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index d8c45b2..323d540 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -416,8 +416,10 @@
 #define SC_OPCODE_VAR_S             418
 #define SC_OPCODE_BETA_DIST_MS      419
 #define SC_OPCODE_BETA_INV_MS       420
+#define SC_OPCODE_BINOM_DIST_MS     421
+#define SC_OPCODE_BINOM_INV         422
 
-#define SC_OPCODE_STOP_2_PAR        421     /* last function with two or more parameters' OpCode + 1 */
+#define SC_OPCODE_STOP_2_PAR        423     /* last function with two or more parameters' OpCode + 1 */
 #define SC_OPCODE_STOP_FUNCTION     SC_OPCODE_STOP_2_PAR            /* last function's OpCode + 1 */
 #define SC_OPCODE_LAST_OPCODE_ID    (SC_OPCODE_STOP_FUNCTION - 1)   /* last OpCode */
 
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index 5d96e07..3c14bae 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -230,6 +230,8 @@ enum OpCodeEnum
         ocNormDist          = SC_OPCODE_NORM_DIST,
         ocExpDist           = SC_OPCODE_EXP_DIST,
         ocBinomDist         = SC_OPCODE_BINOM_DIST,
+        ocBinomDist_MS      = SC_OPCODE_BINOM_DIST_MS,
+        ocBinomInv          = SC_OPCODE_BINOM_INV,
         ocPoissonDist       = SC_OPCODE_POISSON_DIST,
         ocKombin            = SC_OPCODE_KOMBIN,
         ocKombin2           = SC_OPCODE_KOMBIN_2,
diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h
index 820086e..12c39d6 100644
--- a/sc/inc/helpids.h
+++ b/sc/inc/helpids.h
@@ -686,5 +686,7 @@
 #define HID_FUNC_VAR_S                                          "SC_HID_FUNC_VAR_S"
 #define HID_FUNC_BETADIST_MS                                    "SC_HID_FUNC_BETADIST_MS"
 #define HID_FUNC_BETAINV_MS                                     "SC_HID_FUNC_BETAINV_MS"
+#define HID_FUNC_BINOM_DIST_MS                                  "SC_HID_FUNC_BINOM_DIST_MS"
+#define HID_FUNC_BINOM_INV_MS                                   "SC_HID_FUNC_BINOM_INV_MS"
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index b5de6a5..0b34f81 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -2361,6 +2361,8 @@ void Test::testFunctionLists()
         "BETA.INV",
         "BETADIST",
         "BETAINV",
+        "BINOM.DIST",
+        "BINOM.INV",
         "BINOMDIST",
         "CHIDIST",
         "CHIINV",
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 97db18c..35488e5 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -4100,7 +4100,8 @@ StackVar ScInterpreter::Interpret()
                 case ocB                : ScB();                        break;
                 case ocNormDist         : ScNormDist();                 break;
                 case ocExpDist          : ScExpDist();                  break;
-                case ocBinomDist        : ScBinomDist();                break;
+                case ocBinomDist        :
+                case ocBinomDist_MS     : ScBinomDist();                break;
                 case ocPoissonDist      : ScPoissonDist();              break;
                 case ocKombin           : ScKombin();                   break;
                 case ocKombin2          : ScKombin2();                  break;
@@ -4123,6 +4124,7 @@ StackVar ScInterpreter::Interpret()
                 case ocGeoMean          : ScGeoMean();                  break;
                 case ocHarMean          : ScHarMean();                  break;
                 case ocWeibull          : ScWeibull();                  break;
+                case ocBinomInv         :
                 case ocKritBinom        : ScCritBinom();                break;
                 case ocNegBinomVert     : ScNegBinomDist();             break;
                 case ocNoName           : ScNoName();                   break;
diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx
index 78c4438..10cc2fe 100644
--- a/sc/source/filter/excel/xlformula.cxx
+++ b/sc/source/filter/excel/xlformula.cxx
@@ -436,7 +436,9 @@ static const XclFunctionInfo saFuncTable_2010[] =
     EXC_FUNCENTRY_V_RX(         ocVarP_MS,       1, MX,  0,  "VAR.P" ),
     EXC_FUNCENTRY_V_RX(         ocVarS,          1, MX,  0,  "VAR.S" ),
     EXC_FUNCENTRY_V_VR(         ocBetaDist_MS,   4,  6,  0,  "BETA.DIST" ),
-    EXC_FUNCENTRY_V_VR(         ocBetaInv_MS,    3,  5,  0,  "BETA.INV" )
+    EXC_FUNCENTRY_V_VR(         ocBetaInv_MS,    3,  5,  0,  "BETA.INV" ),
+    EXC_FUNCENTRY_V_VR(         ocBinomDist_MS,  4,  4,  0,  "BINOM.DIST" ),
+    EXC_FUNCENTRY_V_VR(         ocBinomInv,      3,  3,  0,  "BINOM.INV" )
 };
 
 /** Functions new in Excel 2013.
diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx
index 146f332..e5bd94c 100644
--- a/sc/source/filter/oox/formulabase.cxx
+++ b/sc/source/filter/oox/formulabase.cxx
@@ -754,7 +754,9 @@ static const FunctionData saFuncTable2010[] =
     { "COM.MICROSOFT.VAR.P",                  "VAR.P"  ,             NOID,    NOID,   1, MX,  V, { RX }, FUNCFLAG_MACROCALL_NEW },
     { "COM.MICROSOFT.VAR.S",                  "VAR.S",               NOID,    NOID,   1, MX,  V, { RX }, FUNCFLAG_MACROCALL_NEW },
     { "COM.MICROSOFT.BETA.DIST",              "BETA.DIST"  ,         NOID,    NOID,   4,  6,  V, { VR }, FUNCFLAG_MACROCALL_NEW },
-    { "COM.MICROSOFT.BETA.INV",               "BETA.INV",            NOID,    NOID,   3,  5,  V, { VR }, FUNCFLAG_MACROCALL_NEW }
+    { "COM.MICROSOFT.BETA.INV",               "BETA.INV",            NOID,    NOID,   3,  5,  V, { VR }, FUNCFLAG_MACROCALL_NEW },
+    { "COM.MICROSOFT.BINOM.DIST",             "BINOM.DIST",          NOID,    NOID,   4,  4,  V, { VR }, FUNCFLAG_MACROCALL_NEW },
+    { "COM.MICROSOFT.BINOM.INV",              "BINOM.INV",           NOID,    NOID,   3,  3,  V, { VR }, FUNCFLAG_MACROCALL_NEW }
 };
 
 /** Functions new in Excel 2013.
diff --git a/sc/source/ui/src/scfuncs.src b/sc/source/ui/src/scfuncs.src
index 18b6b79..b686082 100644
--- a/sc/source/ui/src/scfuncs.src
+++ b/sc/source/ui/src/scfuncs.src
@@ -6087,6 +6087,54 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2
             Text [ en-US ] = "Cumulated. C=0 calculates the individual probability, C=1 the cumulated probability." ;
         };
     };
+     // -=*# Resource for function BINOM.DIST #*=-
+    Resource SC_OPCODE_BINOM_DIST_MS
+    {
+        String 1 // Description
+        {
+            Text [ en-US ] = "Values of the binomial distribution." ;
+        };
+        ExtraData =
+        {
+            0;
+            ID_FUNCTION_GRP_STATISTIC;
+            U2S( HID_FUNC_BINOM_DIST_MS );
+            4;  0;  0;  0;  0;
+            0;
+        };
+        String 2 // Name of Parameter 1
+        {
+            Text [ en-US ] = "X" ;
+        };
+        String 3 // Description of Parameter 1
+        {
+            Text [ en-US ] = "The number of successes in a series of trials." ;
+        };
+        String 4 // Name of Parameter 2
+        {
+            Text [ en-US ] = "trials" ;
+        };
+        String 5 // Description of Parameter 2
+        {
+            Text [ en-US ] = "The total number of trials." ;
+        };
+        String 6 // Name of Parameter 3
+        {
+            Text [ en-US ] = "SP" ;
+        };
+        String 7 // Description of Parameter 3
+        {
+            Text [ en-US ] = "The success probability of a trial." ;
+        };
+        String 8 // Name of Parameter 4
+        {
+            Text [ en-US ] = "C" ;
+        };
+        String 9 // Description of Parameter 4
+        {
+            Text [ en-US ] = "Cumulated. C=0 calculates the individual probability, C=1 the cumulated probability." ;
+        };
+    };
      // -=*# Resource for function NEGBINOMVERT #*=-
     Resource SC_OPCODE_NEG_BINOM_VERT
     {
@@ -6167,6 +6215,46 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2
             Text [ en-US ] = "The border probability that is attained or exceeded." ;
         };
     };
+     // -=*# Resource for function BINOM.INV #*=-
+    Resource SC_OPCODE_BINOM_INV
+    {
+        String 1 // Description
+        {
+            Text [ en-US ] = "Border arguments of the binomial distribution." ;
+        };
+        ExtraData =
+        {
+            0;
+            ID_FUNCTION_GRP_STATISTIC;
+            U2S( HID_FUNC_BINOM_INV_MS );
+            3;  0;  0;  0;
+            0;
+        };
+        String 2 // Name of Parameter 1
+        {
+            Text [ en-US ] = "trials" ;
+        };
+        String 3 // Description of Parameter 1
+        {
+            Text [ en-US ] = "The total number of trials." ;
+        };
+        String 4 // Name of Parameter 2
+        {
+            Text [ en-US ] = "SP" ;
+        };
+        String 5 // Description of Parameter 2
+        {
+            Text [ en-US ] = "The success probability of a trial." ;
+        };
+        String 6 // Name of Parameter 3
+        {
+            Text [ en-US ] = "alpha" ;
+        };
+        String 7 // Description of Parameter 3
+        {
+            Text [ en-US ] = "The border probability that is attained or exceeded." ;
+        };
+    };
      // -=*# Resource for function POISSON #*=-
     Resource SC_OPCODE_POISSON_DIST
     {
commit 4bfa4a69a89337f1839a310a2fe83caf82e37df5
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Nov 4 17:09:06 2013 +0100

    DOCX filter: handle CT_Ind_rightChars and CT_PPrBase_snapToGrid
    
    Also, add InteropGrabBag support to bCs, themeFill, themeFillShade and
    w:ind's right attribute.
    
    Change-Id: I0d6ad0ef062218e71d7c71f99c56dd680b6930de

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index ed0b000..91dd026 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -1349,6 +1349,14 @@ DECLARE_OOXML_TEST(testQuicktables, "quicktables.docx")
     assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar3']/w:rPr/w:rFonts", "cstheme", "majorBidi");
     assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar3']/w:rPr/w:color", "themeTint", "80");
     CPPUNIT_ASSERT(getXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar3']/w:tblStylePr[@w:type='firstRow']/w:rPr/w:color", "themeShade").equalsIgnoreAsciiCase("BF"));
+
+    // Calendar4.
+    assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar4']/w:pPr/w:snapToGrid", "val", "0");
+    assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar4']/w:rPr/w:bCs", 1);
+    assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar4']/w:tcPr/w:shd", "themeFill", "accent1");
+    assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar4']/w:tcPr/w:shd", "themeFillShade", "80");
+    assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar4']/w:tblStylePr[@w:type='firstCol']/w:pPr/w:ind", "rightChars", "0");
+    assertXPath(pXmlStyles, "/w:styles/w:style[@w:styleId='Calendar4']/w:tblStylePr[@w:type='firstCol']/w:pPr/w:ind", "right", "144");
 }
 
 DECLARE_OOXML_TEST(testSmartart, "smartart.docx")
diff --git a/sw/source/filter/ww8/docxtablestyleexport.cxx b/sw/source/filter/ww8/docxtablestyleexport.cxx
index 8e468f0..8a1510d 100644
--- a/sw/source/filter/ww8/docxtablestyleexport.cxx
+++ b/sw/source/filter/ww8/docxtablestyleexport.cxx
@@ -158,6 +158,10 @@ void lcl_TableStyleShd(sax_fastparser::FSHelperPtr pSerializer, uno::Sequence<be
             pAttributeList->add(FSNS(XML_w, XML_color), msfilter::util::ConvertColor(rShd[i].Value.get<sal_Int32>(), /*bAutoColor =*/ true));
         else if (rShd[i].Name == "fill")
             pAttributeList->add(FSNS(XML_w, XML_fill), msfilter::util::ConvertColor(rShd[i].Value.get<sal_Int32>(), /*bAutoColor =*/ true));
+        else if (rShd[i].Name == "themeFill")
+            pAttributeList->add(FSNS(XML_w, XML_themeFill), OUStringToOString(rShd[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
+        else if (rShd[i].Name == "themeFillShade")
+            pAttributeList->add(FSNS(XML_w, XML_themeFillShade), OUStringToOString(rShd[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
     }
     sax_fastparser::XFastAttributeListRef xAttributeList(pAttributeList);
     pSerializer->singleElementNS(XML_w, XML_shd, xAttributeList);
@@ -255,6 +259,24 @@ void lcl_TableStylePSpacing(sax_fastparser::FSHelperPtr pSerializer, uno::Sequen
     pSerializer->singleElementNS(XML_w, XML_spacing, xAttributeList);
 }
 
+/// Export of w:ind in a table style's pPr.
+void lcl_TableStylePInd(sax_fastparser::FSHelperPtr pSerializer, uno::Sequence<beans::PropertyValue>& rInd)
+{
+    if (!rInd.hasElements())
+        return;
+
+    sax_fastparser::FastAttributeList* pAttributeList = pSerializer->createAttrList();
+    for (sal_Int32 i = 0; i < rInd.getLength(); ++i)
+    {
+        if (rInd[i].Name == "rightChars")
+            pAttributeList->add(FSNS(XML_w, XML_rightChars), OUStringToOString(rInd[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
+        else if (rInd[i].Name == "right")
+            pAttributeList->add(FSNS(XML_w, XML_right), OUStringToOString(rInd[i].Value.get<OUString>(), RTL_TEXTENCODING_UTF8).getStr());
+    }
+    sax_fastparser::XFastAttributeListRef xAttributeList(pAttributeList);
+    pSerializer->singleElementNS(XML_w, XML_ind, xAttributeList);
+}
+
 /// Export of w:tblInd in a table style.
 void lcl_TableStyleTblInd(sax_fastparser::FSHelperPtr pSerializer, uno::Sequence<beans::PropertyValue>& rTblInd)
 {
@@ -293,7 +315,7 @@ void lcl_TableStyleRPr(sax_fastparser::FSHelperPtr pSerializer, uno::Sequence<be
     pSerializer->startElementNS(XML_w, XML_rPr, FSEND);
 
     uno::Sequence<beans::PropertyValue> aRFonts, aLang, aColor;
-    OUString aB, aI, aSz, aSzCs, aCaps, aSmallCaps, aSpacing;
+    OUString aB, aBCs, aI, aSz, aSzCs, aCaps, aSmallCaps, aSpacing;
     for (sal_Int32 i = 0; i < rRPr.getLength(); ++i)
     {
         if (rRPr[i].Name == "rFonts")
@@ -302,6 +324,8 @@ void lcl_TableStyleRPr(sax_fastparser::FSHelperPtr pSerializer, uno::Sequence<be
             aLang = rRPr[i].Value.get< uno::Sequence<beans::PropertyValue> >();
         else if (rRPr[i].Name == "b")
             aB = rRPr[i].Value.get<OUString>();
+        else if (rRPr[i].Name == "bCs")
+            aBCs = rRPr[i].Value.get<OUString>();
         else if (rRPr[i].Name == "i")
             aI = rRPr[i].Value.get<OUString>();
         else if (rRPr[i].Name == "color")
@@ -320,6 +344,7 @@ void lcl_TableStyleRPr(sax_fastparser::FSHelperPtr pSerializer, uno::Sequence<be
     lcl_TableStyleRRFonts(pSerializer, aRFonts);
     lcl_TableStyleRLang(pSerializer, aLang);
     lcl_handleBoolean(aB, XML_b, pSerializer);
+    lcl_handleBoolean(aBCs, XML_bCs, pSerializer);
     lcl_handleBoolean(aI, XML_i, pSerializer);
     lcl_handleBoolean(aCaps, XML_caps, pSerializer);
     lcl_handleBoolean(aSmallCaps, XML_smallCaps, pSerializer);
@@ -348,20 +373,26 @@ void lcl_TableStylePPr(sax_fastparser::FSHelperPtr pSerializer, uno::Sequence<be
 
     pSerializer->startElementNS(XML_w, XML_pPr, FSEND);
 
-    uno::Sequence<beans::PropertyValue> aSpacing;
+    uno::Sequence<beans::PropertyValue> aSpacing, aInd;
     bool bWordWrap = false;
-    OUString aJc;
+    OUString aJc, aSnapToGrid;
     for (sal_Int32 i = 0; i < rPPr.getLength(); ++i)
     {
         if (rPPr[i].Name == "spacing")
             aSpacing = rPPr[i].Value.get< uno::Sequence<beans::PropertyValue> >();
+        else if (rPPr[i].Name == "ind")
+            aInd = rPPr[i].Value.get< uno::Sequence<beans::PropertyValue> >();
         else if (rPPr[i].Name == "wordWrap")
             bWordWrap = true;
         else if (rPPr[i].Name == "jc")
             aJc = rPPr[i].Value.get<OUString>();
+        else if (rPPr[i].Name == "snapToGrid")
+            aSnapToGrid = rPPr[i].Value.get<OUString>();
     }
     if (bWordWrap)
         pSerializer->singleElementNS(XML_w, XML_wordWrap, FSEND);
+    lcl_TableStylePInd(pSerializer, aInd);
+    lcl_handleBoolean(aSnapToGrid, XML_snapToGrid, pSerializer);
     lcl_TableStylePSpacing(pSerializer, aSpacing);
     if (!aJc.isEmpty())
         pSerializer->singleElementNS(XML_w, XML_jc,
diff --git a/writerfilter/source/dmapper/CellColorHandler.cxx b/writerfilter/source/dmapper/CellColorHandler.cxx
index 09f020f..8aac72d 100644
--- a/writerfilter/source/dmapper/CellColorHandler.cxx
+++ b/writerfilter/source/dmapper/CellColorHandler.cxx
@@ -20,6 +20,7 @@
 #include <PropertyMap.hxx>
 #include <doctok/resourceids.hxx>
 #include <ConversionHelper.hxx>
+#include <TDefTableHandler.hxx>
 #include <ooxml/resourceids.hxx>
 #include <com/sun/star/drawing/ShadingPattern.hpp>
 #include <sal/macros.h>
@@ -129,8 +130,12 @@ void CellColorHandler::lcl_attribute(Id rName, Value & rVal)
             m_nColor = nIntValue;
         break;
         case NS_ooxml::LN_CT_Shd_themeFill:
-        case NS_ooxml::LN_CT_Shd_themeFillTint:
+            createGrabBag("themeFill", uno::makeAny(TDefTableHandler::getThemeColorTypeString(nIntValue)));
+        break;
         case NS_ooxml::LN_CT_Shd_themeFillShade:
+            createGrabBag("themeFillShade", uno::makeAny(OUString::number(nIntValue, 16)));
+        break;
+        case NS_ooxml::LN_CT_Shd_themeFillTint:
             // ignored
             break;
         default:
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 9a6488f..4f9d233 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1082,6 +1082,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
                 m_pImpl->GetTopContext()->Insert(
                     PROP_PARA_RIGHT_MARGIN, uno::makeAny( ConversionHelper::convertTwipToMM100(nIntValue ) ));
             }
+            m_pImpl->appendGrabBag(m_pImpl->m_aSubInteropGrabBag, "right", OUString::number(nIntValue));
             break;
         case NS_ooxml::LN_CT_Ind_hanging:
             if (m_pImpl->GetTopContext())
@@ -1096,6 +1097,9 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
                 m_pImpl->GetTopContext()->Insert(
                     PROP_PARA_FIRST_LINE_INDENT, uno::makeAny( ConversionHelper::convertTwipToMM100(nIntValue ) ));
             break;
+        case NS_ooxml::LN_CT_Ind_rightChars:
+            m_pImpl->appendGrabBag(m_pImpl->m_aSubInteropGrabBag, "rightChars", OUString::number(nIntValue));
+            break;
 
         case NS_ooxml::LN_CT_EastAsianLayout_id:
             break;
@@ -2172,6 +2176,8 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
                             xCharStyle->setPropertyValue(rPropNameSupplier.GetName(PROP_CHAR_WEIGHT), aBold);
                         if (nSprmId == NS_sprm::LN_CFBold)
                             m_pImpl->appendGrabBag(m_pImpl->m_aInteropGrabBag, "b", OUString::number(nIntValue));
+                        else if (nSprmId == NS_sprm::LN_CFBoldBi)
+                            m_pImpl->appendGrabBag(m_pImpl->m_aInteropGrabBag, "bCs", OUString::number(nIntValue));
                     }
                     break;
                     case 61: /*sprmCFItalic*/
@@ -3033,6 +3039,8 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
             m_pImpl->appendGrabBag(m_pImpl->m_aInteropGrabBag, "lang", m_pImpl->m_aSubInteropGrabBag);
         else if (nSprmId == NS_ooxml::LN_EG_RPrBase_color)
             m_pImpl->appendGrabBag(m_pImpl->m_aInteropGrabBag, "color", m_pImpl->m_aSubInteropGrabBag);
+        else if (nSprmId == NS_ooxml::LN_CT_PPrBase_ind)
+            m_pImpl->appendGrabBag(m_pImpl->m_aInteropGrabBag, "ind", m_pImpl->m_aSubInteropGrabBag);
     break;
     case NS_ooxml::LN_CT_PPrBase_wordWrap:
         m_pImpl->appendGrabBag(m_pImpl->m_aInteropGrabBag, "wordWrap", "");
@@ -3178,6 +3186,9 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
     }
     break;
 
+    case NS_ooxml::LN_CT_PPrBase_snapToGrid:
+        m_pImpl->appendGrabBag(m_pImpl->m_aInteropGrabBag, "snapToGrid", OUString::number(nIntValue));
+    break;
     case NS_ooxml::LN_CT_PPrBase_pStyle:
     {
         mbIsBIDI = false;
commit 46a470a2ca10721dbaab7867bf4929da4b9d99a0
Author: Matúš Kukan <matus.kukan at gmail.com>
Date:   Thu Oct 31 15:08:14 2013 +0100

    cui: remove unused .map file
    
    Change-Id: Ib7a040c48d8f35e8bd68a30e7b5219a7499ec8da

diff --git a/cui/util/cui.map b/cui/util/cui.map
deleted file mode 100644
index f8eb4bb0..0000000
--- a/cui/util/cui.map
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# 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/.
-#
-# This file incorporates work covered by the following license notice:
-#
-#   Licensed to the Apache Software Foundation (ASF) under one or more
-#   contributor license agreements. See the NOTICE file distributed
-#   with this work for additional information regarding copyright
-#   ownership. The ASF licenses this file to you under the Apache
-#   License, Version 2.0 (the "License"); you may not use this file
-#   except in compliance with the License. You may obtain a copy of
-#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-UDK_3_0_0 {
-    global:
-        CreateDialogFactory;
-        GetSpecialCharsForEdit;
-        cui_component_getFactory;
-    local:
-        *;
-};
commit 659bc507925aadc189495e59d58cffb882dba381
Author: Winfried Donkers <winfrieddonkers at libreoffice.org>
Date:   Sat Nov 2 16:52:26 2013 +0100

    fdo#71128 arguments of calc function MMULT have same name
    
    Arguments 1 and 2 of MMULT have the same name in the function
    wizard, which is both confusing for the user and inconstent
    with other argument names for matrix functions.
    Patch simply changes the names to match the description of
    the arguments of MMULT.
    
    Change-Id: I9fc35907133aa61248182bd3b253a7f90ba7cd2c
    Reviewed-on: https://gerrit.libreoffice.org/6526
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/source/ui/src/scfuncs.src b/sc/source/ui/src/scfuncs.src
index 0ee26ce..18b6b79 100644
--- a/sc/source/ui/src/scfuncs.src
+++ b/sc/source/ui/src/scfuncs.src
@@ -4484,7 +4484,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS1
         };
         String 2 // Name of Parameter 1
         {
-            Text [ en-US ] = "array" ;
+            Text [ en-US ] = "array_1" ;
         };
         String 3 // Description of Parameter 1
         {
@@ -4492,7 +4492,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS1
         };
         String 4 // Name of Parameter 2
         {
-            Text [ en-US ] = "array" ;
+            Text [ en-US ] = "array_2" ;
         };
         String 5 // Description of Parameter 2
         {
commit 7e4f8eb5eff642c7fc8bfa665289d55a1c5b054b
Author: Eilidh McAdam <eilidh at lanedo.com>
Date:   Sat Nov 2 20:35:44 2013 +0000

    fdo#40788: Allow manual breaks in Calc to be forced
    
    If the scale settings specify that the print ranges must be scaled
    across a specific number of pages, the default behaviour is to ignore
    breaks to avoid the case where breaks force more pages than specified.
    Here, an option under Calc -> Print -> Pages is added so that the user
    can specify that manual row and column breaks should be forced.
    
    Change-Id: I445cd7ce9e16e4ec2d0c320f059edad62b40f22d
    Reviewed-on: https://gerrit.libreoffice.org/6531
    Tested-by: Eike Rathke <erack at redhat.com>
    Reviewed-by: Eike Rathke <erack at redhat.com>

diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
index 4c583a4..0cdb9d5 100644

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list