summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2012-07-09 18:31:30 +0200
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-07-09 13:36:48 -0400
commit22ccbeef9c88b01ac841de37dfcb5985dc05a530 (patch)
tree6725a9008f69639335b251be6c6cc204f3dbf9fa
parente30425b674034824bff78d40192776eee1bc23cd (diff)
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 Signed-off-by: Kohei Yoshida <kohei.yoshida@gmail.com>
-rw-r--r--sc/source/ui/dbgui/filtdlg.cxx26
1 files changed, 25 insertions, 1 deletions
diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx
index 93ad3024197b..c744d8596bc2 100644
--- a/sc/source/ui/dbgui/filtdlg.cxx
+++ b/sc/source/ui/dbgui/filtdlg.cxx
@@ -320,3 +320,27 @@ void ScFilterDlg::Init( const SfxItemSet& rArgSet )
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;
+ }
+ }
}