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

Kohei Yoshida kohei at kemper.freedesktop.org
Tue Dec 7 19:57:09 PST 2010


 sc/source/ui/miscdlgs/datafdlg.cxx |   16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

New commits:
commit 9e338f0677ab068e1bf792db11123b646938edbc
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Tue Dec 7 17:06:16 2010 -0500

    Display correct record information in Data Form dialog. (fdo#32196)
    
    I had accidentally removed the part that constructed correct string
    to display.  Recovered it, and modified it to use OUStringBuffer
    instead of sprintf to construct the string.
    
    Signed-off-by: Norbert Thiebaud <nthiebaud at gmail.com>

diff --git a/sc/source/ui/miscdlgs/datafdlg.cxx b/sc/source/ui/miscdlgs/datafdlg.cxx
index 377213f..50503e2 100644
--- a/sc/source/ui/miscdlgs/datafdlg.cxx
+++ b/sc/source/ui/miscdlgs/datafdlg.cxx
@@ -42,8 +42,12 @@
 #include "refundo.hxx"
 #include "undodat.hxx"
 
+#include "rtl/ustrbuf.hxx"
+
 #define HDL(hdl)            LINK( this, ScDataFormDlg, hdl )
 
+using ::rtl::OUStringBuffer;
+
 //zhangyun
 ScDataFormDlg::ScDataFormDlg( Window* pParent, ScTabViewShell*  pTabViewShellOri) :
     ModalDialog     ( pParent, ScResId( RID_SCDLG_DATAFORM ) ),
@@ -272,9 +276,15 @@ void ScDataFormDlg::FillCtrls(SCROW /*nCurrentRow*/)
                 pEdits[i]->SetText(String());
         }
     }
-    char sRecordStr[256];
-    if (aCurrentRow<=nEndRow)
-        aFixedText.SetText(String::CreateFromAscii(sRecordStr));
+
+    if (aCurrentRow <= nEndRow)
+    {
+        OUStringBuffer aBuf;
+        aBuf.append(static_cast<sal_Int32>(aCurrentRow - nStartRow));
+        aBuf.appendAscii(" / ");
+        aBuf.append(static_cast<sal_Int32>(nEndRow - nStartRow));
+        aFixedText.SetText(aBuf.makeStringAndClear());
+    }
     else
         aFixedText.SetText(String::CreateFromAscii("New Record"));
 


More information about the Libreoffice-commits mailing list