summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2010-12-07 17:06:16 -0500
committerKohei Yoshida <kyoshida@novell.com>2010-12-07 22:53:40 -0500
commit9e338f0677ab068e1bf792db11123b646938edbc (patch)
tree0edb2170e21c4646fadffe65038b0dc386e79fdf
parent7dc09f19bc5c182ebabb52482db10f828882aad0 (diff)
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@gmail.com>
-rw-r--r--sc/source/ui/miscdlgs/datafdlg.cxx16
1 files changed, 13 insertions, 3 deletions
diff --git a/sc/source/ui/miscdlgs/datafdlg.cxx b/sc/source/ui/miscdlgs/datafdlg.cxx
index 377213fc0..50503e26f 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"));