[Libreoffice-commits] .: sw/source

Caolán McNamara caolan at kemper.freedesktop.org
Thu Feb 16 06:02:51 PST 2012


 sw/source/ui/uno/SwXDocumentSettings.cxx |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

New commits:
commit 746e9a7d338db5fb0af285d453055ae5fa45037d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 16 13:39:09 2012 +0000

    allow unsetting database settings without warnings

diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx
index c349631..fa8a704 100644
--- a/sw/source/ui/uno/SwXDocumentSettings.cxx
+++ b/sw/source/ui/uno/SwXDocumentSettings.cxx
@@ -474,21 +474,23 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
         case HANDLE_CURRENT_DATABASE_COMMAND:
         {
             SwDBData aData = mpDoc->GetDBData();
-            SAL_WARN_IF( aData.sDataSource.isEmpty(), "sw.uno",
-                "\"CurrentDatabaseCommand\" property possibly set before \"CurrentDatabaseDataSource\"" );
+
             if ( rValue >>= aData.sCommand )
                 mpDoc->ChgDBData( aData );
+
+            SAL_WARN_IF( aData.sDataSource.isEmpty() && !aData.sCommand.isEmpty(), "sw.uno",
+                "\"CurrentDatabaseCommand\" property possibly set before \"CurrentDatabaseDataSource\"" );
         }
         break;
         case HANDLE_CURRENT_DATABASE_COMMAND_TYPE:
         {
             SwDBData aData = mpDoc->GetDBData();
-            SAL_WARN_IF( aData.sDataSource.isEmpty(), "sw.uno",
-                "\"CurrentDatabaseCommandType\" property possibly set before \"CurrentDatabaseDataSource\"" );
-            SAL_WARN_IF( aData.sCommand.isEmpty(), "sw.uno",
-                "\"CurrentDatabaseCommandType\" property possibly set before \"CurrentDatabaseCommand\"" );
             if ( rValue >>= aData.nCommandType )
                 mpDoc->ChgDBData( aData );
+            SAL_WARN_IF( aData.nCommandType && aData.sDataSource.isEmpty(), "sw.uno",
+                "\"CurrentDatabaseCommandType\" property possibly set before \"CurrentDatabaseDataSource\"" );
+            SAL_WARN_IF( aData.nCommandType && aData.sCommand.isEmpty(), "sw.uno",
+                "\"CurrentDatabaseCommandType\" property possibly set before \"CurrentDatabaseCommand\"" );
         }
         break;
         case HANDLE_SAVE_VERSION_ON_CLOSE:


More information about the Libreoffice-commits mailing list