From 4851cde7b98226b0f82ae2b191c290173e9b06c6 Mon Sep 17 00:00:00 2001 From: Jan-Marek Glogowski Date: Sat, 12 Jul 2014 23:17:31 +0200 Subject: fdo#70346 MM: add mail merge data to condition dict MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently section hide conditions are just evaluated based on document field data. This adds the current mail merge dataset to the condition dictionary, so this can be used in the condition evaluation. The dataset values are named from their columns and added initially, therefore DB fields with identical names will overwrite the values in the dictionary! Change-Id: I82a5f9f6962628a76c836e8e2a7c9e264fdc16e0 Reviewed-on: https://gerrit.libreoffice.org/10978 Reviewed-by: Björn Michaelsen Tested-by: Björn Michaelsen --- sw/inc/dbfld.hxx | 3 +++ sw/inc/dbmgr.hxx | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'sw/inc') diff --git a/sw/inc/dbfld.hxx b/sw/inc/dbfld.hxx index 8677265eda08..d9d92f0494a5 100644 --- a/sw/inc/dbfld.hxx +++ b/sw/inc/dbfld.hxx @@ -109,6 +109,9 @@ public: inline const SwDBData& GetDBData() const { return ((SwDBFieldType*)GetTyp())->GetDBData(); } virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const SAL_OVERRIDE; virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) SAL_OVERRIDE; + + static bool FormatValue( SvNumberFormatter* pDocFormatter, OUString &aString, sal_uInt32 nFmt, + double &aNumber, sal_Int32 nColumnType, SwDBField *pField = NULL ); }; inline void SwDBField::SetExpansion(const OUString& rStr) diff --git a/sw/inc/dbmgr.hxx b/sw/inc/dbmgr.hxx index 6d9d7fe52562..29fa03b8b2fe 100644 --- a/sw/inc/dbmgr.hxx +++ b/sw/inc/dbmgr.hxx @@ -29,6 +29,7 @@ #include #include #include + namespace com{namespace sun{namespace star{ namespace sdbc{ class XConnection; @@ -71,6 +72,7 @@ class SvNumberFormatter; class SwDbtoolsClient; class SwXMailMerge; class SwMailMergeConfigItem; +class SwCalc; enum DBManagerOptions { @@ -264,7 +266,6 @@ public: const OUString& rColNm ); inline bool IsInMerge() const { return bInMerge; } - void EndMerge(); void ExecuteFormLetter(SwWrtShell& rSh, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rProperties, @@ -297,7 +298,9 @@ public: void CloseAll(bool bIncludingMerge = true); bool GetMergeColumnCnt(const OUString& rColumnName, sal_uInt16 nLanguage, - OUString &rResult, double *pNumber, sal_uInt32 *pFormat); + OUString &rResult, double *pNumber, sal_uInt32 *pFormat); + bool FillCalcWithMergeData(SvNumberFormatter *pDocFormatter, + sal_uInt16 nLanguage, bool asString, SwCalc &aCalc); bool ToNextMergeRecord(); bool ToNextRecord(const OUString& rDataSource, const OUString& rTableOrQuery, sal_Int32 nCommandType = -1); -- cgit v1.2.3