From eba3ef8ca5699346572479749c5e4ff5bdd12cae Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Mon, 9 Jul 2012 18:31:30 +0200 Subject: resolved rhbz#838248 init filter criteria string In ScFilterDlg::Init() the string displayed as criteria was empty if query is ByValue or ByDate. From earlier times the dialog assumed that the query string was always set corresponding to the value, but internal handling was changed. Change-Id: I4f10654f4015b38f7ddba9d6727e06806f1d6b77 --- sc/source/ui/dbgui/filtdlg.cxx | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx index 4ee8bf6e80e3..bca066065eee 100644 --- a/sc/source/ui/dbgui/filtdlg.cxx +++ b/sc/source/ui/dbgui/filtdlg.cxx @@ -317,7 +317,31 @@ void ScFilterDlg::Init( const SfxItemSet& rArgSet ) maCondLbArr[i]->Disable(); } else - aValStr = rItem.maString; + { + if (rItem.maString.isEmpty()) + { + if (rItem.meType == ScQueryEntry::ByValue) + pDoc->GetFormatTable()->GetInputLineString( rItem.mfVal, 0, aValStr); + else if (rItem.meType == ScQueryEntry::ByDate) + { + SvNumberFormatter* pFormatter = pDoc->GetFormatTable(); + pFormatter->GetInputLineString( rItem.mfVal, + pFormatter->GetStandardFormat( NUMBERFORMAT_DATE), aValStr); + } + else + { + SAL_WARN( "sc", "ScFilterDlg::Init: empty query string, really?"); + aValStr = rItem.maString; + } + } + else + { + // XXX NOTE: if not ByString we just assume this has been + // set to a proper string corresponding to the numeric + // value earlier! + aValStr = rItem.maString; + } + } } else if ( i == 0 ) { -- cgit v1.2.3