[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - 46 commits - configure.ac cppcanvas/source desktop/source download.lst embeddedobj/Library_emboleobj.mk embeddedobj/source external/libetonyek external/liblangtag external/openssl extras/CustomTarget_autocorr.mk extras/Package_autocorr.mk filter/source formula/source i18nlangtag/qa i18npool/source include/formula include/sfx2 Makefile.fetch officecfg/registry reportdesign/source sc/inc sc/source sd/qa sd/source sfx2/source slideshow/source smoketest/data svgio/source svx/source sw/qa sw/source vcl/source writerfilter/source xmloff/source

Zolnai Tamás tamas.zolnai at collabora.com
Wed Apr 16 08:08:10 PDT 2014


 Makefile.fetch                                                                                        |    1 
 configure.ac                                                                                          |   11 
 cppcanvas/source/mtfrenderer/emfplus.cxx                                                              |   24 +
 desktop/source/lib/init.cxx                                                                           |    1 
 download.lst                                                                                          |    6 
 embeddedobj/Library_emboleobj.mk                                                                      |    1 
 embeddedobj/source/msole/graphconvert.cxx                                                             |   12 
 external/libetonyek/0001-Comma-at-the-end-of-emum-list.patch.1                                        |   26 -
 external/libetonyek/UnpackedTarball_libetonyek.mk                                                     |    4 
 external/liblangtag/ExternalProject_langtag.mk                                                        |    2 
 external/liblangtag/UnpackedTarball_langtag.mk                                                        |    5 
 external/liblangtag/liblangtag-0.5.1-include-last-record-in-language-subtag-registry.patch            |   49 ++
 external/openssl/CVE-2014-0160.patch                                                                  |  108 ++++++
 external/openssl/UnpackedTarball_openssl.mk                                                           |    1 
 extras/CustomTarget_autocorr.mk                                                                       |    2 
 extras/Package_autocorr.mk                                                                            |    2 
 filter/source/config/fragments/filters/StarOffice_XML__Base_.xcu                                      |    2 
 filter/source/config/fragments/filters/StarOffice_XML__Calc_.xcu                                      |    2 
 filter/source/config/fragments/filters/StarOffice_XML__Chart_.xcu                                     |    2 
 filter/source/config/fragments/filters/StarOffice_XML__Draw_.xcu                                      |    2 
 filter/source/config/fragments/filters/StarOffice_XML__Impress_.xcu                                   |    2 
 filter/source/config/fragments/filters/StarOffice_XML__Math_.xcu                                      |    2 
 filter/source/config/fragments/filters/StarOffice_XML__Writer_.xcu                                    |    2 
 filter/source/config/fragments/filters/calc_StarOffice_XML_Calc_Template.xcu                          |    2 
 filter/source/config/fragments/filters/draw_StarOffice_XML_Draw_Template.xcu                          |    2 
 filter/source/config/fragments/filters/impress_StarOffice_XML_Draw.xcu                                |    2 
 filter/source/config/fragments/filters/impress_StarOffice_XML_Impress_Template.xcu                    |    2 
 filter/source/config/fragments/filters/writer_StarOffice_XML_Writer_Template.xcu                      |    2 
 filter/source/config/fragments/filters/writer_globaldocument_StarOffice_XML_Writer.xcu                |    2 
 filter/source/config/fragments/filters/writer_globaldocument_StarOffice_XML_Writer_GlobalDocument.xcu |    2 
 filter/source/config/fragments/filters/writer_web_StarOffice_XML_Writer_Web_Template.xcu              |    2 
 filter/source/msfilter/msdffimp.cxx                                                                   |    5 
 filter/source/pdf/impdialog.cxx                                                                       |    2 
 formula/source/core/api/token.cxx                                                                     |   50 +-
 i18nlangtag/qa/cppunit/test_languagetag.cxx                                                           |   11 
 i18npool/source/localedata/data/ca_ES.xml                                                             |    4 
 include/formula/tokenarray.hxx                                                                        |   30 +
 include/sfx2/recentdocsview.hxx                                                                       |    2 
 include/sfx2/thumbnailview.hxx                                                                        |    2 
 officecfg/registry/data/org/openoffice/Office/Paths.xcu                                               |    1 
 reportdesign/source/ui/dlg/Formula.cxx                                                                |    6 
 reportdesign/source/ui/inc/Formula.hxx                                                                |   13 
 reportdesign/source/ui/misc/UITools.cxx                                                               |   11 
 sc/inc/cellform.hxx                                                                                   |    3 
 sc/inc/column.hxx                                                                                     |   13 
 sc/inc/document.hxx                                                                                   |   13 
 sc/inc/formulacell.hxx                                                                                |    8 
 sc/inc/formulagroup.hxx                                                                               |   18 +
 sc/inc/table.hxx                                                                                      |    6 
 sc/inc/tokenarray.hxx                                                                                 |    5 
 sc/source/core/data/column.cxx                                                                        |   44 --
 sc/source/core/data/column2.cxx                                                                       |   21 -
 sc/source/core/data/column3.cxx                                                                       |  108 ++++--
 sc/source/core/data/column4.cxx                                                                       |  158 ++++++++
 sc/source/core/data/conditio.cxx                                                                      |   13 
 sc/source/core/data/documen2.cxx                                                                      |    2 
 sc/source/core/data/documen4.cxx                                                                      |   11 
 sc/source/core/data/document.cxx                                                                      |    6 
 sc/source/core/data/document10.cxx                                                                    |   33 +
 sc/source/core/data/formulacell.cxx                                                                   |   85 ++--
 sc/source/core/data/table4.cxx                                                                        |    6 
 sc/source/core/data/table7.cxx                                                                        |   13 
 sc/source/core/data/validat.cxx                                                                       |    6 
 sc/source/core/tool/cellform.cxx                                                                      |   32 +
 sc/source/core/tool/formulagroup.cxx                                                                  |   11 
 sc/source/core/tool/token.cxx                                                                         |   29 -
 sc/source/filter/excel/excform.cxx                                                                    |    6 
 sc/source/filter/excel/excform8.cxx                                                                   |    4 
 sc/source/filter/excel/frmbase.cxx                                                                    |   15 
 sc/source/filter/excel/tokstack.cxx                                                                   |   11 
 sc/source/filter/excel/xicontent.cxx                                                                  |    2 
 sc/source/filter/excel/xlformula.cxx                                                                  |    6 
 sc/source/filter/inc/XclImpChangeTrack.hxx                                                            |   14 
 sc/source/filter/inc/excform.hxx                                                                      |    4 
 sc/source/filter/inc/formel.hxx                                                                       |   12 
 sc/source/filter/inc/lotform.hxx                                                                      |    3 
 sc/source/filter/inc/qproform.hxx                                                                     |    8 
 sc/source/filter/inc/tokstack.hxx                                                                     |   14 
 sc/source/filter/inc/xlformula.hxx                                                                    |    9 
 sc/source/filter/lotus/lotform.cxx                                                                    |    4 
 sc/source/filter/lotus/lotimpop.cxx                                                                   |   11 
 sc/source/filter/lotus/op.cxx                                                                         |    6 
 sc/source/filter/oox/condformatbuffer.cxx                                                             |    4 
 sc/source/filter/oox/workbookhelper.cxx                                                               |    4 
 sc/source/filter/qpro/qpro.cxx                                                                        |   11 
 sc/source/filter/qpro/qproform.cxx                                                                    |    4 
 sc/source/filter/xcl97/XclImpChangeTrack.cxx                                                          |    5 
 sc/source/filter/xml/XMLExportIterator.cxx                                                            |    3 
 sc/source/filter/xml/XMLExportIterator.hxx                                                            |    4 
 sc/source/filter/xml/xmlexprt.cxx                                                                     |   11 
 sc/source/ui/docshell/docfunc.cxx                                                                     |   11 
 sc/source/ui/docshell/docsh8.cxx                                                                      |  116 ++++--
 sc/source/ui/formdlg/formula.cxx                                                                      |    2 
 sc/source/ui/inc/gridwin.hxx                                                                          |    2 
 sc/source/ui/inc/namedlg.hxx                                                                          |    5 
 sc/source/ui/inc/namemgrtable.hxx                                                                     |   12 
 sc/source/ui/namedlg/namedlg.cxx                                                                      |   17 
 sc/source/ui/namedlg/namemgrtable.cxx                                                                 |   14 
 sc/source/ui/undo/undocell.cxx                                                                        |    4 
 sc/source/ui/undo/undorangename.cxx                                                                   |    6 
 sc/source/ui/unoobj/funcuno.cxx                                                                       |    4 
 sc/source/ui/unoobj/nameuno.cxx                                                                       |    4 
 sc/source/ui/unoobj/tokenuno.cxx                                                                      |    2 
 sc/source/ui/view/gridwin.cxx                                                                         |  180 +++++++---
 sc/source/ui/view/output2.cxx                                                                         |    5 
 sc/source/ui/view/viewfun2.cxx                                                                        |    4 
 sc/source/ui/view/viewfunc.cxx                                                                        |    5 
 sd/qa/unit/data/odp/fdo77027.odp                                                                      |binary
 sd/qa/unit/import-tests.cxx                                                                           |   37 ++
 sd/source/ui/animations/CustomAnimationCreateDialog.cxx                                               |    2 
 sfx2/source/control/recentdocsview.cxx                                                                |    7 
 sfx2/source/control/thumbnailview.cxx                                                                 |   17 
 sfx2/source/dialog/templdlg.cxx                                                                       |    4 
 slideshow/source/engine/shapes/viewmediashape.cxx                                                     |   17 
 smoketest/data/Basic/Standard/Global.xml                                                              |   10 
 smoketest/data/Basic/Standard/Test_10er.xml                                                           |   43 --
 smoketest/data/Dialogs/Standard/OptionsDlg.xml                                                        |    1 
 smoketest/data/content.xml                                                                            |    1 
 svgio/source/svgreader/svgstyleattributes.cxx                                                         |   16 
 svgio/source/svgreader/svgsvgnode.cxx                                                                 |    3 
 svx/source/table/tableundo.cxx                                                                        |    1 
 sw/qa/extras/rtfimport/data/fdo74599.rtf                                                              |    8 
 sw/qa/extras/rtfimport/data/fdo77267.rtf                                                              |   12 
 sw/qa/extras/rtfimport/rtfimport.cxx                                                                  |   13 
 sw/source/ui/app/docst.cxx                                                                            |   22 -
 sw/source/ui/docvw/edtwin.cxx                                                                         |   19 -
 vcl/source/glyphs/graphite_layout.cxx                                                                 |   16 
 vcl/source/window/window.cxx                                                                          |   30 +
 writerfilter/source/dmapper/DomainMapper.cxx                                                          |    3 
 writerfilter/source/dmapper/DomainMapper_Impl.cxx                                                     |    7 
 writerfilter/source/filter/ImportFilter.cxx                                                           |    3 
 writerfilter/source/rtftok/rtfdocumentimpl.cxx                                                        |    3 
 xmloff/source/draw/ximpshap.cxx                                                                       |    2 
 xmloff/source/meta/xmlmetai.cxx                                                                       |   14 
 134 files changed, 1383 insertions(+), 562 deletions(-)

New commits:
commit 732dc0a415c72f6fedaa3329e7d0aab59962bd85
Author: Zolnai Tamás <tamas.zolnai at collabora.com>
Date:   Fri Apr 11 16:33:55 2014 +0200

    fdo#72400: slideshow: display a snapshot of movie until its not started
    
    Change-Id: Ibd81f2aada458dd7437053b59882d3200f78747e
    (cherry picked from commit 539017f1d96b0ca2c062ed7ffd2f48166f831493)
    Reviewed-on: https://gerrit.libreoffice.org/8949
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/slideshow/source/engine/shapes/viewmediashape.cxx b/slideshow/source/engine/shapes/viewmediashape.cxx
index 004dce8..8f66d95 100644
--- a/slideshow/source/engine/shapes/viewmediashape.cxx
+++ b/slideshow/source/engine/shapes/viewmediashape.cxx
@@ -31,6 +31,7 @@
 #include <vcl/canvastools.hxx>
 #include <vcl/syschild.hxx>
 #include <vcl/window.hxx>
+#include <vcl/graph.hxx>
 
 #include <basegfx/tools/canvastools.hxx>
 #include <basegfx/matrix/b2dhommatrixtools.hxx>
@@ -186,14 +187,16 @@ namespace slideshow
 
             if( !mpMediaWindow.get() && !mxPlayerWindow.is() )
             {
-                // draw placeholder for no-video (no window) case
-                // no window and player == audio icon
-                // no window and no player == broken icon
-                BitmapEx aAudioLogo(mxPlayer.is() ?
-                    avmedia::MediaWindow::getAudioLogo() : avmedia::MediaWindow::getEmptyLogo() );
+                OUString sURL;
+                uno::Reference< beans::XPropertySet > xPropSet( mxShape, uno::UNO_QUERY );
+                if (xPropSet.is())
+                    xPropSet->getPropertyValue("PrivateTempFileURL") >>= sURL;
+
+                const Graphic aGraphic(avmedia::MediaWindow::grabFrame(sURL,"", true));
+                const BitmapEx aBmp = aGraphic.GetBitmapEx();
 
                 uno::Reference< rendering::XBitmap > xBitmap(vcl::unotools::xBitmapFromBitmapEx(
-                    pCanvas->getUNOCanvas()->getDevice(), aAudioLogo));
+                    pCanvas->getUNOCanvas()->getDevice(), aBmp));
 
                 rendering::ViewState aViewState;
                 aViewState.AffineTransform = pCanvas->getViewState().AffineTransform;
@@ -201,7 +204,7 @@ namespace slideshow
                 rendering::RenderState aRenderState;
                 ::canvas::tools::initRenderState( aRenderState );
 
-                const ::Size aBmpSize( aAudioLogo.GetSizePixel() );
+                const ::Size aBmpSize( aBmp.GetSizePixel() );
 
                 const ::basegfx::B2DVector aScale( rBounds.getWidth() / aBmpSize.Width(),
                                                    rBounds.getHeight() / aBmpSize.Height() );
commit bfa6c7a0f01fbb706116b940038642652870dd8d
Author: Zolnai Tamás <tamas.zolnai at collabora.com>
Date:   Mon Apr 14 12:14:48 2014 +0200

    Slideshow: Fix regression related to media animations
    
    Misc effects tab page animations were lost.
    Regression from
    9695f38ca4ab26b40524f2eade98c45f0360131d.
    
    Change-Id: I81f7321d7dd87f5b0f6b4acbecbd60241ab1e430
    (cherry picked from commit 81e98150cc04ad764abc668dc12b91d3de90369e)
    Reviewed-on: https://gerrit.libreoffice.org/9054
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sd/source/ui/animations/CustomAnimationCreateDialog.cxx b/sd/source/ui/animations/CustomAnimationCreateDialog.cxx
index 257d7fe..0eb084a 100644
--- a/sd/source/ui/animations/CustomAnimationCreateDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationCreateDialog.cxx
@@ -569,7 +569,7 @@ CustomAnimationCreateTabPage* CustomAnimationCreateDialog::getCurrentPage() cons
 {
     sal_Int16 curPageId = mpTabControl->GetCurPageId();
 
-    for( sal_uInt16 i = ENTRANCE; i <= MOTIONPATH; i++ )
+    for( sal_uInt16 i = ENTRANCE; i <= MISCEFFECTS; i++ )
     {
         if( mpTabPages[i]->getId() == curPageId )
             return mpTabPages[i];
commit de5994890bdd7a1f20979a1829d9ea01b746b2d7
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Apr 15 23:34:37 2014 +0200

    fdo#77027: ODF import: fix wrong version in check for embedded objects
    
    SvXMLImport::LO_4x does not mean 4.0+ any more.
    
    (regression from 92cb21ebeda98c5193c50c4cf7ef3d60611c2a52)
    
    (cherry picked from commit 25a2eab22798373b8197f1e594568207eb7c5039)
    
    Conflicts:
    	sd/qa/unit/import-tests.cxx
    
    Change-Id: Ib444762c2d6e4d051e99962eaff1b1ed34af983a
    Reviewed-on: https://gerrit.libreoffice.org/9064
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sd/qa/unit/data/odp/fdo77027.odp b/sd/qa/unit/data/odp/fdo77027.odp
new file mode 100644
index 0000000..4d834d4
Binary files /dev/null and b/sd/qa/unit/data/odp/fdo77027.odp differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 991f5fe..7fddb39 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -18,6 +18,10 @@
 
 #include <svx/svdotext.hxx>
 #include <svx/svdoashp.hxx>
+#include <svx/svdogrp.hxx>
+#include <svx/svdomedia.hxx>
+#include <svx/svdoole2.hxx>
+#include <svx/xflclit.hxx>
 #include <animations/animationnodehelper.hxx>
 
 #include <com/sun/star/drawing/XDrawPage.hpp>
@@ -43,6 +47,7 @@ class SdFiltersTest : public SdModelTestBase
 public:
     void testDocumentLayout();
     void testSmoketest();
+    void testFdo77027();
     void testN759180();
     void testN778859();
     void testFdo64512();
@@ -53,6 +58,7 @@ public:
     CPPUNIT_TEST_SUITE(SdFiltersTest);
     CPPUNIT_TEST(testDocumentLayout);
     CPPUNIT_TEST(testSmoketest);
+    CPPUNIT_TEST(testFdo77027);
     CPPUNIT_TEST(testN759180);
     CPPUNIT_TEST(testN778859);
     CPPUNIT_TEST(testFdo64512);
@@ -243,6 +249,37 @@ void SdFiltersTest::testN778859()
     }
 }
 
+// FIXME copypasta
+std::ostream& operator<<(std::ostream& rStrm, const Color& rColor)
+{
+    rStrm << "Color: R:" << rColor.GetRed() << " G:" << rColor.GetGreen() << " B: << rColor.GetBlue()";
+    return rStrm;
+}
+
+void SdFiltersTest::testFdo77027()
+{
+    ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/odp/fdo77027.odp"));
+
+    SdDrawDocument *pDoc = xDocShRef->GetDoc();
+    CPPUNIT_ASSERT_MESSAGE( "no document", pDoc != NULL );
+    const SdrPage *pPage = pDoc->GetPage(1);
+    CPPUNIT_ASSERT_MESSAGE( "no page", pPage != NULL );
+    {
+        SdrOle2Obj *const pObj = dynamic_cast<SdrOle2Obj*>(pPage->GetObj(0));
+        CPPUNIT_ASSERT(pObj);
+
+        // check that the fill style/color was actually imported
+        const XFillStyleItem& rStyleItem = dynamic_cast<const XFillStyleItem&>(
+                pObj->GetMergedItem(XATTR_FILLSTYLE));
+        CPPUNIT_ASSERT_EQUAL(XFILL_SOLID, rStyleItem.GetValue());
+        const XFillColorItem& rColorItem = dynamic_cast<const XFillColorItem&>(
+                pObj->GetMergedItem(XATTR_FILLCOLOR));
+        CPPUNIT_ASSERT_EQUAL(Color(0xff6600), rColorItem.GetColorValue());
+    }
+
+    xDocShRef->DoClose();
+}
+
 void SdFiltersTest::testFdo64512()
 {
     ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/fdo64512.odp"));
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index bb3a49f..ae94d31 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -2677,7 +2677,7 @@ void SdXMLObjectShapeContext::StartElement( const ::com::sun::star::uno::Referen
 void SdXMLObjectShapeContext::EndElement()
 {
     if (GetImport().isGeneratorVersionOlderThan(
-                SvXMLImport::OOo_34x, SvXMLImport::LO_4x))
+                SvXMLImport::OOo_34x, SvXMLImport::LO_41x)) // < LO 4.0
     {
         // #i118485#
         // If it's an old file from us written before OOo3.4, we need to correct
commit 8027fce55265b7b936c256b78ce14d2483be6dd1
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Apr 16 00:26:33 2014 +0200

    ODF import: detect "LibreOfficeDev" in meta:generator too
    
    (cherry picked from commit 74d7911abf77643544c58a0d3e5fb956add76c44)
    
    xmloff: we used to call it LOdev back in 4.0 so check that too
    (cherry picked from commit 5d53cabb52648507086a39e06803624949e4a301)
    
    Change-Id: Icea3086975dab1afedf111364683e6a7de50ce41
    Reviewed-on: https://gerrit.libreoffice.org/9063
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/xmloff/source/meta/xmlmetai.cxx b/xmloff/source/meta/xmlmetai.cxx
index 6db2452..9ff8e75 100644
--- a/xmloff/source/meta/xmlmetai.cxx
+++ b/xmloff/source/meta/xmlmetai.cxx
@@ -266,17 +266,19 @@ void SvXMLMetaDocumentContext::setBuildId(OUString const& i_rBuildId, const uno:
         }
     }
 
-    if (i_rBuildId.startsWith("LibreOffice/"))
+    OUString rest;
+    if (i_rBuildId.startsWith("LibreOffice/", &rest) ||
+        i_rBuildId.startsWith("LibreOfficeDev/", &rest) ||
+        i_rBuildId.startsWith("LOdev/", &rest))
     {
         OUStringBuffer sNumber;
-        for (sal_Int32 i = sizeof("LibreOffice/") - 1;
-                i < i_rBuildId.getLength(); ++i)
+        for (sal_Int32 i = 0; i < rest.getLength(); ++i)
         {
-            if (isdigit(i_rBuildId[i]))
+            if (isdigit(rest[i]))
             {
-                sNumber.append(i_rBuildId[i]);
+                sNumber.append(rest[i]);
             }
-            else if ('.' != i_rBuildId[i])
+            else if ('.' != rest[i])
             {
                 break;
             }
commit afc672a914f0e0dba8f055a15e23fa94a8b0dd7e
Author: Andrzej Hunt <andrzej.hunt at collabora.com>
Date:   Tue Apr 15 16:22:53 2014 +0100

    fdo#72287 Scroll automatically to show selected item when keyboard used.
    
    806919adf9c9bafbaba92c2d2ab35d2e2f9863f8 added finer-grained scrolling using
    the scrollbar / scrollwheel, but inadvertently prevents the display from scrolling
    when an item is selected that is currently offscreen (e.g. by using the down-arrow
    button on the keyboard).
    
    Change-Id: Iaa3a7dc6d214741d37cf4ec78c00ed0034ed1e42
    (cherry picked from commit 717aa1ac75ddd54fdf72cd4de6551f1fb536da9b)
    Reviewed-on: https://gerrit.libreoffice.org/9017
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx
index e21b87b..851eba0 100644
--- a/include/sfx2/thumbnailview.hxx
+++ b/include/sfx2/thumbnailview.hxx
@@ -292,7 +292,7 @@ protected:
     using Control::ImplInitSettings;
     using Window::ImplInit;
 
-    void CalculateItemPositions ();
+    void CalculateItemPositions (bool bScrollBarUsed = false);
     void MakeItemVisible( sal_uInt16 nId );
 
     SFX2_DLLPRIVATE void         ImplInit();
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index a4e38a7..814a8d7 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -275,7 +275,7 @@ void ThumbnailView::OnItemDblClicked (ThumbnailViewItem*)
     return new ThumbnailViewAcc( this, mbIsTransientChildrenDisabled );
 }
 
-void ThumbnailView::CalculateItemPositions ()
+void ThumbnailView::CalculateItemPositions (bool bScrollBarUsed)
 {
     if (!mnItemHeight || !mnItemWidth)
         return;
@@ -300,7 +300,7 @@ void ThumbnailView::CalculateItemPositions ()
 
     // calculate window scroll ratio
     float nScrollRatio;
-    if( mpScrBar )
+    if( bScrollBarUsed && mpScrBar )
         nScrollRatio = static_cast<float>(mpScrBar->GetThumbPos()) /
                         static_cast<float>(mpScrBar->GetRangeMax()-2);
     else
@@ -356,7 +356,12 @@ void ThumbnailView::CalculateItemPositions ()
         nHiddenLines * nItemHeightOffset;
 
     // draw items
-    size_t nFirstItem = nHiddenLines * mnCols;
+    // Unless we are scrolling (via scrollbar) we just use the precalculated
+    // mnFirstLine -- our nHiddenLines calculation takes into account only
+    // what the user has done with the scrollbar but not any changes of selection
+    // using the keyboard, meaning we could accidentally hide the selected item
+    // if we believe the scrollbar (fdo#72287).
+    size_t nFirstItem = (bScrollBarUsed ? nHiddenLines : mnFirstLine) * mnCols;
     size_t nLastItem = nFirstItem + (mnVisLines + 1) * mnCols;
 
     maItemListRect.Left() = x;
@@ -438,6 +443,8 @@ void ThumbnailView::CalculateItemPositions ()
         mpScrBar->SetPosSizePixel( aPos, aSize );
         mpScrBar->SetRangeMax( (nCurCount+mnCols-1)*mnFineness/mnCols);
         mpScrBar->SetVisibleSize( mnVisLines );
+        if (!bScrollBarUsed)
+            mpScrBar->SetThumbPos( (long)mnFirstLine*mnFineness );
         long nPageSize = mnVisLines;
         if ( nPageSize < 1 )
             nPageSize = 1;
@@ -520,7 +527,7 @@ IMPL_LINK( ThumbnailView,ImplScrollHdl, ScrollBar*, pScrollBar )
 {
     if ( pScrollBar->GetDelta() )
     {
-        CalculateItemPositions();
+        CalculateItemPositions(true);
 
         if ( IsReallyVisible() && IsUpdateMode() )
             Invalidate();
commit ffa6e6b0ba32c4d71219900b8d1a06e9bec5891a
Author: Thorsten Behrens <thb at documentfoundation.org>
Date:   Thu Apr 10 19:40:54 2014 +0200

    Fix fdo#71423 - crash while editing Impress tables.
    
    Band-aid fix for this nasty crasher, seems sometimes the
    family item is not found.
    
    Change-Id: I7f78d59cbf2c9595ad512fa7a78370629924cd06
    (cherry picked from commit 058cfa72dcdd91df302be45f7fc59b0d961a420b)
    Signed-off-by: Andras Timar <andras.timar at collabora.com>

diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index ecc4d41..cbd856f 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -1245,6 +1245,8 @@ void SfxCommonTemplateDialog_Impl::FillTreeBox()
     if(pStyleSheetPool && nActFamily != 0xffff)
     {
         const SfxStyleFamilyItem *pItem = GetFamilyItem_Impl();
+        if(!pItem)
+            return;
         pStyleSheetPool->SetSearchMask(pItem->GetFamily(), SFXSTYLEBIT_ALL_VISIBLE);
         StyleTreeArr_Impl aArr;
         SfxStyleSheetBase *pStyle = pStyleSheetPool->First();
@@ -1589,7 +1591,7 @@ void SfxCommonTemplateDialog_Impl::Update_Impl()
          // other filters for automatic
          CheckItem( nActFamily, sal_True );
          const SfxStyleFamilyItem *pStyleItem =  GetFamilyItem_Impl();
-         if (  0 == pStyleItem->GetFilterList()[ nActFilter ]->nFlags
+         if ( pStyleItem && 0 == pStyleItem->GetFilterList()[ nActFilter ]->nFlags
             && nAppFilter != pItem->GetValue())
          {
              nAppFilter = pItem->GetValue();
commit 9c4a42f07e0f6392f1a0ecb77349dc37d9b4a828
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Wed Apr 16 09:40:29 2014 +0200

    fdo#74743 avoid infinite loop when gathering "svg" element styles
    
    Change-Id: Ifcfd0c64302b9174510e3d774607f5ca60173885
    Signed-off-by: Andras Timar <andras.timar at collabora.com>

diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx
index ecddfbf..0fae736 100644
--- a/svgio/source/svgreader/svgstyleattributes.cxx
+++ b/svgio/source/svgreader/svgstyleattributes.cxx
@@ -205,17 +205,15 @@ namespace svgio
 
         const SvgStyleAttributes* SvgStyleAttributes::getParentStyle() const
         {
-            if(getCssStyleParent())
-            {
-                return getCssStyleParent();
-            }
+            const SvgStyleAttributes* pParentStyle = getCssStyleParent();
 
-            if(mrOwner.getParent())
-            {
-                return mrOwner.getParent()->getSvgStyleAttributes();
-            }
+            // no parent style set, check parent for its style attributes
+            if(pParentStyle == NULL && mrOwner.getParent() != NULL)
+               pParentStyle = mrOwner.getParent()->getSvgStyleAttributes();
 
-            return 0;
+            if (pParentStyle != this) // to prevent infinite loop
+                return pParentStyle;
+            return NULL;
         }
 
         void SvgStyleAttributes::add_text(
diff --git a/svgio/source/svgreader/svgsvgnode.cxx b/svgio/source/svgreader/svgsvgnode.cxx
index 8e107c6..cde5387 100644
--- a/svgio/source/svgreader/svgsvgnode.cxx
+++ b/svgio/source/svgreader/svgsvgnode.cxx
@@ -60,7 +60,8 @@ namespace svgio
 
         const SvgStyleAttributes* SvgSvgNode::getSvgStyleAttributes() const
         {
-            return checkForCssStyle(OUString("svg"), maSvgStyleAttributes);
+            checkForCssStyle(OUString("svg"), maSvgStyleAttributes);
+            return maSvgStyleAttributes.getCssStyleParent();
         }
 
         void SvgSvgNode::parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent)
commit 4a46dcb4d6957d8790783eab74f78fb6bf3f1173
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Apr 14 08:52:59 2014 +0200

    fdo#77267 RTF import: pard should reset current paragraph style
    
    Change-Id: I8d78ce262a4e57161325231a78e48750909b1bad
    (cherry picked from commit 904630a2272ac4dd540939f8a462bff5d636f066)
    Reviewed-on: https://gerrit.libreoffice.org/9055
    Tested-by: Michael Stahl <mstahl at redhat.com>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/qa/extras/rtfimport/data/fdo77267.rtf b/sw/qa/extras/rtfimport/data/fdo77267.rtf
new file mode 100644
index 0000000..f9b9060
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo77267.rtf
@@ -0,0 +1,12 @@
+{\rtf1\ansi\ansicpg1250\uc1 \deff0\deflang1045\deflangfe1045
+{\stylesheet
+{
+\li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1045\langfe1045\cgrid\langnp1045\langfenp1045 \snext0 Normal;}
+{\s4\qc \li0\ri0\sl360\slmult1
+\keepn\nowidctlpar\faauto\outlinelevel3\rin0\lin0\itap0 \b\fs52\lang1045\langfe1045\cgrid\langnp1045\langfenp1045 \sbasedon0 \snext0 heading 4;}
+}
+\pard\plain \s4\qc \li0\ri0\sl360\slmult1\keepn\nowidctlpar\faauto\outlinelevel3\rin0\lin0\itap0
+\pard \qc
+l
+\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 5bcdcb4..4d61147 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1622,6 +1622,12 @@ DECLARE_RTFIMPORT_TEST(testFdo74599, "fdo74599.rtf")
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-1), getProperty<sal_Int32>(xPropertySet, "CharColor"));
 }
 
+DECLARE_RTFIMPORT_TEST(testFdo77267, "fdo77267.rtf")
+{
+    // Paragraph was aligned to left, should be center.
+    CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(getParagraph(1), "ParaAdjust")));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 4bf522f..b5a5f13 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2522,6 +2522,9 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
                 m_aStates.top().aParagraphSprms.set(NS_sprm::LN_PFInTable, RTFValue::Pointer_t(new RTFValue(1)));
             }
             m_aStates.top().resetFrame();
+
+            // Reset currently selected paragraph style as well.
+            m_aStates.top().nCurrentStyleIndex = -1;
             break;
         case RTF_SECTD:
             {
commit 7f81836d87d1b681ebf6a9d0a487b251222ec579
Author: Andras Timar <andras.timar at collabora.com>
Date:   Tue Apr 15 16:39:07 2014 +0200

    fdo#74654 fix typo: printnone -> printhigh
    
    Change-Id: I286dedfb6dfd8d9c119bf1b6ac777a2a08f22d7e
    Reviewed-on: https://gerrit.libreoffice.org/9015
    Tested-by: Michael Stahl <mstahl at redhat.com>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 54e40ab..631afd239 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -1088,7 +1088,7 @@ ImpPDFTabSecurityPage::ImpPDFTabSecurityPage(Window* i_pParent, const SfxItemSet
     get(mpPrintPermissions, "printing");
     get(mpRbPrintNone, "printnone");
     get(mpRbPrintLowRes, "printlow");
-    get(mpRbPrintHighRes, "printnone");
+    get(mpRbPrintHighRes, "printhigh");
 
     get(mpChangesAllowed, "changes");
     get(mpRbChangesNone, "changenone");
commit d20b3d84221978cfd71b807bfe1d838ea0d39979
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Sat Apr 12 16:15:28 2014 +0200

    fdo#74599 RTF import: enable StylesNoDefault compat setting
    
    The Writer 'Heading 3' paragraph style is gray by default, but (just
    like in case of DOCX) that shouldn't have any influence on the RTF
    import result.
    
    Fix this by moving the compat setting from the DOCX filter
    implementation to the common dmapper.
    
    Change-Id: I86c7cf1a66f82b438ce8379467773a88c9e229af
    (cherry picked from commit 2df53ef5002270bfe788e383e95002f636a242d9)
    Reviewed-on: https://gerrit.libreoffice.org/8945
    Tested-by: Michael Stahl <mstahl at redhat.com>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/qa/extras/rtfimport/data/fdo74599.rtf b/sw/qa/extras/rtfimport/data/fdo74599.rtf
new file mode 100644
index 0000000..b47728f
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo74599.rtf
@@ -0,0 +1,8 @@
+{\rtf1
+{\stylesheet
+{\s3 heading 3;}
+}
+\pard\plain \s3
+This is gray
+\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 7961519..5bcdcb4 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1615,6 +1615,13 @@ DECLARE_RTFIMPORT_TEST(testFdo74823, "fdo74823.rtf")
     CPPUNIT_ASSERT_EQUAL(sal_Int16(5391), getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(1), "TableColumnSeparators")[2].Position);
 }
 
+DECLARE_RTFIMPORT_TEST(testFdo74599, "fdo74599.rtf")
+{
+    uno::Reference<beans::XPropertySet> xPropertySet(getStyles("ParagraphStyles")->getByName("Heading 3"), uno::UNO_QUERY);
+    // Writer default styles weren't disabled, so the color was gray, not default (black).
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-1), getProperty<sal_Int32>(xPropertySet, "CharColor"));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 2532942..dbb16d0 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -107,6 +107,9 @@ LoggedStream(dmapper_logger, "DomainMapper"),
         PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_SURROUND_TEXT_WRAP_SMALL ),
         uno::makeAny( true ) );
 
+    // Don't load the default style definitions to avoid weird mix
+    m_pImpl->SetDocumentSettingsProperty("StylesNoDefault", uno::makeAny(true));
+
     //import document properties
     try
     {
diff --git a/writerfilter/source/filter/ImportFilter.cxx b/writerfilter/source/filter/ImportFilter.cxx
index cbbcd3a..0fa211c 100644
--- a/writerfilter/source/filter/ImportFilter.cxx
+++ b/writerfilter/source/filter/ImportFilter.cxx
@@ -284,9 +284,6 @@ void WriterFilter::setTargetDocument( const uno::Reference< lang::XComponent >&
    xSettings->setPropertyValue( "TabOverflow", uno::makeAny( sal_True ) );
    xSettings->setPropertyValue( "UnbreakableNumberings", uno::makeAny( sal_True ) );
 
-   // Don't load the default style definitions to avoid weird mix
-   xSettings->setPropertyValue( "StylesNoDefault", uno::makeAny( sal_True ) );
-
    xSettings->setPropertyValue("FloattableNomargins", uno::makeAny( sal_True ));
    xSettings->setPropertyValue( "ClippedPictures", uno::makeAny( sal_True ) );
    xSettings->setPropertyValue( "BackgroundParaOverDrawings", uno::makeAny( sal_True ) );
commit d9d7270113d48bae962c56a09c691165de368a29
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Tue Apr 15 10:12:58 2014 -0400

    fdo#76409: Write output cell string to <text:p> element when saving to ods.
    
    The change was made by accident.
    
    Change-Id: Ife2461b0fca6e3ea5a65d72d985d1e0976737b5a
    (cherry picked from commit a0752fa4246dc71b64907c679657a1af3cb617e1)
    Reviewed-on: https://gerrit.libreoffice.org/9014
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/inc/cellform.hxx b/sc/inc/cellform.hxx
index 1f6b13a..caea246 100644
--- a/sc/inc/cellform.hxx
+++ b/sc/inc/cellform.hxx
@@ -54,6 +54,9 @@ public:
     static void GetInputString(
         ScRefCellValue& rCell, sal_uLong nFormat, OUString& rString, SvNumberFormatter& rFormatter,
         const ScDocument* pDoc );
+
+    static OUString GetOutputString(
+        ScDocument& rDoc, const ScAddress& rPos, ScRefCellValue& rCell );
 };
 
 #endif
diff --git a/sc/source/core/tool/cellform.cxx b/sc/source/core/tool/cellform.cxx
index 6a23ba2..d96430a 100644
--- a/sc/source/core/tool/cellform.cxx
+++ b/sc/source/core/tool/cellform.cxx
@@ -29,6 +29,7 @@
 #include "cellvalue.hxx"
 #include "formula/errorcodes.hxx"
 #include "sc.hrc"
+#include <editutil.hxx>
 
 // STATIC DATA
 // Err527 Workaround
@@ -266,4 +267,35 @@ void ScCellFormat::GetInputString(
     rString = aString;
 }
 
+OUString ScCellFormat::GetOutputString( ScDocument& rDoc, const ScAddress& rPos, ScRefCellValue& rCell )
+{
+    if (rCell.isEmpty())
+        return EMPTY_OUSTRING;
+
+    OUString aVal;
+
+    if (rCell.meType == CELLTYPE_EDIT)
+    {
+        //  GetString an der EditCell macht Leerzeichen aus Umbruechen,
+        //  hier werden die Umbrueche aber gebraucht
+        const EditTextObject* pData = rCell.mpEditText;
+        if (pData)
+        {
+            ScFieldEditEngine& rEngine = rDoc.GetEditEngine();
+            rEngine.SetText(*pData);
+            aVal = rEngine.GetText(LINEEND_LF);
+        }
+        //  Edit-Zellen auch nicht per NumberFormatter formatieren
+        //  (passend zur Ausgabe)
+    }
+    else
+    {
+        //  wie in GetString am Dokument (column)
+        Color* pColor;
+        sal_uLong nNumFmt = rDoc.GetNumberFormat(rPos);
+        aVal = GetString(rDoc, rPos, nNumFmt, &pColor, *rDoc.GetFormatTable());
+    }
+    return aVal;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/xml/XMLExportIterator.cxx b/sc/source/filter/xml/XMLExportIterator.cxx
index afc05fd..57d03c4 100644
--- a/sc/source/filter/xml/XMLExportIterator.cxx
+++ b/sc/source/filter/xml/XMLExportIterator.cxx
@@ -657,10 +657,11 @@ void ScMyNotEmptyCellsIterator::UpdateAddress( table::CellAddress& rAddress )
     }
 }
 
-void ScMyNotEmptyCellsIterator::SetCellData( ScMyCell& rMyCell, table::CellAddress& rAddress )
+void ScMyNotEmptyCellsIterator::SetCellData( ScMyCell& rMyCell, const table::CellAddress& rAddress )
 {
     rMyCell.maBaseCell.clear();
     rMyCell.aCellAddress = rAddress;
+    ScUnoConversion::FillScAddress(rMyCell.maCellAddress, rMyCell.aCellAddress);
 
     if( (nCellCol == rAddress.Column) && (nCellRow == rAddress.Row) )
     {
diff --git a/sc/source/filter/xml/XMLExportIterator.hxx b/sc/source/filter/xml/XMLExportIterator.hxx
index 857f98c..71d4b58 100644
--- a/sc/source/filter/xml/XMLExportIterator.hxx
+++ b/sc/source/filter/xml/XMLExportIterator.hxx
@@ -294,6 +294,8 @@ public:
 // contains data to export for the current cell position
 struct ScMyCell
 {
+    ScAddress maCellAddress; /// Use this instead of the UNO one.
+
     com::sun::star::table::CellAddress      aCellAddress;
     com::sun::star::table::CellRangeAddress aMergeRange;
     com::sun::star::table::CellRangeAddress aMatrixRange;
@@ -355,7 +357,7 @@ class ScMyNotEmptyCellsIterator : boost::noncopyable
     SCTAB                       nCurrentTable;
 
     void                        UpdateAddress( ::com::sun::star::table::CellAddress& rAddress );
-    void                        SetCellData( ScMyCell& rMyCell, ::com::sun::star::table::CellAddress& rAddress );
+    void SetCellData( ScMyCell& rMyCell, const css::table::CellAddress& rAddress );
 
     void                        HasAnnotation( ScMyCell& aCell );
 public:
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index c2ab4b2..0f157a1 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -64,6 +64,7 @@
 #include <datastream.hxx>
 #include <documentlinkmgr.hxx>
 #include <tokenstringcontext.hxx>
+#include <cellform.hxx>
 
 #include <xmloff/xmltoken.hxx>
 #include <xmloff/xmlnmspe.hxx>
@@ -3280,8 +3281,12 @@ void ScXMLExport::WriteCell(ScMyCell& aCell, sal_Int32 nEqualCellCount)
         else
         {
             SvXMLElementExport aElemP(*this, sElemP, true, false);
-            bool bPrevCharWasSpace(true);
-            GetTextParagraphExport()->exportText(aCell.maBaseCell.getString(pDoc), bPrevCharWasSpace);
+
+            OUString aParaStr =
+                ScCellFormat::GetOutputString(*pDoc, aCell.maCellAddress, aCell.maBaseCell);
+
+            bool bPrevCharWasSpace = true;
+            GetTextParagraphExport()->exportText(aParaStr, bPrevCharWasSpace);
         }
     }
     WriteShapes(aCell);
commit 1aebd02561cfe397800329edcfd3a393c952ccd6
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Mon Apr 14 16:57:52 2014 -0400

    fdo#76294: Properly intern string literals in formula on xls import.
    
    (cherry picked from commit b09426b83c12b0cd27cd909602251cb076ffa4ba)
    (cherry picked from commit 625c595fc30d2e6153735dc2ed2359ff4f8a1e3a)
    (cherry picked from commit 6bb7fa8df523d3ae7b9945009fb1034f28cb0a0a)
    
    Conflicts:
    	formula/source/core/api/token.cxx
    	include/formula/tokenarray.hxx
    	sc/source/filter/excel/excform.cxx
    	sc/source/filter/excel/excform8.cxx
    	sc/source/filter/excel/frmbase.cxx
    	sc/source/filter/inc/XclImpChangeTrack.hxx
    	sc/source/filter/inc/lotform.hxx
    	sc/source/filter/inc/qproform.hxx
    	sc/source/filter/lotus/lotform.cxx
    	sc/source/filter/lotus/lotimpop.cxx
    	sc/source/filter/lotus/op.cxx
    	reportdesign/source/ui/inc/Formula.hxx
    
    Change-Id: Icf962a4363887f323da6d2bdf935a027df3319fa
    Reviewed-on: https://gerrit.libreoffice.org/9008
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx
index 7499a2b..3777d09 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -29,6 +29,7 @@
 #include "formula/tokenarray.hxx"
 #include "formula/FormulaCompiler.hxx"
 #include <formula/compiler.hrc>
+#include <svl/sharedstringpool.hxx>
 
 namespace formula
 {
@@ -286,12 +287,13 @@ FormulaJumpToken::~FormulaJumpToken()
 }
 
 
-bool FormulaTokenArray::AddFormulaToken(const sheet::FormulaToken& _aToken,ExternalReferenceHelper* /*_pRef*/)
+bool FormulaTokenArray::AddFormulaToken(
+    const sheet::FormulaToken& rToken, svl::SharedStringPool& rSPool, ExternalReferenceHelper* /*pExtRef*/)
 {
     bool bError = false;
-    const OpCode eOpCode = static_cast<OpCode>(_aToken.OpCode);      //! assuming equal values for the moment
+    const OpCode eOpCode = static_cast<OpCode>(rToken.OpCode);      //! assuming equal values for the moment
 
-    const uno::TypeClass eClass = _aToken.Data.getValueTypeClass();
+    const uno::TypeClass eClass = rToken.Data.getValueTypeClass();
     switch ( eClass )
     {
         case uno::TypeClass_VOID:
@@ -301,14 +303,14 @@ bool FormulaTokenArray::AddFormulaToken(const sheet::FormulaToken& _aToken,Exter
         case uno::TypeClass_DOUBLE:
             // double is only used for "push"
             if ( eOpCode == ocPush )
-                AddDouble( _aToken.Data.get<double>() );
+                AddDouble( rToken.Data.get<double>() );
             else
                 bError = true;
             break;
         case uno::TypeClass_LONG:
             {
                 // long is svIndex, used for name / database area, or "byte" for spaces
-                sal_Int32 nValue = _aToken.Data.get<sal_Int32>();
+                sal_Int32 nValue = rToken.Data.get<sal_Int32>();
                 if ( eOpCode == ocDBArea )
                     AddToken( formula::FormulaIndexToken( eOpCode, static_cast<sal_uInt16>(nValue) ) );
                 else if ( eOpCode == ocSpaces )
@@ -319,9 +321,9 @@ bool FormulaTokenArray::AddFormulaToken(const sheet::FormulaToken& _aToken,Exter
             break;
         case uno::TypeClass_STRING:
             {
-                OUString aStrVal( _aToken.Data.get<OUString>() );
+                OUString aStrVal( rToken.Data.get<OUString>() );
                 if ( eOpCode == ocPush )
-                    AddString( aStrVal );
+                    AddString(rSPool.intern(aStrVal));
                 else if ( eOpCode == ocBad )
                     AddBad( aStrVal );
                 else if ( eOpCode == ocStringXML )
@@ -337,13 +339,16 @@ bool FormulaTokenArray::AddFormulaToken(const sheet::FormulaToken& _aToken,Exter
     } // switch ( eClass )
     return bError;
 }
-bool FormulaTokenArray::Fill(const uno::Sequence< sheet::FormulaToken >& _aSequence,ExternalReferenceHelper* _pRef)
+
+bool FormulaTokenArray::Fill(
+    const uno::Sequence<sheet::FormulaToken>& rSequence,
+    svl::SharedStringPool& rSPool, ExternalReferenceHelper* pExtRef )
 {
     bool bError = false;
-    const sal_Int32 nCount = _aSequence.getLength();
+    const sal_Int32 nCount = rSequence.getLength();
     for (sal_Int32 nPos=0; nPos<nCount; nPos++)
     {
-        bool bOneError = AddFormulaToken( _aSequence[nPos] ,_pRef);
+        bool bOneError = AddFormulaToken(rSequence[nPos], rSPool, pExtRef);
         if (bOneError)
         {
             AddOpCode( ocErrName);  // add something that indicates an error
@@ -790,12 +795,7 @@ FormulaToken* FormulaTokenArray::Add( FormulaToken* t )
     }
 }
 
-FormulaToken* FormulaTokenArray::AddString( const sal_Unicode* pStr )
-{
-    return AddString( OUString( pStr ) );
-}
-
-FormulaToken* FormulaTokenArray::AddString( const OUString& rStr )
+FormulaToken* FormulaTokenArray::AddString( const svl::SharedString& rStr )
 {
     return Add( new FormulaStringToken( rStr ) );
 }
@@ -1363,7 +1363,10 @@ bool FormulaDoubleToken::operator==( const FormulaToken& r ) const
 }
 
 FormulaStringToken::FormulaStringToken( const svl::SharedString& r ) :
-    FormulaToken( svString ), maString( r ) {}
+    FormulaToken( svString ), maString( r )
+{
+}
+
 FormulaStringToken::FormulaStringToken( const FormulaStringToken& r ) :
     FormulaToken( r ), maString( r.maString ) {}
 
diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx
index a479c10..3c6e12a 100644
--- a/include/formula/tokenarray.hxx
+++ b/include/formula/tokenarray.hxx
@@ -28,6 +28,13 @@
 
 #include <boost/unordered_set.hpp>
 
+namespace svl {
+
+class SharedString;
+class SharedStringPool;
+
+}
+
 namespace formula
 {
 
@@ -197,14 +204,18 @@ public:
         Derived classes must overload it when they want to support derived classes from FormulaToken.
         @return true        when an error occurs
     */
-    virtual bool AddFormulaToken(const com::sun::star::sheet::FormulaToken& _aToken, ExternalReferenceHelper* _pRef = NULL);
+    virtual bool AddFormulaToken(
+        const css::sheet::FormulaToken& rToken, svl::SharedStringPool& rSPool,
+        ExternalReferenceHelper* pExtRef );
 
     /** fill the array with the tokens from the sequence.
         It calls AddFormulaToken for each token in the list.
         @param  _aSequence  the token to add
         @return true        when an error occurs
     */
-    bool Fill(const com::sun::star::uno::Sequence< com::sun::star::sheet::FormulaToken >& _aSequence, ExternalReferenceHelper* _pRef = NULL);
+    bool Fill(
+        const css::uno::Sequence<css::sheet::FormulaToken>& rSequence,
+        svl::SharedStringPool& rSPool, ExternalReferenceHelper* pExtRef );
 
     /**
      * Do some checking based on the individual tokens. For now, we use this
@@ -213,8 +224,7 @@ public:
     virtual void CheckToken( const FormulaToken& t );
 
     FormulaToken* AddToken( const FormulaToken& );
-    FormulaToken* AddString( const sal_Unicode* pStr );
-    FormulaToken* AddString( const OUString& rStr );
+    FormulaToken* AddString( const svl::SharedString& rStr );
     FormulaToken* AddDouble( double fVal );
     FormulaToken* AddExternal( const sal_Unicode* pStr );
     /** Xcl import may play dirty tricks with OpCode!=ocExternal.
diff --git a/reportdesign/source/ui/dlg/Formula.cxx b/reportdesign/source/ui/dlg/Formula.cxx
index 0d37c49..6eaa92e 100644
--- a/reportdesign/source/ui/dlg/Formula.cxx
+++ b/reportdesign/source/ui/dlg/Formula.cxx
@@ -46,7 +46,8 @@ FormulaDialog::FormulaDialog(Window* pParent
                              , const uno::Reference<lang::XMultiServiceFactory>& _xServiceFactory
                              , const ::boost::shared_ptr< IFunctionManager >&  _pFunctionMgr
                              , const OUString& _sFormula
-                             , const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet >& _xRowSet)
+                             , const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet >& _xRowSet
+                             , svl::SharedStringPool& rStrPool )
     : FormulaModalDialog( pParent, false,false,false,_pFunctionMgr.get(),this)
     ,m_aFunctionManager(_pFunctionMgr)
     ,m_pFormulaData(new FormEditData())
@@ -56,6 +57,7 @@ FormulaDialog::FormulaDialog(Window* pParent
     ,m_sFormula("=")
     ,m_nStart(0)
     ,m_nEnd(1)
+    ,mrStringPool(rStrPool)
 {
     if ( !_sFormula.isEmpty() )
     {
@@ -255,7 +257,7 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH
 ::std::auto_ptr<formula::FormulaTokenArray> FormulaDialog::convertToTokenArray(const uno::Sequence< sheet::FormulaToken >& _aTokenList)
 {
     ::std::auto_ptr<formula::FormulaTokenArray> pArray(new FormulaTokenArray());
-    pArray->Fill(_aTokenList, NULL);
+    pArray->Fill(_aTokenList, mrStringPool, NULL);
     return pArray;
 }
 
diff --git a/reportdesign/source/ui/inc/Formula.hxx b/reportdesign/source/ui/inc/Formula.hxx
index a341094..0e53c47 100644
--- a/reportdesign/source/ui/inc/Formula.hxx
+++ b/reportdesign/source/ui/inc/Formula.hxx
@@ -30,7 +30,12 @@ namespace com { namespace sun { namespace star { namespace lang {
     class XMultiServiceFactory;
 } } } }
 
-//============================================================================
+namespace svl {
+
+class SharedStringPool;
+
+}
+
 namespace rptui
 {
 //============================================================================
@@ -51,13 +56,17 @@ class FormulaDialog : public formula::FormulaModalDialog,
     xub_StrLen                  m_nStart;
     xub_StrLen                  m_nEnd;
 
+    svl::SharedStringPool& mrStringPool;
+
     DECL_LINK( OnClickHdl, OAddFieldWindow*);
 public:
     FormulaDialog( Window* pParent
         , const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _xServiceFactory
         , const ::boost::shared_ptr< formula::IFunctionManager >& _pFunctionMgr
         , const OUString& _sFormula
-        , const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet >& _xRowSet);
+        , const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet >& _xRowSet
+        , svl::SharedStringPool& rStrPool );
+
     virtual ~FormulaDialog();
 
     // IFormulaEditorHelper
diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx
index 965f429..9a7b285 100644
--- a/reportdesign/source/ui/misc/UITools.cxx
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -75,9 +75,11 @@
 #include <svx/unoprov.hxx>
 
 #include <unotools/pathoptions.hxx>
+#include <unotools/charclass.hxx>
 #include <svtools/ctrltool.hxx>
 #include <svl/itempool.hxx>
 #include <svl/itemset.hxx>
+#include <svl/sharedstringpool.hxx>
 
 #include <comphelper/propmultiplex.hxx>
 #include <comphelper/namedvaluecollection.hxx>
@@ -1027,7 +1029,14 @@ bool openDialogFormula_nothrow( OUString& _in_out_rFormula
         {
             ::boost::shared_ptr< formula::IFunctionManager > pFormulaManager(new FunctionManager(xMgr) );
             ReportFormula aFormula( _in_out_rFormula );
-            FormulaDialog aDlg(pParent,xServiceFactory,pFormulaManager,aFormula.getUndecoratedContent(),_xRowSet);
+
+            LanguageTag aLangTag(LANGUAGE_SYSTEM);
+            CharClass aCC(_xContext, aLangTag);
+            svl::SharedStringPool aStringPool(&aCC);
+
+            FormulaDialog aDlg(
+                pParent, xServiceFactory, pFormulaManager, aFormula.getUndecoratedContent(), _xRowSet, aStringPool);
+
             bSuccess = aDlg.Execute() == RET_OK;
             if ( bSuccess )
             {
diff --git a/sc/inc/tokenarray.hxx b/sc/inc/tokenarray.hxx
index 5b3e080..bc63154 100644
--- a/sc/inc/tokenarray.hxx
+++ b/sc/inc/tokenarray.hxx
@@ -84,7 +84,10 @@ public:
                                 const ScAddress& rPos, ScDirection );
 
     formula::FormulaToken* AddRawToken( const ScRawToken& );
-    virtual bool AddFormulaToken(const com::sun::star::sheet::FormulaToken& _aToken,formula::ExternalReferenceHelper* _pRef);
+    virtual bool AddFormulaToken(
+        const css::sheet::FormulaToken& rToken,
+        svl::SharedStringPool& rSPool,
+        formula::ExternalReferenceHelper* _pRef);
     virtual void CheckToken( const formula::FormulaToken& r );
     virtual formula::FormulaToken* AddOpCode( OpCode eCode );
     /** ScSingleRefToken with ocPush. */
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index 1a9f869..ae5e098 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -40,7 +40,8 @@
 #include "editutil.hxx"
 #include "tokenarray.hxx"
 #include "refupdatecontext.hxx"
-#include "svl/sharedstring.hxx"
+#include <svl/sharedstring.hxx>
+#include <svl/sharedstringpool.hxx>
 
 using namespace formula;
 //------------------------------------------------------------------------
@@ -1306,7 +1307,10 @@ ScTokenArray* ScConditionEntry::CreateTokenArry( sal_uInt16 nIndex ) const
         {
             pRet = new ScTokenArray();
             if (bIsStr1)
-                pRet->AddString( aStrVal1 );
+            {
+                svl::SharedStringPool& rSPool = mpDoc->GetSharedStringPool();
+                pRet->AddString(rSPool.intern(aStrVal1));
+            }
             else
                 pRet->AddDouble( nVal1 );
         }
@@ -1319,7 +1323,10 @@ ScTokenArray* ScConditionEntry::CreateTokenArry( sal_uInt16 nIndex ) const
         {
             pRet = new ScTokenArray();
             if (bIsStr2)
-                pRet->AddString( aStrVal2 );
+            {
+                svl::SharedStringPool& rSPool = mpDoc->GetSharedStringPool();
+                pRet->AddString(rSPool.intern(aStrVal2));
+            }
             else
                 pRet->AddDouble( nVal2 );
         }
diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx
index cbd3a94..8f13db7 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -714,6 +714,7 @@ bool ScValidationData::GetSelectionFromFormula(
     }
 
     bool bHaveEmpty = false;
+    svl::SharedStringPool& rSPool = pDocument->GetSharedStringPool();
 
     /* XL artificially limits things to a single col or row in the UI but does
      * not list the constraint in MOOXml. If a defined name or INDIRECT
@@ -749,7 +750,7 @@ bool ScValidationData::GetSelectionFromFormula(
                     pEntry = new ScTypedStrData( aValStr, 0.0, ScTypedStrData::Standard);
 
                 if (!rCell.isEmpty() && rMatch < 0)
-                    aCondTokArr.AddString( aValStr );
+                    aCondTokArr.AddString(rSPool.intern(aValStr));
             }
             else
             {
@@ -877,6 +878,7 @@ bool ScValidationData::IsListValid( ScRefCellValue& rCell, const ScAddress& rPos
 
     // *** try if formula is a string list ***
 
+    svl::SharedStringPool& rSPool = GetDocument()->GetSharedStringPool();
     sal_uInt32 nFormat = lclGetCellFormat( *GetDocument(), rPos );
     ScStringTokenIterator aIt( *pTokArr );
     for (rtl_uString* pString = aIt.First(); pString && aIt.Ok(); pString = aIt.Next())
@@ -892,7 +894,7 @@ bool ScValidationData::IsListValid( ScRefCellValue& rCell, const ScAddress& rPos
             if (GetDocument()->GetFormatTable()->IsNumberFormat(aStr, nFormat, fValue))
                 aCondTokArr.AddDouble( fValue );
             else
-                aCondTokArr.AddString(aStr);
+                aCondTokArr.AddString(rSPool.intern(aStr));
 
             bIsValid = IsEqualToTokenArray(rCell, rPos, aCondTokArr);
         }
diff --git a/sc/source/core/tool/formulagroup.cxx b/sc/source/core/tool/formulagroup.cxx
index 736d48c..aa8d152 100644
--- a/sc/source/core/tool/formulagroup.cxx
+++ b/sc/source/core/tool/formulagroup.cxx
@@ -356,8 +356,11 @@ bool FormulaGroupInterpreterSoftware::interpret(ScDocument& rDoc, const ScAddres
                     }
 
                     if (pStr)
+                    {
                         // This is a string cell.
-                        aCode2.AddString(OUString(pStr));
+                        svl::SharedStringPool& rPool = rDoc.GetSharedStringPool();
+                        aCode2.AddString(rPool.intern(OUString(pStr)));
+                    }
                     else if (rtl::math::isNan(fVal))
                         // Value of NaN represents an empty cell.
                         aCode2.AddToken(ScEmptyCellToken(false, false));
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index ce6a644..320c42e 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1187,27 +1187,26 @@ bool ScHybridCellToken::operator==( const FormulaToken& r ) const
 
 
 
-//////////////////////////////////////////////////////////////////////////
-
-bool ScTokenArray::AddFormulaToken(const com::sun::star::sheet::FormulaToken& _aToken,formula::ExternalReferenceHelper* _pRef)
+bool ScTokenArray::AddFormulaToken(
+    const css::sheet::FormulaToken& rToken, svl::SharedStringPool& rSPool, formula::ExternalReferenceHelper* pExtRef)
 {
-    bool bError = FormulaTokenArray::AddFormulaToken(_aToken,_pRef);
+    bool bError = FormulaTokenArray::AddFormulaToken(rToken, rSPool, pExtRef);
     if ( bError )
     {
         bError = false;
-        const OpCode eOpCode = static_cast<OpCode>(_aToken.OpCode);      //! assuming equal values for the moment
+        const OpCode eOpCode = static_cast<OpCode>(rToken.OpCode);      //! assuming equal values for the moment
 
-        const uno::TypeClass eClass = _aToken.Data.getValueTypeClass();
+        const uno::TypeClass eClass = rToken.Data.getValueTypeClass();
         switch ( eClass )
         {
             case uno::TypeClass_STRUCT:
                 {
-                    uno::Type aType = _aToken.Data.getValueType();
+                    uno::Type aType = rToken.Data.getValueType();
                     if ( aType.equals( cppu::UnoType<sheet::SingleReference>::get() ) )
                     {
                         ScSingleRefData aSingleRef;
                         sheet::SingleReference aApiRef;
-                        _aToken.Data >>= aApiRef;
+                        rToken.Data >>= aApiRef;
                         lcl_SingleRefToCalc( aSingleRef, aApiRef );
                         if ( eOpCode == ocPush )
                             AddSingleReference( aSingleRef );
@@ -1220,7 +1219,7 @@ bool ScTokenArray::AddFormulaToken(const com::sun::star::sheet::FormulaToken& _a
                     {
                         ScComplexRefData aComplRef;
                         sheet::ComplexReference aApiRef;
-                        _aToken.Data >>= aApiRef;
+                        rToken.Data >>= aApiRef;
                         lcl_SingleRefToCalc( aComplRef.Ref1, aApiRef.Reference1 );
                         lcl_SingleRefToCalc( aComplRef.Ref2, aApiRef.Reference2 );
 
@@ -1232,7 +1231,7 @@ bool ScTokenArray::AddFormulaToken(const com::sun::star::sheet::FormulaToken& _a
                     else if ( aType.equals( cppu::UnoType<sheet::NameToken>::get() ) )
                     {
                         sheet::NameToken aTokenData;
-                        _aToken.Data >>= aTokenData;
+                        rToken.Data >>= aTokenData;
                         if ( eOpCode == ocName )
                             AddRangeName(aTokenData.Index, aTokenData.Global);
                         else if (eOpCode == ocDBArea)
@@ -1243,7 +1242,7 @@ bool ScTokenArray::AddFormulaToken(const com::sun::star::sheet::FormulaToken& _a
                     else if ( aType.equals( cppu::UnoType<sheet::ExternalReference>::get() ) )
                     {
                         sheet::ExternalReference aApiExtRef;
-                        if( (eOpCode == ocPush) && (_aToken.Data >>= aApiExtRef) && (0 <= aApiExtRef.Index) && (aApiExtRef.Index <= SAL_MAX_UINT16) )
+                        if( (eOpCode == ocPush) && (rToken.Data >>= aApiExtRef) && (0 <= aApiExtRef.Index) && (aApiExtRef.Index <= SAL_MAX_UINT16) )
                         {
                             sal_uInt16 nFileId = static_cast< sal_uInt16 >( aApiExtRef.Index );
                             sheet::SingleReference aApiSRef;
@@ -1253,7 +1252,7 @@ bool ScTokenArray::AddFormulaToken(const com::sun::star::sheet::FormulaToken& _a
                             {
                                 // try to resolve cache index to sheet name
                                 size_t nCacheId = static_cast< size_t >( aApiSRef.Sheet );
-                                OUString aTabName = _pRef->getCacheTableName( nFileId, nCacheId );
+                                OUString aTabName = pExtRef->getCacheTableName( nFileId, nCacheId );
                                 if( !aTabName.isEmpty() )
                                 {
                                     ScSingleRefData aSingleRef;
@@ -1268,7 +1267,7 @@ bool ScTokenArray::AddFormulaToken(const com::sun::star::sheet::FormulaToken& _a
                             {
                                 // try to resolve cache index to sheet name.
                                 size_t nCacheId = static_cast< size_t >( aApiCRef.Reference1.Sheet );
-                                OUString aTabName = _pRef->getCacheTableName( nFileId, nCacheId );
+                                OUString aTabName = pExtRef->getCacheTableName( nFileId, nCacheId );
                                 if( !aTabName.isEmpty() )
                                 {
                                     ScComplexRefData aComplRef;
@@ -1304,12 +1303,12 @@ bool ScTokenArray::AddFormulaToken(const com::sun::star::sheet::FormulaToken& _a
                 {
                     if ( eOpCode != ocPush )
                         bError = true;      // not an inline array
-                    else if (!_aToken.Data.getValueType().equals( getCppuType(
+                    else if (!rToken.Data.getValueType().equals( getCppuType(
                                     (uno::Sequence< uno::Sequence< uno::Any > > *)0)))
                         bError = true;      // unexpected sequence type
                     else
                     {
-                        ScMatrixRef xMat = ScSequenceToMatrix::CreateMixedMatrix( _aToken.Data);
+                        ScMatrixRef xMat = ScSequenceToMatrix::CreateMixedMatrix( rToken.Data);
                         if (xMat)
                             AddMatrix( xMat);
                         else
diff --git a/sc/source/filter/excel/excform.cxx b/sc/source/filter/excel/excform.cxx
index 644485f..1f1336e 100644
--- a/sc/source/filter/excel/excform.cxx
+++ b/sc/source/filter/excel/excform.cxx
@@ -181,10 +181,8 @@ void ImportExcel::Formula(
 }
 
 
-
-
-ExcelToSc::ExcelToSc( const XclImpRoot& rRoot ) :
-    ExcelConverterBase( 512 ),
+ExcelToSc::ExcelToSc( XclImpRoot& rRoot ) :
+    ExcelConverterBase(rRoot.GetDocImport().getDoc().GetSharedStringPool(), 512),
     XclImpRoot( rRoot ),
     maFuncProv( rRoot ),
     meBiff( rRoot.GetBiff() )
diff --git a/sc/source/filter/excel/excform8.cxx b/sc/source/filter/excel/excform8.cxx
index 9cc81da..f2c2938 100644
--- a/sc/source/filter/excel/excform8.cxx
+++ b/sc/source/filter/excel/excform8.cxx
@@ -79,9 +79,7 @@ ExcelToSc8::ExternalTabInfo::ExternalTabInfo() :
 {
 }
 
-// ============================================================================
-
-ExcelToSc8::ExcelToSc8( const XclImpRoot& rRoot ) :
+ExcelToSc8::ExcelToSc8( XclImpRoot& rRoot ) :
     ExcelToSc( rRoot ),
     rLinkMan( rRoot.GetLinkManager() )
 {
diff --git a/sc/source/filter/excel/frmbase.cxx b/sc/source/filter/excel/frmbase.cxx
index 6d167ff..d2179e0 100644
--- a/sc/source/filter/excel/frmbase.cxx
+++ b/sc/source/filter/excel/frmbase.cxx
@@ -167,7 +167,8 @@ const ScRange* _ScRangeListTabs::Next ()
     return &(*maItrCur);
 }
 
-ConverterBase::ConverterBase( sal_uInt16 nNewBuffer ) :
+ConverterBase::ConverterBase( svl::SharedStringPool& rSPool, sal_uInt16 nNewBuffer ) :
+    aPool(rSPool),
     aEingPos( 0, 0, 0 ),
     eStatus( ConvOK ),
     nBufferSize( nNewBuffer )
@@ -189,10 +190,8 @@ void ConverterBase::Reset()
 }
 
 
-
-
-ExcelConverterBase::ExcelConverterBase( sal_uInt16 nNewBuffer ) :
-    ConverterBase( nNewBuffer )
+ExcelConverterBase::ExcelConverterBase( svl::SharedStringPool& rSPool, sal_uInt16 nNewBuffer ) :
+    ConverterBase(rSPool, nNewBuffer)
 {
 }
 
@@ -213,10 +212,8 @@ void ExcelConverterBase::Reset()
 }
 
 
-
-
-LotusConverterBase::LotusConverterBase( SvStream &rStr, sal_uInt16 nNewBuffer ) :
-    ConverterBase( nNewBuffer ),
+LotusConverterBase::LotusConverterBase( SvStream &rStr, svl::SharedStringPool& rSPool, sal_uInt16 nNewBuffers ) :
+    ConverterBase(rSPool, nNewBuffers),
     aIn( rStr ),
     nBytesLeft( 0 )
 {
diff --git a/sc/source/filter/excel/tokstack.cxx b/sc/source/filter/excel/tokstack.cxx
index 5503409..1afbafa 100644
--- a/sc/source/filter/excel/tokstack.cxx
+++ b/sc/source/filter/excel/tokstack.cxx
@@ -17,14 +17,16 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <string.h>
 
-#include "compiler.hxx"
 #include "tokstack.hxx"
+#include "compiler.hxx"
 #include "global.hxx"
 #include "scmatrix.hxx"
 
+#include <svl/sharedstringpool.hxx>
+
 #include <stdio.h>
+#include <string.h>
 
 const sal_uInt16    TokenPool::nScTokenOff = 8192;
 
@@ -53,7 +55,8 @@ TokenStack::~TokenStack()
 //              -> Unterscheidung von anderen Token
 
 
-TokenPool::TokenPool( void )
+TokenPool::TokenPool( svl::SharedStringPool& rSPool ) :
+    mrStringPool(rSPool)
 {
     sal_uInt16  nLauf = nScTokenOff;
 
@@ -394,7 +397,7 @@ bool TokenPool::GetElement( const sal_uInt16 nId )
                     sal_uInt16 n = pElement[ nId ];
                     OUString* p = ( n < nP_Str )? ppP_Str[ n ] : NULL;
                     if (p)
-                        pScToken->AddString( *p );
+                        pScToken->AddString(mrStringPool.intern(*p));
                     else
                         bRet = false;
                 }
diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx
index 09a9c5c..edfe61e 100644
--- a/sc/source/filter/excel/xicontent.cxx
+++ b/sc/source/filter/excel/xicontent.cxx
@@ -825,7 +825,7 @@ void XclImpValidationManager::ReadDV( XclImpStream& rStrm )
 
     // process string list of a list validity (convert to list of string tokens)
     if( xTokArr1.get() && (eValMode == SC_VALID_LIST) && ::get_flag( nFlags, EXC_DV_STRINGLIST ) )
-        XclTokenArrayHelper::ConvertStringToList( *xTokArr1, '\n', true );
+        XclTokenArrayHelper::ConvertStringToList(*xTokArr1, rDoc.GetSharedStringPool(), '\n', true);
 
     maDVItems.push_back(
         new DVItem(aScRanges, ScValidationData(eValMode, eCondMode, xTokArr1.get(), xTokArr2.get(), &rDoc, rScRange.aStart)));
diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx
index a803af1..f486914 100644
--- a/sc/source/filter/excel/xlformula.cxx
+++ b/sc/source/filter/excel/xlformula.cxx
@@ -28,6 +28,7 @@
 #include "xlroot.hxx"
 
 #include <comphelper/string.hxx>
+#include <svl/sharedstringpool.hxx>
 
 using namespace ::formula;
 
@@ -821,7 +822,8 @@ bool XclTokenArrayHelper::GetStringList( OUString& rStringList, const ScTokenArr
     return bRet;
 }
 
-void XclTokenArrayHelper::ConvertStringToList( ScTokenArray& rScTokArr, sal_Unicode cStringSep, bool bTrimLeadingSpaces )
+void XclTokenArrayHelper::ConvertStringToList(
+    ScTokenArray& rScTokArr, svl::SharedStringPool& rSPool, sal_Unicode cStringSep, bool bTrimLeadingSpaces )
 {
     OUString aString;
     if( GetString( aString, rScTokArr ) )
@@ -836,7 +838,7 @@ void XclTokenArrayHelper::ConvertStringToList( ScTokenArray& rScTokArr, sal_Unic
                 aToken = comphelper::string::stripStart(aToken, ' ');
             if( nToken > 0 )
                 rScTokArr.AddOpCode( ocSep );
-            rScTokArr.AddString( aToken );
+            rScTokArr.AddString(rSPool.intern(aToken));
         }
     }
 }
diff --git a/sc/source/filter/inc/XclImpChangeTrack.hxx b/sc/source/filter/inc/XclImpChangeTrack.hxx
index 307cace..ffce967 100644
--- a/sc/source/filter/inc/XclImpChangeTrack.hxx
+++ b/sc/source/filter/inc/XclImpChangeTrack.hxx
@@ -165,22 +165,10 @@ private:
     virtual bool                Read3DTabReference( sal_uInt16 nIxti, SCTAB& rFirstTab, SCTAB& rLastTab, ExternalTabInfo& rExtInfo );
 
 public:
-    inline                      XclImpChTrFmlConverter(
-                                    const XclImpRoot& rRoot,
-                                    XclImpChangeTrack& rXclChTr );
+    XclImpChTrFmlConverter( XclImpRoot& rRoot, XclImpChangeTrack& rXclChTr );
     virtual                     ~XclImpChTrFmlConverter();
 };
 
-inline XclImpChTrFmlConverter::XclImpChTrFmlConverter(
-        const XclImpRoot& rRoot,
-        XclImpChangeTrack& rXclChTr ) :
-    ExcelToSc8( rRoot ),
-    rChangeTrack( rXclChTr )
-{
-}
-
-//___________________________________________________________________
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/inc/excform.hxx b/sc/source/filter/inc/excform.hxx
index ed59df7..131aacc 100644
--- a/sc/source/filter/inc/excform.hxx
+++ b/sc/source/filter/inc/excform.hxx
@@ -49,7 +49,7 @@ protected:
     void                ExcRelToScRel( sal_uInt16 nRow, sal_uInt8 nCol, ScSingleRefData&, const sal_Bool bName );
 
 public:
-                        ExcelToSc( const XclImpRoot& rRoot );
+    ExcelToSc( XclImpRoot& rRoot );
     virtual             ~ExcelToSc();
     virtual ConvErr     Convert( const ScTokenArray*&, XclImpStream& rStrm, sal_Size nFormulaLen,
                                  bool bAllowArrays, const FORMULA_TYPE eFT = FT_CellFormula );
@@ -126,7 +126,7 @@ private:
 
     bool                HandleOleLink(sal_uInt16 nXtiIndex, const XclImpExtName& rExtName, ExternalTabInfo& rExtInfo);
 public:
-                        ExcelToSc8( const XclImpRoot& rRoot );
+    ExcelToSc8( XclImpRoot& rRoot );
     virtual             ~ExcelToSc8();
 
     virtual ConvErr     Convert( const ScTokenArray*& rpTokArray, XclImpStream& rStrm, sal_Size nFormulaLen, bool bAllowArrays, const FORMULA_TYPE eFT = FT_CellFormula );
diff --git a/sc/source/filter/inc/formel.hxx b/sc/source/filter/inc/formel.hxx
index faf61b7..b87c0d0 100644
--- a/sc/source/filter/inc/formel.hxx
+++ b/sc/source/filter/inc/formel.hxx
@@ -31,6 +31,12 @@
 #include <boost/ptr_container/ptr_map.hpp>
 #include <vector>
 
+namespace svl {
+
+class SharedStringPool;
+
+}
+
 class XclImpStream;
 class ScTokenArray;
 struct ScSingleRefData;
@@ -84,7 +90,7 @@ protected:
     sal_Char*           pBuffer;        // universal buffer
     sal_uInt16              nBufferSize;    // ...and its size
 
-                        ConverterBase( sal_uInt16 nNewBuffer );
+    ConverterBase( svl::SharedStringPool& rSPool, sal_uInt16 nNewBuffer );
     virtual             ~ConverterBase();
 
     void                Reset();
@@ -95,7 +101,7 @@ protected:
 class ExcelConverterBase : public ConverterBase
 {
 protected:
-                        ExcelConverterBase( sal_uInt16 nNewBuffer );
+    ExcelConverterBase( svl::SharedStringPool& rSPool, sal_uInt16 nNewBuffer );
     virtual             ~ExcelConverterBase();
 
 public:
@@ -124,7 +130,7 @@ protected:
     inline void         Read( double& fDouble );
         inline void                     Read( sal_uInt32& nUINT32 );
 
-                        LotusConverterBase( SvStream& rStr, sal_uInt16 nNewBuffer );
+    LotusConverterBase( SvStream& rStr, svl::SharedStringPool& rSPool, sal_uInt16 nNewBuffer );
     virtual             ~LotusConverterBase();
 
 public:
diff --git a/sc/source/filter/inc/lotform.hxx b/sc/source/filter/inc/lotform.hxx
index f805edb..ce5bf95 100644
--- a/sc/source/filter/inc/lotform.hxx
+++ b/sc/source/filter/inc/lotform.hxx
@@ -88,7 +88,8 @@ private:
     void                NegToken( TokenId& rParam );
                         // ACHTUNG: wie ~, nur wird '-(<rParam>)' gebildet
 public:
-                        LotusToSc( SvStream& aStr, rtl_TextEncoding eSrc, sal_Bool b );
+    LotusToSc( SvStream& aStr, svl::SharedStringPool& rSPool, rtl_TextEncoding eSrc, bool b );
+
     virtual ConvErr     Convert( const ScTokenArray*& rpErg, sal_Int32& nRest,
                                     const FORMULA_TYPE eFT = FT_CellFormula );
 
diff --git a/sc/source/filter/inc/qproform.hxx b/sc/source/filter/inc/qproform.hxx
index 0ae50df..131d49c 100644
--- a/sc/source/filter/inc/qproform.hxx
+++ b/sc/source/filter/inc/qproform.hxx
@@ -54,16 +54,16 @@ enum FUNC_TYPE
 
 class QProToSc : public ConverterBase
 {
-    private:
+private:
     TokenId mnAddToken;
     TokenId mnSubToken;
     TokenId mn0Token;
     SvStream& maIn;
 
-    public:
+public:
     static const size_t nBufSize = 256;
-    QProToSc( SvStream &aStr, const ScAddress& rRefPos );
-    ~QProToSc(){ };
+    QProToSc( SvStream &aStr, svl::SharedStringPool& rSPool, const ScAddress& rRefPos );
+    virtual ~QProToSc(){ };
     ConvErr Convert( const ScTokenArray*& pArray, sal_uInt16 nLen,
                                                                          const FORMULA_TYPE eFT = FT_CellFormula );
     void DoFunc( DefTokenId eOc, sal_uInt16 nArgs, const sal_Char* pExtString );
diff --git a/sc/source/filter/inc/tokstack.hxx b/sc/source/filter/inc/tokstack.hxx
index fd1f031..4ada6a0 100644
--- a/sc/source/filter/inc/tokstack.hxx
+++ b/sc/source/filter/inc/tokstack.hxx
@@ -26,6 +26,12 @@
 
 #include <vector>
 
+namespace svl {
+
+class SharedStringPool;
+
+}
+
 typedef OpCode DefTokenId;
 // in PRODUCT version: ambiguity between OpCode (being sal_uInt16) and UINT16
 // Unfortunately a typedef is just a dumb alias and not a real type ...
@@ -80,7 +86,9 @@ class TokenPool
 {
     // !ACHTUNG!: externe Id-Basis ist 1, interne 0!
     // Ausgabe Id = 0 -> Fehlerfall
-    private:
+private:
+    svl::SharedStringPool& mrStringPool;
+
         OUString**                      ppP_Str;    // Pool fuer Strings
         sal_uInt16                      nP_Str;     // ...mit Groesse
         sal_uInt16                      nP_StrAkt;  // ...und Schreibmarke
@@ -186,8 +194,8 @@ class TokenPool
 		bool						GrowMatrix( void );
 		bool						GetElement( const sal_uInt16 nId );
 		bool						GetElementRek( const sal_uInt16 nId );
-    public:
-                                    TokenPool( void );
+public:
+    TokenPool( svl::SharedStringPool& rSPool );
                                     ~TokenPool();
         inline TokenPool&           operator <<( const TokenId nId );
         inline TokenPool&           operator <<( const DefTokenId eId );
diff --git a/sc/source/filter/inc/xlformula.hxx b/sc/source/filter/inc/xlformula.hxx
index 7688220..6ff8c79 100644
--- a/sc/source/filter/inc/xlformula.hxx
+++ b/sc/source/filter/inc/xlformula.hxx
@@ -26,6 +26,12 @@
 #include "ftools.hxx"
 #include <boost/shared_ptr.hpp>
 
+namespace svl {
+
+class SharedStringPool;
+
+}
+
 // Constants ==================================================================
 
 const size_t EXC_TOKARR_MAXLEN              = 4096;     /// Maximum size of a token array.
@@ -530,7 +536,8 @@ public:
         @param rScTokArr  (in/out-parameter) The token array to modify.
         @param cStringSep  The separator in the source string.
         @param bTrimLeadingSpaces  true = remove leading spaces from each token. */
-    static void         ConvertStringToList( ScTokenArray& rScTokArr, sal_Unicode cStringSep, bool bTrimLeadingSpaces );
+    static void ConvertStringToList(
+        ScTokenArray& rScTokArr, svl::SharedStringPool& rSPool, sal_Unicode cStringSep, bool bTrimLeadingSpaces );
 
     // multiple operations ----------------------------------------------------
 
diff --git a/sc/source/filter/lotus/lotform.cxx b/sc/source/filter/lotus/lotform.cxx
index c230710..da0ba0f 100644
--- a/sc/source/filter/lotus/lotform.cxx
+++ b/sc/source/filter/lotus/lotform.cxx
@@ -341,8 +341,8 @@ void LotusToSc::Reset( const ScAddress& rEingPos )
 }
 
 
-LotusToSc::LotusToSc( SvStream &rStream, rtl_TextEncoding e, sal_Bool b ) :
-    LotusConverterBase( rStream, 128 )
+LotusToSc::LotusToSc( SvStream &rStream, svl::SharedStringPool& rSPool, rtl_TextEncoding e, bool b ) :
+    LotusConverterBase(rStream, rSPool, 128)
 {
     eSrcChar = e;
     bWK3 = false;
diff --git a/sc/source/filter/lotus/lotimpop.cxx b/sc/source/filter/lotus/lotimpop.cxx
index f8fc773..5f3ed5c 100644
--- a/sc/source/filter/lotus/lotimpop.cxx
+++ b/sc/source/filter/lotus/lotimpop.cxx
@@ -64,11 +64,12 @@ LOTUS_ROOT::~LOTUS_ROOT()
 
 static osl::Mutex aLotImpSemaphore;
 
-
-ImportLotus::ImportLotus( SvStream& aStream, ScDocument* pDoc, rtl_TextEncoding eQ ) :
-    ImportTyp( pDoc, eQ ),
-    pIn( &aStream ),
-    aConv( *pIn, eQ, false )
+ImportLotus::ImportLotus( SvStream& aStream, ScDocument* pDoc, rtl_TextEncoding eQ )
+    : ImportTyp(pDoc, eQ)
+    , pIn(&aStream)
+    , aConv(*pIn, pDoc->GetSharedStringPool(), eQ, false)
+    , nTab(0)
+    , nExtTab(0)
 {
     // good point to start locking of import lotus
     aLotImpSemaphore.acquire();
diff --git a/sc/source/filter/lotus/op.cxx b/sc/source/filter/lotus/op.cxx
index c42211d..b994a0d 100644
--- a/sc/source/filter/lotus/op.cxx
+++ b/sc/source/filter/lotus/op.cxx
@@ -163,7 +163,8 @@ void OP_Formula( SvStream& r, sal_uInt16 /*n*/ )
     sal_Int32               nBytesLeft = nFormulaSize;
     ScAddress           aAddress( static_cast<SCCOL> (nCol), static_cast<SCROW> (nRow), nTab );
 
-    LotusToSc           aConv( r, pLotusRoot->eCharsetQ, false );
+    svl::SharedStringPool& rSPool = pLotusRoot->pDoc->GetSharedStringPool();
+    LotusToSc aConv(r, rSPool, pLotusRoot->eCharsetQ, false);
     aConv.Reset( aAddress );
     aConv.Convert( pErg, nBytesLeft );
 
@@ -407,7 +408,8 @@ void OP_Formula123( SvStream& r, sal_uInt16 n )
     sal_Int32 nBytesLeft = (n > 12) ? n - 12 : 0;
     ScAddress aAddress( nCol, nRow, nTab );
 
-    LotusToSc aConv( r, pLotusRoot->eCharsetQ, sal_True );
+    svl::SharedStringPool& rSPool = pLotusRoot->pDoc->GetSharedStringPool();
+    LotusToSc aConv(r, rSPool, pLotusRoot->eCharsetQ, true);
     aConv.Reset( aAddress );
     aConv.Convert( pErg, nBytesLeft );
 
diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx
index d14ff5d..c34fedd 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -35,6 +35,7 @@
 #include <com/sun/star/table/XCellRange.hpp>
 #include <rtl/ustrbuf.hxx>
 #include <svl/intitem.hxx>
+#include <svl/sharedstringpool.hxx>
 #include "oox/helper/attributelist.hxx"
 #include "oox/helper/containerhelper.hxx"
 #include "oox/helper/propertyset.hxx"
@@ -807,7 +808,8 @@ void CondFormatRule::finalizeImport()
     {
         ScDocument& rDoc = getScDocument();
         ScTokenArray aTokenArray;
-        aTokenArray.AddString(maModel.maText);
+        svl::SharedStringPool& rSPool = rDoc.GetSharedStringPool();
+        aTokenArray.AddString(rSPool.intern(maModel.maText));
         OUString aStyleName = getStyles().createDxfStyle( maModel.mnDxfId );
         ScCondFormatEntry* pNewEntry = new ScCondFormatEntry( eOperator, &aTokenArray, NULL, &rDoc, aPos, aStyleName );
         mpFormat->AddEntry(pNewEntry);
diff --git a/sc/source/filter/qpro/qpro.cxx b/sc/source/filter/qpro/qpro.cxx
index fc651eb..c370492 100644
--- a/sc/source/filter/qpro/qpro.cxx
+++ b/sc/source/filter/qpro/qpro.cxx
@@ -99,13 +99,16 @@ FltError ScQProReader::readSheet( SCTAB nTab, ScDocument* pDoc, ScQProStyle *pSt
                 }
                 break;
 
-            case 0x0010:{ // Formula cell
+            case 0x0010:
+            {
+                // Formula cell
                 double nValue;
                 sal_uInt16 nState, nLen;
                 *mpStream >> nCol >> nDummy >> nRow >> nStyle >> nValue >> nState >> nLen;
                 ScAddress aAddr( nCol, nRow, nTab );
                 const ScTokenArray *pArray;
-                QProToSc aConv( *mpStream, aAddr );
+
+                QProToSc aConv(*mpStream, pDoc->GetSharedStringPool(), aAddr);
                 if (ConvOK != aConv.Convert( pArray, nLen ))
                     eRet = eERR_FORMAT;
                 else
@@ -117,8 +120,8 @@ FltError ScQProReader::readSheet( SCTAB nTab, ScDocument* pDoc, ScQProStyle *pSt
                     pDoc->EnsureTable(nTab);
                     pDoc->SetFormulaCell(ScAddress(nCol,nRow,nTab), pFormula);
                 }
-                }
-                break;
+            }
+            break;
         }
     }
     return eRet;
diff --git a/sc/source/filter/qpro/qproform.cxx b/sc/source/filter/qpro/qproform.cxx
index 91399bb..90a185b 100644
--- a/sc/source/filter/qpro/qproform.cxx
+++ b/sc/source/filter/qpro/qproform.cxx
@@ -65,8 +65,8 @@ void QProToSc::ReadSRD( ScSingleRefData& rSRD, sal_Int8 nPage, sal_Int8 nCol, sa
         rSRD.SetFlag3D(true);
 }
 
-QProToSc::QProToSc( SvStream& rStream, const ScAddress& rRefPos ) :
-    ConverterBase( 128 ),
+QProToSc::QProToSc( SvStream& rStream, svl::SharedStringPool& rSPool, const ScAddress& rRefPos ) :
+    ConverterBase(rSPool, 128),
     maIn( rStream )
 {
     aEingPos = rRefPos;
diff --git a/sc/source/filter/xcl97/XclImpChangeTrack.cxx b/sc/source/filter/xcl97/XclImpChangeTrack.cxx
index 4892861..58c2540 100644
--- a/sc/source/filter/xcl97/XclImpChangeTrack.cxx
+++ b/sc/source/filter/xcl97/XclImpChangeTrack.cxx
@@ -500,6 +500,11 @@ void XclImpChangeTrack::Apply()
 //___________________________________________________________________
 // class XclImpChTrFmlConverter
 
+XclImpChTrFmlConverter::XclImpChTrFmlConverter(
+    XclImpRoot& rRoot, XclImpChangeTrack& rXclChTr ) :
+    ExcelToSc8( rRoot ),
+    rChangeTrack( rXclChTr ) {}
+
 XclImpChTrFmlConverter::~XclImpChTrFmlConverter()
 {
 }
diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx
index 1503a8c..d93c29c 100644
--- a/sc/source/ui/formdlg/formula.cxx
+++ b/sc/source/ui/formdlg/formula.cxx
@@ -664,7 +664,7 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH
 ::std::auto_ptr<formula::FormulaTokenArray> ScFormulaDlg::convertToTokenArray(const uno::Sequence< sheet::FormulaToken >& _aTokenList)
 {
     ::std::auto_ptr<formula::FormulaTokenArray> pArray(new ScTokenArray());
-    pArray->Fill( _aTokenList, pDoc->GetExternalRefManager());
+    pArray->Fill(_aTokenList, pDoc->GetSharedStringPool(), pDoc->GetExternalRefManager());
     return pArray;
 }
 // for mysterious reasons Apple llvm-g++ 4.2.1 needs these explicit
diff --git a/sc/source/ui/unoobj/funcuno.cxx b/sc/source/ui/unoobj/funcuno.cxx
index 174b6a6..a36663f 100644
--- a/sc/source/ui/unoobj/funcuno.cxx
+++ b/sc/source/ui/unoobj/funcuno.cxx
@@ -19,6 +19,7 @@
 
 #include <sfx2/app.hxx>
 #include <svl/itemprop.hxx>
+#include <svl/sharedstringpool.hxx>
 
 #include "scitems.hxx"
 #include "funcuno.hxx"
@@ -539,6 +540,7 @@ uno::Any SAL_CALL ScFunctionAccess::callFunction( const OUString& aName,
     long nArgCount = aArguments.getLength();
     const uno::Any* pArgArr = aArguments.getConstArray();
 
+    svl::SharedStringPool& rSPool = pDoc->GetSharedStringPool();
     aTokenArr.AddOpCode(ocOpen);
     for (long nPos=0; nPos<nArgCount; nPos++)
     {
@@ -568,7 +570,7 @@ uno::Any SAL_CALL ScFunctionAccess::callFunction( const OUString& aName,
         {
             OUString aUStr;
             rArg >>= aUStr;
-            aTokenArr.AddString( aUStr );
+            aTokenArr.AddString(rSPool.intern(aUStr));
         }
         else if ( aType.equals( getCppuType( (uno::Sequence< uno::Sequence<sal_Int16> > *)0 ) ) )
         {
diff --git a/sc/source/ui/unoobj/tokenuno.cxx b/sc/source/ui/unoobj/tokenuno.cxx
index ff1b417..3717f25 100644
--- a/sc/source/ui/unoobj/tokenuno.cxx
+++ b/sc/source/ui/unoobj/tokenuno.cxx
@@ -369,7 +369,7 @@ static void lcl_SingleRefToApi( sheet::SingleReference& rAPI, const ScSingleRefD
 bool ScTokenConversion::ConvertToTokenArray( ScDocument& rDoc,
         ScTokenArray& rTokenArray, const uno::Sequence<sheet::FormulaToken>& rSequence )
 {
-    return !rTokenArray.Fill(rSequence,rDoc.GetExternalRefManager());
+    return !rTokenArray.Fill(rSequence, rDoc.GetSharedStringPool(), rDoc.GetExternalRefManager());
 }
 
 bool ScTokenConversion::ConvertToTokenSequence( const ScDocument& rDoc,
commit f1384b44c7673578459c3898f987e04ef36e67a8
Author: David Tardon <dtardon at redhat.com>
Date:   Tue Apr 15 12:24:09 2014 +0200

    upload libetonyek 0.0.4
    
    (cherry picked from commit d24634a6d4046db208428eb999012c03bd9a5c48)
    
    Conflicts:
    	external/libetonyek/UnpackedTarball_libetonyek.mk
    
    Change-Id: I64a35ca0902ba40a4fba3080181147b4facac2ee
    Reviewed-on: https://gerrit.libreoffice.org/9009
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/download.lst b/download.lst
index b712321..f051ec4 100644
--- a/download.lst
+++ b/download.lst
@@ -10,8 +10,8 @@ COINMP_MD5SUM := 1cce53bf4b40ae29790d2c5c9f8b1129
 export COINMP_TARBALL := CoinMP-1.7.6.tgz
 EBOOK_MD5SUM := 2f1ceaf2ac8752ed278e175447d9b978
 export EBOOK_TARBALL := libe-book-0.0.3.tar.bz2
-ETONYEK_MD5SUM := 9dad826726da4d4ad60084968691f5f4
-export ETONYEK_TARBALL := libetonyek-0.0.3.tar.bz2
+ETONYEK_MD5SUM := 3c50bc60394d1f2675fbf9bd22581363
+export ETONYEK_TARBALL := libetonyek-0.0.4.tar.bz2
 FREEHAND_MD5SUM := 496dd00028afcc19f896b01394769043
 export FREEHAND_TARBALL := libfreehand-0.0.0.tar.bz2
 MSPUB_MD5SUM := 1120705cd0f0d9bd5506360bf57b6c2e
diff --git a/external/libetonyek/0001-Comma-at-the-end-of-emum-list.patch.1 b/external/libetonyek/0001-Comma-at-the-end-of-emum-list.patch.1
deleted file mode 100644
index 816039b..0000000
--- a/external/libetonyek/0001-Comma-at-the-end-of-emum-list.patch.1
+++ /dev/null
@@ -1,26 +0,0 @@
-From c2065764ae0826409f1dd683e52b7ca65f092972 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Fridrich=20=C5=A0trba?= <fridrich.strba at bluewin.ch>
-Date: Fri, 6 Dec 2013 18:35:28 +0100
-Subject: [PATCH] Comma at the end of emum list
-
-Change-Id: I1370488e5bf682e23a923f37c09e76081aee7493
----
- src/lib/KEYEnum.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/lib/KEYEnum.h b/src/lib/KEYEnum.h
-index f0e027f..9e5e61f 100644
---- a/src/lib/KEYEnum.h
-+++ b/src/lib/KEYEnum.h
-@@ -33,7 +33,7 @@ enum KEYCapitalization
-   KEY_CAPITALIZATION_NONE,
-   KEY_CAPITALIZATION_ALL_CAPS,
-   KEY_CAPITALIZATION_SMALL_CAPS,
--  KEY_CAPITALIZATION_TITLE,
-+  KEY_CAPITALIZATION_TITLE
- };
- 
- }
--- 
-1.8.4.2
-
diff --git a/external/libetonyek/UnpackedTarball_libetonyek.mk b/external/libetonyek/UnpackedTarball_libetonyek.mk
index d452574..52e6a95 100644
--- a/external/libetonyek/UnpackedTarball_libetonyek.mk
+++ b/external/libetonyek/UnpackedTarball_libetonyek.mk
@@ -11,8 +11,4 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,libetonyek))
 
 $(eval $(call gb_UnpackedTarball_set_tarball,libetonyek,$(ETONYEK_TARBALL)))
 
-$(eval $(call gb_UnpackedTarball_add_patches,libetonyek,\
-	external/libetonyek/0001-Comma-at-the-end-of-emum-list.patch.1 \
-))
-
 # vim: set noet sw=4 ts=4:
commit 09b9d9590860fdc4cf7c2b14049fe52564d47303
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Mon Apr 14 11:23:23 2014 -0400

    fdo#77209: Share string pool with clip documents.
    
    We do the same with undo documents, and it will only make sense to do
    the same with clip documents as well.  Also, put the sharing part into
    a common method (for ease of tracking).
    
    (cherry picked from commit 8f403051968298fbabd61de82fbb6a77762c83cc)
    
    Conflicts:
    	sc/inc/document.hxx
    
    Change-Id: I342b22d95374ee06d16318a66ffea0ac5b42621c
    Reviewed-on: https://gerrit.libreoffice.org/9005
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index b4e86f3..8c8cbf1 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -2123,6 +2123,7 @@ private: // CLOOK-Impl-methods
 
     std::map< SCTAB, ScSortParam > mSheetSortParams;
 
+    void SharePooledResources( ScDocument* pSrcDoc );
 };
 inline void ScDocument::GetSortParam( ScSortParam& rParam, SCTAB nTab )
 {
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index daa4e2a..eb3eab2 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -478,7 +478,7 @@ void ScDocument::InitClipPtrs( ScDocument* pSourceDoc )
 
     Clear();
 
-    xPoolHelper = pSourceDoc->xPoolHelper;
+    SharePooledResources(pSourceDoc);
 
     //  bedingte Formate / Gueltigkeiten
     //! Vorlagen kopieren?
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 90128ef..bc66735 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -1831,8 +1831,7 @@ void ScDocument::InitUndoSelected( ScDocument* pSrcDoc, const ScMarkData& rTabSe
     {
         Clear();
 
-        xPoolHelper = pSrcDoc->xPoolHelper;
-
+        SharePooledResources(pSrcDoc);
 
         OUString aString;
         for (SCTAB nTab = 0; nTab <= rTabSelection.GetLastSelected(); nTab++)
@@ -1867,8 +1866,7 @@ void ScDocument::InitUndo( ScDocument* pSrcDoc, SCTAB nTab1, SCTAB nTab2,
         Clear();
 
         // Undo document shares its pooled resources with the source document.
-        xPoolHelper = pSrcDoc->xPoolHelper;
-        mpCellStringPool = pSrcDoc->mpCellStringPool;
+        SharePooledResources(pSrcDoc);
 
         if (pSrcDoc->pShell->GetMedium())
             maFileURL = pSrcDoc->pShell->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DECODE_TO_IURI);
diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx
index ba95499..823f992 100644
--- a/sc/source/core/data/document10.cxx
+++ b/sc/source/core/data/document10.cxx
@@ -16,6 +16,7 @@
 #include <editutil.hxx>
 #include <listenercontext.hxx>
 #include <tokenstringcontext.hxx>
+#include <poolhelp.hxx>
 
 // Add totally brand-new methods to this source file.
 
@@ -67,4 +68,10 @@ void ScDocument::PostprocessRangeNameUpdate()
     }
 }
 
+void ScDocument::SharePooledResources( ScDocument* pSrcDoc )
+{
+    xPoolHelper = pSrcDoc->xPoolHelper;
+    mpCellStringPool = pSrcDoc->mpCellStringPool;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit f12e090020c2095390d1b441c7a89180b8ca315b
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Fri Apr 11 23:07:49 2014 -0400

    fdo#74087: Inspect if a mis-spelled word is at cursor position...
    
    then decide whether to launch a spell candidate menu or a regular context
    menu.
    
    (cherry picked from commit cd22c3442389f69fc1cc14dd07b17f5a59498e5e)
    
    Conflicts:
    	sc/source/ui/view/gridwin.cxx
    
    Change-Id: Ib121e9c6729e068c70ff216391f863639aa01951
    Reviewed-on: https://gerrit.libreoffice.org/8943
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index 5ac059c..f67e1f6 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -274,6 +274,8 @@ class ScGridWindow : public Window, public DropTargetHelper, public DragSourceHe
     bool            GetEditUrl( const Point& rPos,
                                 OUString* pName=0, OUString* pUrl=0, OUString* pTarget=0 );
 
+    bool IsSpellErrorAtPos( const Point& rPos, SCCOL nCol1, SCCOL nCol2, SCROW nRow );
+
     bool            HitRangeFinder( const Point& rMouse, RfCorner& rCorner, sal_uInt16* pIndex = NULL,
                                     SCsCOL* pAddX = NULL, SCsROW* pAddY = NULL );
 
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index c7342e4..c49d9ea 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -135,6 +135,7 @@
 
 #include <vector>
 #include <boost/scoped_ptr.hpp>
+#include <boost/shared_ptr.hpp>
 
 using namespace com::sun::star;
 using ::com::sun::star::uno::Sequence;
@@ -2950,6 +2951,10 @@ void ScGridWindow::Command( const CommandEvent& rCEvt )
         SCsROW nCellY = -1;
         pViewData->GetPosFromPixel(aPosPixel.X(), aPosPixel.Y(), eWhich, nCellX, nCellY);
 
+        bool bSpellError = false;
+        SCCOL nColSpellError = nCellX;
+        ScRefCellValue aSpellCheckCell;
+
         if ( bMouse )
         {
             ScDocument* pDoc = pViewData->GetDocument();
@@ -2972,14 +2977,39 @@ void ScGridWindow::Command( const CommandEvent& rCEvt )
                 // Selecting this cell is not allowed, neither is context menu.
                 return;
 
+            if (mpSpellCheckCxt)
+            {
+                // Find the first string to the left for spell checking in case the current cell is empty.
+                ScAddress aPos(nCellX, nCellY, nTab);
+                aSpellCheckCell.assign(*pDoc, aPos);
+                while (aSpellCheckCell.meType == CELLTYPE_NONE)
+                {
+                    // Loop until we get the first non-empty cell in the row.
+                    aPos.IncCol(-1);
+                    if (aPos.Col() < 0)
+                        break;
+
+                    aSpellCheckCell.assign(*pDoc, aPos);
+                }
+
+                if (aPos.Col() >= 0 && (aSpellCheckCell.meType == CELLTYPE_STRING || aSpellCheckCell.meType == CELLTYPE_EDIT))
+                    nColSpellError = aPos.Col();
+
+                bSpellError = (mpSpellCheckCxt->isMisspelled(nColSpellError, nCellY));
+                if (bSpellError)
+                {
+                    // Check and see if a misspelled word is under the mouse pointer.
+                    bSpellError = IsSpellErrorAtPos(aPosPixel, nColSpellError, nCellX, nCellY);
+                }
+            }
+
             //  #i18735# First select the item under the mouse pointer.
             //  This can change the selection, and the view state (edit mode, etc).
-            SelectForContextMenu( aPosPixel, nCellX, nCellY );
+            SelectForContextMenu(aPosPixel, bSpellError ? nColSpellError : nCellX, nCellY);
         }
 
-        sal_Bool bDone = false;
-        sal_Bool bEdit = pViewData->HasEditView(eWhich);
-        bool bSpellError = (mpSpellCheckCxt && mpSpellCheckCxt->isMisspelled(nCellX, nCellY));
+        bool bDone = false;
+        bool bEdit = pViewData->HasEditView(eWhich);
 
         if ( !bEdit )
         {
@@ -5114,7 +5144,53 @@ void ScGridWindow::RFMouseMove( const MouseEvent& rMEvt, sal_Bool bUp )
         pViewData->GetView()->ResetTimer();
 }
 
-//------------------------------------------------------------------------
+namespace {
+
+SvxAdjust toSvxAdjust( const ScPatternAttr& rPat )
+{
+    SvxCellHorJustify eHorJust =
+        static_cast<SvxCellHorJustify>(
+            static_cast<const SvxHorJustifyItem&>(rPat.GetItem(ATTR_HOR_JUSTIFY)).GetValue());
+
+    SvxAdjust eSvxAdjust = SVX_ADJUST_LEFT;
+    switch (eHorJust)
+    {
+        case SVX_HOR_JUSTIFY_LEFT:
+        case SVX_HOR_JUSTIFY_REPEAT:            // nicht implementiert
+        case SVX_HOR_JUSTIFY_STANDARD:          // always Text if an EditCell type
+                eSvxAdjust = SVX_ADJUST_LEFT;
+                break;
+        case SVX_HOR_JUSTIFY_RIGHT:
+                eSvxAdjust = SVX_ADJUST_RIGHT;
+                break;
+        case SVX_HOR_JUSTIFY_CENTER:
+                eSvxAdjust = SVX_ADJUST_CENTER;
+                break;
+        case SVX_HOR_JUSTIFY_BLOCK:
+                eSvxAdjust = SVX_ADJUST_BLOCK;
+                break;
+    }
+
+    return eSvxAdjust;
+}
+
+boost::shared_ptr<ScFieldEditEngine> createEditEngine( ScDocShell* pDocSh, const ScPatternAttr& rPat )
+{
+    ScDocument* pDoc = pDocSh->GetDocument();
+
+    boost::shared_ptr<ScFieldEditEngine> pEngine(new ScFieldEditEngine(pDoc, pDoc->GetEditPool()));
+    ScSizeDeviceProvider aProv(pDocSh);
+    pEngine->SetRefDevice(aProv.GetDevice());
+    pEngine->SetRefMapMode(MAP_100TH_MM);
+    SfxItemSet aDefault = pEngine->GetEmptyItemSet();
+    rPat.FillEditItemSet(&aDefault);
+    aDefault.Put( SvxAdjustItem(toSvxAdjust(rPat), EE_PARA_JUST) );
+    pEngine->SetDefaults(aDefault);
+
+    return pEngine;
+}
+
+}
 
 bool ScGridWindow::GetEditUrl( const Point& rPos,
                                OUString* pName, OUString* pUrl, OUString* pTarget )
@@ -5152,32 +5228,7 @@ bool ScGridWindow::GetEditUrl( const Point& rPos,
 
         //  EditEngine
 
-    ScFieldEditEngine aEngine(pDoc, pDoc->GetEditPool());
-    ScSizeDeviceProvider aProv(pDocSh);
-    aEngine.SetRefDevice( aProv.GetDevice() );
-    aEngine.SetRefMapMode( MAP_100TH_MM );
-    SfxItemSet aDefault( aEngine.GetEmptyItemSet() );
-    pPattern->FillEditItemSet( &aDefault );
-    SvxAdjust eSvxAdjust = SVX_ADJUST_LEFT;
-    switch (eHorJust)
-    {
-        case SVX_HOR_JUSTIFY_LEFT:
-        case SVX_HOR_JUSTIFY_REPEAT:            // nicht implementiert
-        case SVX_HOR_JUSTIFY_STANDARD:          // always Text if an EditCell type
-                eSvxAdjust = SVX_ADJUST_LEFT;
-                break;
-        case SVX_HOR_JUSTIFY_RIGHT:
-                eSvxAdjust = SVX_ADJUST_RIGHT;
-                break;
-        case SVX_HOR_JUSTIFY_CENTER:
-                eSvxAdjust = SVX_ADJUST_CENTER;
-                break;
-        case SVX_HOR_JUSTIFY_BLOCK:
-                eSvxAdjust = SVX_ADJUST_BLOCK;
-                break;
-    }
-    aDefault.Put( SvxAdjustItem( eSvxAdjust, EE_PARA_JUST ) );
-    aEngine.SetDefaults( aDefault );
+    boost::shared_ptr<ScFieldEditEngine> pEngine = createEditEngine(pDocSh, *pPattern);
 
     MapMode aEditMode = pViewData->GetLogicMode(eWhich);            // ohne Drawing-Skalierung
     Rectangle aLogicEdit = PixelToLogic( aEditRect, aEditMode );
@@ -5194,13 +5245,13 @@ bool ScGridWindow::GetEditUrl( const Point& rPos,
 
     if (bBreak)
         aPaperSize.Width() = nThisColLogic;
-    aEngine.SetPaperSize( aPaperSize );
+    pEngine->SetPaperSize( aPaperSize );
 
     boost::scoped_ptr<EditTextObject> pTextObj;
     if (aCell.meType == CELLTYPE_EDIT)
     {
         if (aCell.mpEditText)
-            aEngine.SetText(*aCell.mpEditText);
+            pEngine->SetText(*aCell.mpEditText);
     }
     else  // Not an Edit cell and is a formula cell with 'Hyperlink'
           // function if we have no URL, otherwise it could be a formula
@@ -5212,13 +5263,13 @@ bool ScGridWindow::GetEditUrl( const Point& rPos,
             pTextObj.reset(ScEditUtil::CreateURLObjectFromURL(*pDoc, sURL, sURL));
 
         if (pTextObj.get())
-            aEngine.SetText(*pTextObj);
+            pEngine->SetText(*pTextObj);
     }
 
     long nStartX = aLogicEdit.Left();
 
-        long nTextWidth = aEngine.CalcTextWidth();
-    long nTextHeight = aEngine.GetTextHeight();
+        long nTextWidth = pEngine->CalcTextWidth();
+    long nTextHeight = pEngine->GetTextHeight();
     if ( nTextWidth < nThisColLogic )
     {
         if (eHorJust == SVX_HOR_JUSTIFY_RIGHT)
@@ -5246,7 +5297,7 @@ bool ScGridWindow::GetEditUrl( const Point& rPos,
     Point aLogicClick = PixelToLogic(rPos,aEditMode);
     if ( aLogicEdit.IsInside(aLogicClick) )
     {
-        EditView aTempView( &aEngine, this );
+        EditView aTempView(pEngine.get(), this);
         aTempView.SetOutputArea( aLogicEdit );
 
         sal_Bool bRet = false;
@@ -5280,6 +5331,61 @@ bool ScGridWindow::GetEditUrl( const Point& rPos,
     return false;
 }
 
+bool ScGridWindow::IsSpellErrorAtPos( const Point& rPos, SCCOL nCol1, SCCOL nCol2, SCROW nRow )
+{
+    if (!mpSpellCheckCxt)
+        return false;
+
+    SCTAB nTab = pViewData->GetTabNo();
+    ScDocShell* pDocSh = pViewData->GetDocShell();
+    ScDocument* pDoc = pDocSh->GetDocument();
+
+    ScAddress aCellPos(nCol1, nRow, nTab);
+    ScRefCellValue aCell;
+    aCell.assign(*pDoc, aCellPos);
+    if (aCell.meType != CELLTYPE_STRING && aCell.meType != CELLTYPE_EDIT)
+        return false;
+
+    const std::vector<editeng::MisspellRanges>* pRanges = mpSpellCheckCxt->getMisspellRanges(nCol1, nRow);
+    if (!pRanges)
+        return false;
+
+    const ScPatternAttr* pPattern = pDoc->GetPattern(nCol1, nRow, nTab);
+
+    Rectangle aEditRect = pViewData->GetEditArea(eWhich, nCol1, nRow, this, pPattern, false);
+    if (rPos.Y() < aEditRect.Top())
+        return false;
+
+    Rectangle aEditRect2 = pViewData->GetEditArea(eWhich, nCol2, nRow, this, pPattern, false);
+    long nExt = aEditRect2.Left() - aEditRect.Right() + aEditRect2.GetWidth();
+    aEditRect.setWidth(aEditRect.getWidth() + nExt);
+
+    MapMode aEditMode = pViewData->GetLogicMode(eWhich);
+    Rectangle aLogicEdit = PixelToLogic(aEditRect, aEditMode);
+    Point aLogicClick = PixelToLogic(rPos, aEditMode);
+
+    if (!aLogicEdit.IsInside(aLogicClick))
+        return false;
+
+    boost::shared_ptr<ScFieldEditEngine> pEngine = createEditEngine(pDocSh, *pPattern);
+
+    Size aPaperSize = Size(1000000, 1000000);
+    pEngine->SetPaperSize(aPaperSize);
+
+    if (aCell.meType == CELLTYPE_EDIT)
+        pEngine->SetText(*aCell.mpEditText);
+    else
+        pEngine->SetText(aCell.mpString->getString());
+
+    pEngine->SetControlWord(pEngine->GetControlWord() | EE_CNTRL_ONLINESPELLING);
+    pEngine->SetAllMisspellRanges(*pRanges);
+
+    EditView aTempView(pEngine.get(), this);
+    aTempView.SetOutputArea(aLogicEdit);
+
+    return aTempView.IsWrongSpelledWordAtPos(rPos);
+}
+
 bool ScGridWindow::HasScenarioButton( const Point& rPosPixel, ScRange& rScenRange )
 {
     ScDocument* pDoc = pViewData->GetDocument();
commit 0ba1986137f25bd8a0590de40daabaa1b2012f65
Author: Luboš Luňák <l.lunak at collabora.com>
Date:   Sun Apr 13 23:06:58 2014 +0200

    handle .doc cropping also inside groups (fdo#38411)
    
    Writer does handle cropping on its own, but only for "toplevel" images,
    not for those inside groups, so there still use the generic code.
    
    Change-Id: I805a4cbd2d4cea7008e0322688ccd7f35a6d4a2c
    (cherry picked from commit af51f3fb5aee469423b154958ccb3fe61284122f)
    Reviewed-on: https://gerrit.libreoffice.org/8950
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index c0db6dc..63847b3 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -3744,8 +3744,9 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons
         }
         if ( bGrfRead )
         {
-            // the writer is doing it's own cropping, so this part affects only impress and calc
-            if ( GetSvxMSDffSettings() & SVXMSDFF_SETTINGS_CROP_BITMAPS )
+            // the writer is doing its own cropping, so this part affects only impress and calc,
+            // unless we're inside a group, in which case writer doesn't crop either
+            if (( GetSvxMSDffSettings() & SVXMSDFF_SETTINGS_CROP_BITMAPS ) || rObjData.nCalledByGroup != 0 )
                 lcl_ApplyCropping( *this, ( rObjData.nSpFlags & SP_FOLESHAPE ) == 0 ? &rSet : NULL, aGraf );
 
             if ( IsProperty( DFF_Prop_pictureTransparent ) )
commit 10115a5aacde8926529d98d1da2044d28f22e699
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Fri Apr 11 12:31:29 2014 -0400

    fdo#75970: Let's do it in a straightforward fashion.
    
    No idea what the intent of this weird static heap instantiation, but
    apparently it's not helping us.
    
    Change-Id: If6cccf649958b6cf01ede992c286af68eaeb31f6
    (cherry picked from commit 0ffe4358c755504bc2754ef88edadde33b5f395a)
    Reviewed-on: https://gerrit.libreoffice.org/8939
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 800523e..241d5dd 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -1638,8 +1638,8 @@ void ScViewFunc::SearchAndReplace( const SvxSearchItem* pSearchItem,
 
             if (nCommand == SVX_SEARCHCMD_FIND_ALL || nCommand == SVX_SEARCHCMD_REPLACE_ALL)
             {
-                static SearchResults *aSearchResults = new SearchResults(pDoc);
-                aSearchResults->Show(aMatchedRanges);
+                SearchResults aSearchResults(pDoc);
+                aSearchResults.Show(aMatchedRanges);
 
                 rMark.ResetMark();
                 for (size_t i = 0, n = aMatchedRanges.size(); i < n; ++i)
commit ba8438f22c69ffa73426871e923efe8533d868a5
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Fri Apr 11 21:37:54 2014 -0400

    fdo#77307: Compare external formula tokens correctly.
    
    To avoid different external (add-in) tokens from being evaluated equal.
    
    Change-Id: If78187901bdca7fe0da50442b0bb66e0650dc70f
    (cherry picked from commit f9cc0daec26016722bf5260e4e2634e6dcfe25a2)
    Reviewed-on: https://gerrit.libreoffice.org/8942
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 78c4fb0..b96d0ad 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -3654,6 +3654,15 @@ ScFormulaCell::CompareState ScFormulaCell::CompareByTokenArray( ScFormulaCell& r
                     return NotEqual;
             }
             break;
+            case formula::svExternal:
+            {
+                if (pThisTok->GetExternal() != pOtherTok->GetExternal())
+                    return NotEqual;
+
+                if (pThisTok->GetByte() != pOtherTok->GetByte())
+                    return NotEqual;
+            }
+            break;
             default:
                 ;
         }
commit 6f37c7eb743642625d679b273dc91f6e4e41eef1
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jan 29 09:20:30 2014 +0100

    smoketest: remove OpenOffice.org 1.0 XML format export tests
    
    ... which fail since the export filter was disabled in
    aeeaccf59abbc485d7786486f1accc1cb4d4dbf7.
    
    (cherry picked from commit 694a6478c1cfe18579dc9b355bda3db836b0b3a2)
    
    This is part of the fix for fdo#74979.
    
    Change-Id: I10969a96394d2972376a792af645ff48ccdab7c0
    Reviewed-on: https://gerrit.libreoffice.org/8938
    Reviewed-by: Kohei Yoshida <libreoffice at kohei.us>
    Tested-by: Kohei Yoshida <libreoffice at kohei.us>

diff --git a/smoketest/data/Basic/Standard/Global.xml b/smoketest/data/Basic/Standard/Global.xml
index 16947ba..0afffcf 100644
--- a/smoketest/data/Basic/Standard/Global.xml
+++ b/smoketest/data/Basic/Standard/Global.xml
@@ -26,7 +26,7 @@ const cParagraphBreak = 0
 
 global const cExtensionFileName = "TestExtension.oxt"
 
-global const cDocNew = 0, cDocSaveOpen8 = 1, cDocSaveOpenXML = 2, cDocClose = 3, cDocMacros = 4
+global const cDocNew = 0, cDocSaveOpen8 = 1, cDocClose = 3, cDocMacros = 4
 global const cDBService = 0, cDBOpen = 1, cDBInsert = 2, cDBDelete = 3, cDBSeek = 4, cDBClose = 5
 global const cEXTService = 0, cEXTInstall = 1, cEXTUninstall = 2
 global const cTestClosureSetupDoc = 0, cTestClosureWriteStatus = 1
@@ -80,7 +80,6 @@ Global const cUserFieldTestWriter = "Writer", cUserFieldTestCalc = &qu
 Global const cUserFieldTestDraw = "Draw", cUserFieldTestMath = "Math", cUserFieldTestChart = "Chart"
 Global const cUserFieldTestHTML = "HTML", cUserFieldTestJava = "Java", cUserFieldTestDatabase = "Database"
 Global const cUserFieldTestExtension = "Extension"
-Global const cUserFieldTestOpenSaveXML = "SaveOpenXML"
 Global const cUserFieldTestTerminateAfterTest = "Terminate", cUserFieldTestOpenSave8 = "SaveOpen8", cUserFieldTestMacros = "Macros"
 
 Global const cOptionsDialogName = "OptionsDlg", cTest10Modul = "Standard"
@@ -98,7 +97,6 @@ Global bMakeWriterTest as boolean, bMakeCalcTest as  boolean, bMakeImpressTest a
 Global bMakeDrawTest as Boolean, bMakeMathTest as boolean, bMakeChartTest as boolean
 Global bMakeHTMLTest as boolean, bMakeJavaTest as boolean, bMakeDBTest as boolean
 Global bMakeExtensionTest as boolean
-Global bMakeSaveOpenXMLTest as boolean
 Global bMakeTerminateAfterTest as boolean, bShowTable as boolean
 Global bMakeSaveOpen8Test as boolean, bMakeMacrosTest as boolean
 
@@ -225,7 +223,6 @@ Sub CreateStatusTable
     dim tableRows(4) as string
     tableRows(cDocNew) = "new"
     tableRows(cDocSaveOpen8) = "V8.0"
-    tableRows(cDocSaveOpenXML) = "XML"
     tableRows(cDocClose) = "close"
     tableRows(cDocMacros) = "macros"
 
@@ -563,7 +560,6 @@ Sub SetOptions
     SetUserFieldState (cUserFieldTestJava, -(gOptionsDialog.getControl("cbJavaTest").getState), gOutputDoc)
     SetUserFieldState (cUserFieldTestDatabase, -(gOptionsDialog.getControl("cbDatabaseTest").getState), gOutputDoc)
     SetUserFieldState (cUserFieldTestExtension, -(gOptionsDialog.getControl("cbExtensionTest").getState), gOutputDoc)
-    SetUserFieldState (cUserFieldTestOpenSaveXML, -(gOptionsDialog.getControl("cbSaveOpenXMLTest").getState), gOutputDoc)
     SetUserFieldState (cUserFieldTestOpenSave8, -(gOptionsDialog.getControl("cbSaveOpen8Test").getState), gOutputDoc)
     SetUserFieldState (cUserFieldTestMacros, -(gOptionsDialog.getControl("cbMacrosTest").getState), gOutputDoc)
     SetUserFieldState (cUserFieldTestTerminateAfterTest, -(gOptionsDialog.getControl("cbTerminateAfterTest").getState), gOutputDoc)
@@ -581,7 +577,6 @@ Sub GetOptions
     gOptionsDialog.getControl("cbJavaTest").setState( -( GetUserFieldState (cUserFieldTestJava, gOutputDoc)))
     gOptionsDialog.getControl("cbDatabaseTest").setState( -( GetUserFieldState (cUserFieldTestDatabase, gOutputDoc)))
     gOptionsDialog.getControl("cbExtensionTest").setState( -( GetUserFieldState (cUserFieldTestExtension, gOutputDoc)))

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list