[Libreoffice-commits] core.git: 2 commits - sw/source

Michael Stahl mstahl at redhat.com
Tue Feb 3 05:27:20 PST 2015


 sw/source/ui/fldui/changedb.cxx |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit ad66f2727ff3ab21468edc6866bb3e1cc8e5efbb
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Feb 3 13:06:21 2015 +0100

    Use offapi constants instead of hardcoded magic constant
    
    Change-Id: I53b86e3baebbcca7cb0a72aa072db3da0f84fd4f
    Reviewed-on: https://gerrit.libreoffice.org/14303
    Reviewed-by: David Ostrovsky <david at ostrovsky.org>
    Reviewed-by: Lionel Elie Mamane <lionel at mamane.lu>
    Tested-by: Lionel Elie Mamane <lionel at mamane.lu>

diff --git a/sw/source/ui/fldui/changedb.cxx b/sw/source/ui/fldui/changedb.cxx
index 2299b4d..d5a171d 100644
--- a/sw/source/ui/fldui/changedb.cxx
+++ b/sw/source/ui/fldui/changedb.cxx
@@ -22,6 +22,7 @@
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/container/XNameAccess.hpp>
 #include <com/sun/star/sdb/DatabaseContext.hpp>
+#include <com/sun/star/sdb/CommandType.hpp>
 #include <com/sun/star/sdb/XDatabaseAccess.hpp>
 #include <comphelper/processfactory.hxx>
 #include <sfx2/viewfrm.hxx>
@@ -197,7 +198,9 @@ void SwChangeDBDlg::UpdateFlds()
         + OUString(DB_DELIM)
         + sTableName
         + OUString(DB_DELIM)
-        + OUString(static_cast<sal_Unicode>(bIsTable ? '0' : '1'));
+        + OUString::number(bIsTable
+                            ? CommandType::TABLE
+                            : CommandType::QUERY);
     pSh->ChangeDBFields( aDBNames, sTemp);
     pSh->EndAllAction();
 }
commit afd743141f7a7dd05914d0872c9afe079f16fe0c
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Feb 3 12:57:40 2015 +0100

    tdf#77241: sw: fix creation of field data source string
    
    SwChangeDBDlg::UpdateFlds() depends on undefined behaviour in
    constructing sTemp, because the call to GetDBName initializes local
    variables that are already used in other sub-expressions of the
    statement.
    
    (regression from 8a7a9992906ba59d575ca9e4441b3e84fea5fae0)
    
    Change-Id: Ibf8c0091da672e133d7a35bc61c059eaf65a3bc2
    Reviewed-on: https://gerrit.libreoffice.org/14302
    Reviewed-by: Lionel Elie Mamane <lionel at mamane.lu>
    Tested-by: Lionel Elie Mamane <lionel at mamane.lu>

diff --git a/sw/source/ui/fldui/changedb.cxx b/sw/source/ui/fldui/changedb.cxx
index 9e917d4..2299b4d 100644
--- a/sw/source/ui/fldui/changedb.cxx
+++ b/sw/source/ui/fldui/changedb.cxx
@@ -192,7 +192,8 @@ void SwChangeDBDlg::UpdateFlds()
     OUString sTableName;
     OUString sColumnName;
     sal_Bool bIsTable = sal_False;
-    const OUString sTemp = m_pAvailDBTLB->GetDBName(sTableName, sColumnName, &bIsTable)
+    const OUString DBName(m_pAvailDBTLB->GetDBName(sTableName, sColumnName, &bIsTable));
+    const OUString sTemp = DBName
         + OUString(DB_DELIM)
         + sTableName
         + OUString(DB_DELIM)


More information about the Libreoffice-commits mailing list