diff options
-rw-r--r-- | sc/source/ui/dbgui/filtdlg.cxx | 24 |
1 files changed, 24 insertions, 0 deletions
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,8 +317,32 @@ void ScFilterDlg::Init( const SfxItemSet& rArgSet ) maCondLbArr[i]->Disable(); } else + { + 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 ) { nFieldSelPos = GetFieldSelPos( pViewData->GetCurX() ); |