diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-04-14 16:57:52 -0400 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2014-04-16 17:07:22 +0200 |
commit | 1aebd02561cfe397800329edcfd3a393c952ccd6 (patch) | |
tree | 8128bdeb0d78901125a2421b14e6c1ba4c128833 /reportdesign | |
parent | f1384b44c7673578459c3898f987e04ef36e67a8 (diff) |
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@googlemail.com>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/source/ui/dlg/Formula.cxx | 6 | ||||
-rw-r--r-- | reportdesign/source/ui/inc/Formula.hxx | 13 | ||||
-rw-r--r-- | reportdesign/source/ui/misc/UITools.cxx | 11 |
3 files changed, 25 insertions, 5 deletions
diff --git a/reportdesign/source/ui/dlg/Formula.cxx b/reportdesign/source/ui/dlg/Formula.cxx index 0d37c49b74b2..6eaa92e38caa 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 a341094991bf..0e53c4792ec1 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 965f429fedd1..9a7b28524b20 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 ) { |