[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Mon Jul 9 10:36:04 PDT 2012


 sc/source/ui/dbgui/filtdlg.cxx |   26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

New commits:
commit 22ccbeef9c88b01ac841de37dfcb5985dc05a530
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Jul 9 18:31:30 2012 +0200

    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 at gmail.com>

diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx
index 93ad302..c744d85 100644
--- a/sc/source/ui/dbgui/filtdlg.cxx
+++ b/sc/source/ui/dbgui/filtdlg.cxx
@@ -318,7 +318,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 )
         {


More information about the Libreoffice-commits mailing list