[Libreoffice] Patch review for Bug 32196 requested

Norbert Thiebaud nthiebaud at gmail.com
Tue Dec 7 15:03:38 PST 2010


On Tue, Dec 7, 2010 at 4:45 PM, Kohei Yoshida <kyoshida at novell.com> wrote:
> I've attached a patch awaiting peer-review.
>
> https://bugs.freedesktop.org/show_bug.cgi?id=32196
>
> The change is simple and innocuous enough that I would almost commit it
> without review, but I'd like someone to take a quick look and give me a
> go.
>

Shouldn't you test if you need it _before_ actually constructing it ?

iow:

-    char sRecordStr[256];
     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(String::CreateFromAscii(sRecordStr));
+        aFixedText.SetText(aBuf.makeStringAndClear());
+ }
     else
         aFixedText.SetText(String::CreateFromAscii("New Record"));


instead of

-    char sRecordStr[256];
+    OUStringBuffer aBuf;
+    aBuf.append(static_cast<sal_Int32>(aCurrentRow - nStartRow));
+    aBuf.appendAscii(" / ");
+    aBuf.append(static_cast<sal_Int32>(nEndRow - nStartRow));
     if (aCurrentRow<=nEndRow)
-        aFixedText.SetText(String::CreateFromAscii(sRecordStr));
+        aFixedText.SetText(aBuf.makeStringAndClear());
     else
         aFixedText.SetText(String::CreateFromAscii("New Record"));

???

Norbert

> Thanks,
>
> Kohei
>
> --
> Kohei Yoshida, LibreOffice hacker, Calc
> <kyoshida at novell.com>
>
> _______________________________________________
> LibreOffice mailing list
> LibreOffice at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/libreoffice
>


More information about the LibreOffice mailing list