Kaydet (Commit) d48edd1e authored tarafından Tor Lillqvist's avatar Tor Lillqvist Kaydeden (comit) Julien Nabet

Don't call getLength() on OUStringBuffer after makeStringAndClear()

It's the length of the OUString that we just made from the
OUStringBuffer that we want.

Fixes a problem where the code would try to execute an erronoeus SQL
statement like:

')EATE TABLE "Tasks" ("Notes" VARCHAR(32765),"TaskID" INTEGER,"EndDate" DATE,"StartDate" DATE,"Description" VARCHAR(65000),'

Too lazy to file a bug for this, the error should be obvious by just
reading the code.

Change-Id: I473cd8a7a9791700ca8b6467a84f4bad5dee4d55
Reviewed-on: https://gerrit.libreoffice.org/47230Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJulien Nabet <serval2412@yahoo.fr>
üst 9fc9bf32
...@@ -191,7 +191,7 @@ ObjectType Tables::appendObject(const OUString& rName, ...@@ -191,7 +191,7 @@ ObjectType Tables::appendObject(const OUString& rName,
else else
{ {
if ( sSql.endsWith(",") ) if ( sSql.endsWith(",") )
sSql = sSql.replaceAt(aSqlBuffer.getLength()-1, 1, ")"); sSql = sSql.replaceAt(sSql.getLength()-1, 1, ")");
else else
sSql += ")"; sSql += ")";
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment