de-dent SwXFieldMaster a bit

de-dent SwXFieldMaster a bit

Change-Id: Ibfd1b6ad2fab06543913e2b38fad25d98351f9e2

--- sw/source/core/unocore/unofield.cxx
+++ sw/source/core/unocore/unofield.cxx
@@ -456,7 +456,9 @@
     return OUString("SwXFieldMaster");
 }

-sal_Bool SwXFieldMaster::supportsService(const OUString& rServiceName) throw( uno::RuntimeException )
+sal_Bool SAL_CALL
+SwXFieldMaster::supportsService(const OUString& rServiceName)
+throw (uno::RuntimeException)
 {
     sal_Bool bRet = sal_False;
     if(rServiceName.equalsAsciiL(
@@ -485,7 +487,8 @@
     return bRet;
 }

-uno::Sequence< OUString > SwXFieldMaster::getSupportedServiceNames(void) throw( uno::RuntimeException )
+uno::Sequence< OUString > SAL_CALL
+SwXFieldMaster::getSupportedServiceNames() throw (uno::RuntimeException)
 {
     uno::Sequence< OUString > aRet(2);
     OUString* pArray = aRet.getArray();
@@ -617,54 +620,50 @@
         {
             throw lang::IllegalArgumentException();
         }
-        else
-        {
-            switch (m_pImpl->m_nResTypeId)
-            {
-                case RES_USERFLD :
-                {
-                    SwUserFieldType aType(m_pImpl->m_pDoc, sTypeName);
-                    pType2 = m_pImpl->m_pDoc->InsertFldType(aType);
-                    static_cast<SwUserFieldType*>(pType2)->SetContent(m_pImpl->m_sParam1);
-                    static_cast<SwUserFieldType*>(pType2)->SetValue(m_pImpl->m_fParam1);
-                    static_cast<SwUserFieldType*>(pType2)->SetType(m_pImpl->m_bParam1 ? nsSwGetSetExpType::GSE_EXPR : nsSwGetSetExpType::GSE_STRING);
-                }
-                break;
-                case RES_DDEFLD :
-                {
-                    SwDDEFieldType aType(sTypeName, m_pImpl->m_sParam1,
-                        sal::static_int_cast< sal_uInt16 >((m_pImpl->m_bParam1)
-                            ? sfx2::LINKUPDATE_ALWAYS : sfx2::LINKUPDATE_ONCALL));
-                    pType2 = m_pImpl->m_pDoc->InsertFldType(aType);
-                }
-                break;
-                case RES_SETEXPFLD :
-                {
-                    SwSetExpFieldType aType(m_pImpl->m_pDoc, sTypeName);
-                    if (m_pImpl->m_sParam1.Len())
-                        aType.SetDelimiter(OUString(m_pImpl->m_sParam1.GetChar(0)));
-                    if (m_pImpl->m_nParam1 > -1 && m_pImpl->m_nParam1 < MAXLEVEL)
-                        aType.SetOutlineLvl(m_pImpl->m_nParam1);
-                    pType2 = m_pImpl->m_pDoc->InsertFldType(aType);
-                }
-                break;
-                case RES_DBFLD :
-                {
-                    ::GetString( rValue, m_pImpl->m_sParam3 );
-                    pType = GetFldType();
-                }
-                break;
-            }
-            if(pType2)
-            {
-                pType2->Add(m_pImpl.get());
-                m_pImpl->m_bIsDescriptor = false;
-            }
-            else
-                throw uno::RuntimeException();
-        }
-
-        OSL_ENSURE(pType2, "kein FieldType gefunden!" );
+
+        switch (m_pImpl->m_nResTypeId)
+        {
+            case RES_USERFLD :
+            {
+                SwUserFieldType aType(m_pImpl->m_pDoc, sTypeName);
+                pType2 = m_pImpl->m_pDoc->InsertFldType(aType);
+                static_cast<SwUserFieldType*>(pType2)->SetContent(m_pImpl->m_sParam1);
+                static_cast<SwUserFieldType*>(pType2)->SetValue(m_pImpl->m_fParam1);
+                static_cast<SwUserFieldType*>(pType2)->SetType(m_pImpl->m_bParam1
+                    ? nsSwGetSetExpType::GSE_EXPR : nsSwGetSetExpType::GSE_STRING);
+            }
+            break;
+            case RES_DDEFLD :
+            {
+                SwDDEFieldType aType(sTypeName, m_pImpl->m_sParam1,
+                    sal::static_int_cast< sal_uInt16 >((m_pImpl->m_bParam1)
+                        ? sfx2::LINKUPDATE_ALWAYS : sfx2::LINKUPDATE_ONCALL));
+                pType2 = m_pImpl->m_pDoc->InsertFldType(aType);
+            }
+            break;
+            case RES_SETEXPFLD :
+            {
+                SwSetExpFieldType aType(m_pImpl->m_pDoc, sTypeName);
+                if (m_pImpl->m_sParam1.Len())
+                    aType.SetDelimiter(OUString(m_pImpl->m_sParam1.GetChar(0)));
+                if (m_pImpl->m_nParam1 > -1 && m_pImpl->m_nParam1 < MAXLEVEL)
+                    aType.SetOutlineLvl(m_pImpl->m_nParam1);
+                pType2 = m_pImpl->m_pDoc->InsertFldType(aType);
+            }
+            break;
+            case RES_DBFLD :
+            {
+                ::GetString( rValue, m_pImpl->m_sParam3 );
+                pType = GetFldType();
+            }
+            break;
+        }
+        if (!pType2)
+        {
+            throw uno::RuntimeException("no field type found!", *this);
+        }
+        pType2->Add(m_pImpl.get());
+        m_pImpl->m_bIsDescriptor = false;
     }
     else
     {
@@ -819,33 +818,34 @@
         {
             //TODO: Properties fuer die uebrigen Feldtypen einbauen
             sal_uInt16 nMId = GetFieldTypeMId( rPropertyName, *pType );
-            if( USHRT_MAX != nMId )
-            {
-                pType->QueryValue( aRet, nMId );
-
-                if( rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_DATA_BASE_NAME)) ||
-                    rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_DATA_BASE_URL)))
-                {
-                    OUString aDataSource;
-                    aRet >>= aDataSource;
-                    aRet <<= OUString();
-
-                    OUString *pStr = 0;     // only one of this properties will return
-                                            // a non-empty string.
-                    INetURLObject aObj;
-                    aObj.SetURL( aDataSource );
-                    bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID;
-                    if (bIsURL && rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_DATA_BASE_URL)))
-                        pStr = &aDataSource;        // DataBaseURL
-                    else if (!bIsURL && rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_DATA_BASE_NAME)))
-                        pStr = &aDataSource;        // DataBaseName
-
-                    if (pStr)
-                        aRet <<= *pStr;
-                }
-            }
-            else
-                throw beans::UnknownPropertyException(OUString( "Unknown property: " ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
+            if (USHRT_MAX == nMId)
+            {
+                throw beans::UnknownPropertyException(
+                        "Unknown property: " + rPropertyName,
+                        static_cast<cppu::OWeakObject *>(this));
+            }
+            pType->QueryValue( aRet, nMId );
+
+            if (rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_DATA_BASE_NAME)) ||
+                rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_DATA_BASE_URL)))
+            {
+                OUString aDataSource;
+                aRet >>= aDataSource;
+                aRet <<= OUString();
+
+                OUString *pStr = 0;     // only one of this properties will return
+                                        // a non-empty string.
+                INetURLObject aObj;
+                aObj.SetURL( aDataSource );
+                bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID;
+                if (bIsURL && rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_DATA_BASE_URL)))
+                    pStr = &aDataSource;        // DataBaseURL
+                else if (!bIsURL && rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_DATA_BASE_NAME)))
+                    pStr = &aDataSource;        // DataBaseName
+
+                if (pStr)
+                    aRet <<= *pStr;
+            }
         }
         else
         {
@@ -949,38 +949,35 @@
 {
     SolarMutexGuard aGuard;
     SwFieldType *const pFldType = GetFldType(true);
-    if(pFldType)
-    {
-        sal_uInt16 nTypeIdx = USHRT_MAX;
-        const SwFldTypes* pTypes = m_pImpl->m_pDoc->GetFldTypes();
-        for( sal_uInt16 i = 0; i < pTypes->size(); i++ )
-        {
-            if((*pTypes)[i] == pFldType)
-                nTypeIdx = i;
-        }
-
-        // zuerst alle Felder loeschen
-        SwIterator<SwFmtFld,SwFieldType> aIter( *pFldType );
-        SwFmtFld* pFld = aIter.First();
-        while(pFld)
-        {
-            // Feld im Undo?
-            SwTxtFld *pTxtFld = pFld->GetTxtFld();
-            if(pTxtFld && pTxtFld->GetTxtNode().GetNodes().IsDocNodes() )
-            {
-                SwTxtNode& rTxtNode = (SwTxtNode&)*pTxtFld->GetpTxtNode();
-                SwPaM aPam(rTxtNode, *pTxtFld->GetStart());
-                aPam.SetMark();
-                aPam.Move();
-                m_pImpl->m_pDoc->DeleteAndJoin(aPam);
-            }
-            pFld = aIter.Next();
-        }
-        // dann den FieldType loeschen
-        m_pImpl->m_pDoc->RemoveFldType(nTypeIdx);
-    }
-    else
+    if (!pFldType)
         throw uno::RuntimeException();
+    sal_uInt16 nTypeIdx = USHRT_MAX;
+    const SwFldTypes* pTypes = m_pImpl->m_pDoc->GetFldTypes();
+    for( sal_uInt16 i = 0; i < pTypes->size(); i++ )
+    {
+        if((*pTypes)[i] == pFldType)
+            nTypeIdx = i;
+    }
+
+    // zuerst alle Felder loeschen
+    SwIterator<SwFmtFld,SwFieldType> aIter( *pFldType );
+    SwFmtFld* pFld = aIter.First();
+    while(pFld)
+    {
+        // Feld im Undo?
+        SwTxtFld *pTxtFld = pFld->GetTxtFld();
+        if(pTxtFld && pTxtFld->GetTxtNode().GetNodes().IsDocNodes() )
+        {
+            SwTxtNode& rTxtNode = (SwTxtNode&)*pTxtFld->GetpTxtNode();
+            SwPaM aPam(rTxtNode, *pTxtFld->GetStart());
+            aPam.SetMark();
+            aPam.Move();
+            m_pImpl->m_pDoc->DeleteAndJoin(aPam);
+        }
+        pFld = aIter.Next();
+    }
+    // dann den FieldType loeschen
+    m_pImpl->m_pDoc->RemoveFldType(nTypeIdx);
 }

 void SAL_CALL SwXFieldMaster::addEventListener(


use hid_queue_value_monitor

use hid_queue_value_monitor

--- src/core/observer/include/device_observer.hpp
+++ src/core/observer/include/device_observer.hpp
@@ -2,16 +2,16 @@

 // `krbn::device_observer` can be used safely in a multi-threaded environment.

-#include "boost_defs.hpp"
-
-#include "grabbable_state_manager.hpp"
+#include "event_queue.hpp"
+#include "grabbable_state_manager/manager.hpp"
 #include "grabber_client.hpp"
-#include "hid_observer.hpp"
+#include "iokit_utility.hpp"
 #include "logger.hpp"
 #include "time_utility.hpp"
 #include "types.hpp"
 #include <pqrs/dispatcher.hpp>
 #include <pqrs/osx/iokit_hid_manager.hpp>
+#include <pqrs/osx/iokit_hid_queue_value_monitor.hpp>
 #include <pqrs/osx/iokit_types.hpp>

 namespace krbn {
@@ -23,7 +23,7 @@
                                                                   grabber_client_(grabber_client) {
     // grabbable_state_manager_

-    grabbable_state_manager_ = std::make_unique<grabbable_state_manager>();
+    grabbable_state_manager_ = std::make_unique<grabbable_state_manager::manager>();

     grabbable_state_manager_->grabbable_state_changed.connect([this](auto&& grabbable_state) {
       if (auto client = grabber_client_.lock()) {
@@ -51,67 +51,69 @@
                                                                   matching_dictionaries);

     hid_manager_->device_matched.connect([this](auto&& registry_entry_id, auto&& device_ptr) {
-      iokit_utility::log_matching_device(registry_entry_id, *device_ptr);
+      if (device_ptr) {
+        iokit_utility::log_matching_device(registry_entry_id, *device_ptr);

-      auto hid = std::make_shared<krbn::human_interface_device>(*device_ptr,
-                                                                registry_entry_id);
-      hids_[registry_entry_id] = hid;
-      auto device_name = hid->get_name_for_log();
+        auto device_id = make_device_id(registry_entry_id);
+        auto device_name = iokit_utility::make_device_name_for_log(device_id,
+                                                                   *device_ptr);

-      logger::get_logger().info("{0} is matched.", device_name);
+        grabbable_state_manager_->update(grabbable_state(device_id,
+                                                         grabbable_state::state::device_error,
+                                                         grabbable_state::ungrabbable_temporarily_reason::none,
+                                                         time_utility::mach_absolute_time_point()));

-      grabbable_state_manager_->update(grabbable_state(hid->get_registry_entry_id(),
-                                                       grabbable_state::state::device_error,
-                                                       grabbable_state::ungrabbable_temporarily_reason::none,
-                                                       time_utility::mach_absolute_time_point()));
+        auto hid_queue_value_monitor = std::make_shared<pqrs::osx::iokit_hid_queue_value_monitor>(weak_dispatcher_,
+                                                                                *device_ptr);
+        hid_queue_value_monitors_[device_id] = hid_queue_value_monitor;

-      if (hid->is_karabiner_virtual_hid_device()) {
-        // Handle caps_lock_state_changed event only if the hid is Karabiner-VirtualHIDDevice.
-        hid->values_arrived.connect([this](auto&& shared_event_queue) {
-          for (const auto& e : shared_event_queue->get_entries()) {
-            if (e.get_event().get_type() == event_queue::event::type::caps_lock_state_changed) {
-              if (auto client = grabber_client_.lock()) {
-                if (auto state = e.get_event().get_integer_value()) {
-                  client->async_caps_lock_state_changed(*state);
+        if (iokit_utility::is_karabiner_virtual_hid_device(*device_ptr)) {
+          // Handle caps_lock_state_changed event only if the hid is Karabiner-VirtualHIDDevice.
+          hid_queue_value_monitor->values_arrived.connect([this, device_id](auto&& values_ptr) {
+            auto event_queue = krbn::event_queue::make_queue(device_id, values_ptr);
+
+            for (const auto& e : event_queue->get_entries()) {
+              if (e.get_event().get_type() == event_queue::event::type::caps_lock_state_changed) {
+                if (auto client = grabber_client_.lock()) {
+                  if (auto state = e.get_event().get_integer_value()) {
+                    client->async_caps_lock_state_changed(*state);
+                  }
                 }
               }
             }
+          });
+        } else {
+          hid_queue_value_monitor->values_arrived.connect([this, device_id](auto&& values_ptr) {
+            auto event_queue = krbn::event_queue::make_queue(device_id, values_ptr);
+            grabbable_state_manager_->update(*event_queue);
+          });
+        }
+
+        hid_queue_value_monitor->started.connect([this, device_id, device_name] {
+          logger::get_logger().info("{0} is observed.", device_name);
+
+          if (auto state = grabbable_state_manager_->get_grabbable_state(device_id)) {
+            // Keep grabbable_state if the state is already changed by value_callback.
+            if (state->get_state() == grabbable_state::state::device_error) {
+              grabbable_state_manager_->update(grabbable_state(device_id,
+                                                               grabbable_state::state::grabbable,
+                                                               grabbable_state::ungrabbable_temporarily_reason::none,
+                                                               time_utility::mach_absolute_time_point()));
+            }
           }
         });
-      } else {
-        hid->values_arrived.connect([this](auto&& shared_event_queue) {
-          grabbable_state_manager_->update(*shared_event_queue);
-        });
+
+        hid_queue_value_monitor->async_start(kIOHIDOptionsTypeNone,
+                                             std::chrono::milliseconds(3000));
       }
-
-      auto observer = std::make_shared<hid_observer>(hid);
-      hid_observers_[hid->get_registry_entry_id()] = observer;
-
-      observer->device_observed.connect([this, registry_entry_id, device_name] {
-        logger::get_logger().info("{0} is observed.", device_name);
-
-        if (auto state = grabbable_state_manager_->get_grabbable_state(registry_entry_id)) {
-          // Keep grabbable_state if the state is already changed by value_callback.
-          if (state->get_state() == grabbable_state::state::device_error) {
-            grabbable_state_manager_->update(grabbable_state(registry_entry_id,
-                                                             grabbable_state::state::grabbable,
-                                                             grabbable_state::ungrabbable_temporarily_reason::none,
-                                                             time_utility::mach_absolute_time_point()));
-          }
-        }
-      });
-
-      observer->async_observe();
     });

     hid_manager_->device_terminated.connect([this](auto&& registry_entry_id) {
-      auto it = hids_.find(registry_entry_id);
-      if (it != std::end(hids_)) {
-        logger::get_logger().info("{0} is terminated.", it->second->get_name_for_log());
-      }
+      auto device_id = krbn::make_device_id(registry_entry_id);

-      hid_observers_.erase(registry_entry_id);
-      hids_.erase(registry_entry_id);
+      krbn::logger::get_logger().info("device_id:{0} is terminated.", type_safe::get(device_id));
+
+      hid_queue_value_monitors_.erase(device_id);
     });

     hid_manager_->error_occurred.connect([](auto&& message, auto&& iokit_return) {
@@ -126,10 +128,7 @@
   virtual ~device_observer(void) {
     detach_from_dispatcher([this] {
       hid_manager_ = nullptr;
-
-      hid_observers_.clear();
-      hids_.clear();
-
+      hid_queue_value_monitors_.clear();
       grabbable_state_manager_ = nullptr;
     });

@@ -140,8 +139,7 @@
   std::weak_ptr<grabber_client> grabber_client_;

   std::unique_ptr<pqrs::osx::iokit_hid_manager> hid_manager_;
-  std::unordered_map<pqrs::osx::iokit_registry_entry_id, std::shared_ptr<krbn::human_interface_device>> hids_;
-  std::unordered_map<pqrs::osx::iokit_registry_entry_id, std::shared_ptr<hid_observer>> hid_observers_;
-  std::unique_ptr<grabbable_state_manager> grabbable_state_manager_;
+  std::unordered_map<device_id, std::shared_ptr<pqrs::osx::iokit_hid_queue_value_monitor>> hid_queue_value_monitors_;
+  std::unique_ptr<grabbable_state_manager::manager> grabbable_state_manager_;
 };
 } // namespace krbn


INTEGRATION: CWS ooo19126 (1.99.216); FILE MERGED 2005/09/05 13:41:40 rt 1.99.216.1: #i54170# Change license header: remove SISSL

--- sw/source/core/unocore/unoframe.cxx
+++ sw/source/core/unocore/unoframe.cxx
@@ -1,61 +1,35 @@
  /*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
  *
  *  $RCSfile: unoframe.cxx,v $
  *
- *  $Revision: 1.99 $
+ *  $Revision: 1.100 $
  *
- *  last change: $Author: rt $ $Date: 2005-04-04 08:22:36 $
+ *  last change: $Author: rt $ $Date: 2005-09-09 05:26:25 $
  *
- *  The Contents of this file are made available subject to the terms of
- *  either of the following licenses
- *
- *         - GNU Lesser General Public License Version 2.1
- *         - Sun Industry Standards Source License Version 1.1
- *
- *  Sun Microsystems Inc., October, 2000
- *
- *  GNU Lesser General Public License Version 2.1
- *  =============================================
- *  Copyright 2000 by Sun Microsystems, Inc.
- *  901 San Antonio Road, Palo Alto, CA 94303, USA
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License version 2.1, as published by the Free Software Foundation.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- *  MA  02111-1307  USA
+ *  The Contents of this file are made available subject to
+ *  the terms of GNU Lesser General Public License Version 2.1.
  *
  *
- *  Sun Industry Standards Source License Version 1.1
- *  =================================================
- *  The contents of this file are subject to the Sun Industry Standards
- *  Source License Version 1.1 (the "License"); You may not use this file
- *  except in compliance with the License. You may obtain a copy of the
- *  License at http://www.openoffice.org/license.html.
+ *    GNU Lesser General Public License Version 2.1
+ *    =============================================
+ *    Copyright 2005 by Sun Microsystems, Inc.
+ *    901 San Antonio Road, Palo Alto, CA 94303, USA
  *
- *  Software provided under this License is provided on an "AS IS" basis,
- *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
- *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
- *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
- *  See the License for the specific provisions governing your rights and
- *  obligations concerning the Software.
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public
+ *    License version 2.1, as published by the Free Software Foundation.
  *
- *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *    This library is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *    Lesser General Public License for more details.
  *
- *  Copyright: 2000 by Sun Microsystems, Inc.
- *
- *  All Rights Reserved.
- *
- *  Contributor(s): _______________________________________
- *
+ *    You should have received a copy of the GNU Lesser General Public
+ *    License along with this library; if not, write to the Free Software
+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *    MA  02111-1307  USA
  *
  ************************************************************************/


Added a test case that would have caught the crash from the previous fix

--- src/cryptopp/test/cryptor/tst_cryptortest.cpp
+++ src/cryptopp/test/cryptor/tst_cryptortest.cpp
@@ -34,6 +34,7 @@
     void test_encryption_with_keyfiles();
     void test_nonce();
     void test_encryption_with_all_features();
+    void test_copy();
 };

 void CryptorTest::test_basic_encryption()
@@ -559,6 +560,13 @@
     QVERIFY(exception_hit);
 }

+void CryptorTest::test_copy()
+{
+    Cryptor c1("password", KEYFILE1);
+    Cryptor c2(c1);
+    QVERIFY(c2.CheckPassword("password", KEYFILE1));
+}
+
 QTEST_APPLESS_MAIN(CryptorTest)

 #include "tst_cryptortest.moc"


#80121# createTextCursor in frames: skip tables

--- sw/source/core/unocore/unoframe.cxx
+++ sw/source/core/unocore/unoframe.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: unoframe.cxx,v $
  *
- *  $Revision: 1.6 $
- *
- *  last change: $Author: mib $ $Date: 2000-10-27 13:52:45 $
+ *  $Revision: 1.7 $
+ *
+ *  last change: $Author: os $ $Date: 2000-11-08 14:56:39 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -1894,11 +1894,22 @@
     SwFrmFmt* pFmt = GetFrmFmt();
     if(pFmt)
     {
-        SwPosition aPos(pFmt->GetCntnt().GetCntntIdx()->GetNode());
-        SwXTextCursor* pXCrsr = new SwXTextCursor(this, aPos, CURSOR_FRAME, pFmt->GetDoc());
+        SwPaM aPam(pFmt->GetCntnt().GetCntntIdx()->GetNode());
+        aPam.Move(fnMoveForward, fnGoNode);
+        SwTableNode* pTblNode = aPam.GetNode()->FindTableNode();
+        SwCntntNode* pCont = 0;
+        while( pTblNode )
+        {
+            aPam.GetPoint()->nNode = *pTblNode->EndOfSectionNode();
+            pCont = GetDoc()->GetNodes().GoNext(&aPam.GetPoint()->nNode);
+            pTblNode = pCont->FindTableNode();
+        }
+        if(pCont)
+            aPam.GetPoint()->nContent.Assign(pCont, 0);
+
+        SwXTextCursor* pXCrsr = new SwXTextCursor(this, *aPam.GetPoint(), CURSOR_FRAME, pFmt->GetDoc());
         aRef =  (XWordCursor*)pXCrsr;
         SwUnoCrsr*  pUnoCrsr = pXCrsr->GetCrsr();
-        pUnoCrsr->Move(fnMoveForward, fnGoNode);
 //      // no Cursor in protected sections
 //      SwCrsrSaveState aSave( *pUnoCrsr );
 //      if(pUnoCrsr->IsInProtectTable( sal_True ) ||
@@ -2625,6 +2636,9 @@
 /*------------------------------------------------------------------------

     $Log: not supported by cvs2svn $
+    Revision 1.6  2000/10/27 13:52:45  mib
+    #79648#: Conversion to twip for crop property
+
     Revision 1.5  2000/10/24 14:26:56  os
     #79738# new graphic property: ContourPolyPolygon


Qt Designer: Temporarily disable loading of QDeclarativeView plugin.

Avoid symbol clashes between QtQuick1 and QtQml.

Task-number: QTCREATORBUG-10273
Change-Id: I84d5b378b9e246d67d8114f701ba5d012cbf5cff
Reviewed-by: Eike Ziller <c142da16c73a95a82d35191bcc55b22835617128@digia.com>

--- src/designer/src/lib/shared/pluginmanager.cpp
+++ src/designer/src/lib/shared/pluginmanager.cpp
@@ -698,6 +698,14 @@
     if (m_d->m_registeredPlugins.contains(plugin))
         return;

+    // ###fixme: Temporary workaround for QTCREATORBUG-10273
+    if (QCoreApplication::applicationName() == QLatin1String("QtCreator")
+        && plugin.contains(QLatin1String("declarativeview"), Qt::CaseInsensitive)) {
+        const QString errorMessage = tr("Not loaded due to potential symbol clashes (QTCREATORBUG-10273)");
+        m_d->m_failedPlugins.insert(plugin, errorMessage);
+        return;
+    }
+
     QPluginLoader loader(plugin);
     if (loader.isLoaded() || loader.load()) {
         m_d->m_registeredPlugins += plugin;


[analyzer] Ignore OS X 10.8's annotations for NSMakeCollectable.

The frameworks correctly use the 'cf_consumed' and 'ns_returns_retained'
attributes for NSMakeCollectable, but we can model the behavior under
garbage collection more precisely than that.

No functionality change.

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@161349 91177308-0d34-0410-b5e6-96231b3b80d8

--- lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
+++ lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
@@ -981,6 +981,7 @@

   // No summary?  Generate one.
   const RetainSummary *S = 0;
+  bool AllowAnnotations = true;

   do {
     // We generate "stop" summaries for implicitly defined functions.
@@ -1018,6 +1019,9 @@
       S = (RetTy->isObjCIdType())
           ? getUnarySummary(FT, cfmakecollectable)
           : getPersistentStopSummary();
+      // The headers on OS X 10.8 use cf_consumed/ns_returns_retained,
+      // but we can fully model NSMakeCollectable ourselves.
+      AllowAnnotations = false;
     } else if (FName == "IOBSDNameMatching" ||
                FName == "IOServiceMatching" ||
                FName == "IOServiceNameMatching" ||
@@ -1178,7 +1182,8 @@
     S = getDefaultSummary();

   // Annotations override defaults.
-  updateSummaryFromAnnotations(S, FD);
+  if (AllowAnnotations)
+    updateSummaryFromAnnotations(S, FD);

   FuncSummaries[FD] = S;
   return S;


INTEGRATION: CWS dba201b (1.2.470); FILE MERGED 2005/09/21 06:41:37 oj 1.2.470.2: RESYNC: (1.2-1.3); FILE MERGED 2005/07/18 10:51:13 fs 1.2.470.1: #i51833# also pass the XDataSource object around - the field mapping dialog needs it, since the data source is not registered at the database context

--- extensions/source/abpilot/fieldmappingimpl.hxx
+++ extensions/source/abpilot/fieldmappingimpl.hxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: fieldmappingimpl.hxx,v $
  *
- *  $Revision: 1.3 $
+ *  $Revision: 1.4 $
  *
- *  last change: $Author: rt $ $Date: 2005-09-08 19:07:28 $
+ *  last change: $Author: hr $ $Date: 2005-09-23 12:49:35 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -45,10 +45,16 @@
 #ifndef _COM_SUN_STAR_UNO_REFERENCE_HXX_
 #include <com/sun/star/uno/Reference.hxx>
 #endif
+#ifndef EXTENSIONS_ABP_ADDRESSSETTINGS_HXX
+#include "addresssettings.hxx"
+#endif

 namespace com { namespace sun { namespace star {
     namespace lang {
         class XMultiServiceFactory;
+    }
+    namespace beans {
+        class XPropertySet;
     }
 } } }
 class Window;
@@ -69,20 +75,16 @@
                 service factory to use for creating UNO services
             @param _pParent
                 window to use as parent for the dialog and error messages
-            @param _rDataSourceName
-                name of the data source which should be used
-            @param _rTableName
-                name of the table which should be used
-            @param _rFieldAssignment
-                Upon returning from the function, this is field with the field mapping. If the user cancelled the
-                dialog, this is cleared.
+            @param _rSettings
+                current settings. Upon return, the field mapping member of this
+                structure will be filled with the settings the user did in the
+                field mapping dialog.
         */
         sal_Bool invokeDialog(
             const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
             class Window* _pParent,
-            const ::rtl::OUString& _rDataSourceName,
-            const ::rtl::OUString& _rTableName,
-            MapString2String& /* [out] */ _rFieldAssignment
+            const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxDataSource,
+            AddressSettings& _rSettings
         ) SAL_THROW ( ( ) );

         //-----------------------------------------------------------------


INTEGRATION: CWS swqbugfixes09 (1.92.10); FILE MERGED 2004/11/15 14:11:18 od 1.92.10.2: RESYNC: (1.92-1.93); FILE MERGED 2004/10/25 13:19:59 fme 1.92.10.1: #i35876# Throw IllegalArgumentException if AnchorFrame = null

--- sw/source/core/unocore/unoframe.cxx
+++ sw/source/core/unocore/unoframe.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: unoframe.cxx,v $
  *
- *  $Revision: 1.93 $
- *
- *  last change: $Author: hr $ $Date: 2004-11-09 12:31:53 $
+ *  $Revision: 1.94 $
+ *
+ *  last change: $Author: obo $ $Date: 2004-11-16 15:55:23 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -1422,7 +1422,7 @@
         }
         else if(RES_ANCHOR == pCur->nWID && MID_ANCHOR_ANCHORFRAME == pCur->nMemberId)
         {
-            sal_Bool bDone = sal_True;
+            sal_Bool bDone = sal_False;
             Reference<XTextFrame> xFrame;
             if(aValue >>= xFrame)
             {


Unbreak the wasm backend again after r259035.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@259040 91177308-0d34-0410-b5e6-96231b3b80d8

--- lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
+++ lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
@@ -255,7 +255,7 @@
 static void fail(SDLoc DL, SelectionDAG &DAG, const char *msg) {
   MachineFunction &MF = DAG.getMachineFunction();
   DAG.getContext()->diagnose(
-      DiagnosticInfoUnsupported(DL, *MF.getFunction(), msg, SDValue()));
+      DiagnosticInfoUnsupported(*MF.getFunction(), msg, DL));
 }

 // Test whether the given calling convention is supported.


typo in IndexMarkBackground corrected

typo in IndexMarkBackground corrected

--- sw/source/core/unocore/unoprnms.cxx
+++ sw/source/core/unocore/unoprnms.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: unoprnms.cxx,v $
  *
- *  $Revision: 1.1.1.1 $
- *
- *  last change: $Author: hr $ $Date: 2000-09-19 00:08:28 $
+ *  $Revision: 1.2 $
+ *
+ *  last change: $Author: os $ $Date: 2000-09-21 12:51:52 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -260,7 +260,7 @@
 const SwPropNameLen __FAR_DATA  UNO_NAME_SHOW_PROTECTED_SPACES                  (MAP_CHAR_LEN("ShowProtectedSpaces"));
 const SwPropNameLen __FAR_DATA  UNO_NAME_SHOW_TABLE_BOUNDARIES                  (MAP_CHAR_LEN("ShowTableBoundaries"));
 const SwPropNameLen __FAR_DATA  UNO_NAME_SHOW_HIDDEN_PARAGRAPHS                 (MAP_CHAR_LEN("ShowHiddenParagraphs"));
-const SwPropNameLen __FAR_DATA  UNO_NAME_SHOW_INDEX_MARK_BACKGROUND             (MAP_CHAR_LEN("ShowIndexMarkBacground"));
+const SwPropNameLen __FAR_DATA  UNO_NAME_SHOW_INDEX_MARK_BACKGROUND             (MAP_CHAR_LEN("ShowIndexMarkBackground"));
 const SwPropNameLen __FAR_DATA  UNO_NAME_SHOW_FOOTNOTE_BACKGROUND               (MAP_CHAR_LEN("ShowFootnoteBackground"));
 const SwPropNameLen __FAR_DATA  UNO_NAME_SHOW_TEXT_FIELD_BACKGROUND             (MAP_CHAR_LEN("ShowTextFieldBackground"));
 const SwPropNameLen __FAR_DATA  UNO_NAME_SIZE_RELATIVE                          (MAP_CHAR_LEN("SizeRelative"));


vcproj: Fix solution dir not being created

--- src/mare/Vcproj.cpp
+++ src/mare/Vcproj.cpp
@@ -816,9 +816,9 @@
   // solution dir?
   if(!solutionFile.isEmpty())
   {
-    solutionFile = File::getDirname(solutionFile);
-    if(solutionFile == ".")
-      solutionFile = String();
+    solutionDir = File::getDirname(solutionFile);
+    if (solutionDir == ".")
+        solutionDir = String();
   }
   else
     solutionFile = solutionName + ".sln";


expose StateBase::show()

expose StateBase::show()

--- python/flame/modstate.cpp
+++ python/flame/modstate.cpp
@@ -297,10 +297,28 @@
     } CATCH()
 }

+static
+PyObject* PyState_show(PyObject *raw, PyObject *args, PyObject *kws)
+{
+    TRY {
+        unsigned long level = 1;
+        const char *names[] = {"level", NULL};
+        if(!PyArg_ParseTupleAndKeywords(args, kws, "|k", (char**)names, &level))
+            return NULL;
+
+        std::ostringstream strm;
+        state->state->show(strm, level);
+        return PyString_FromString(strm.str().c_str());
+    } CATCH()
+}
+
 static PyMethodDef PyState_methods[] = {
     {"clone", (PyCFunction)&PyState_clone, METH_NOARGS,
      "clone()\n\n"
      "Returns a new State instance which is a copy of this one"
+    },
+    {"show", (PyCFunction)&PyState_show, METH_VARARGS|METH_KEYWORDS,
+     "show(level=1)"
     },
     {NULL, NULL, 0, NULL}
 };


Redone overwritten changes for platform especific ifdefs

git-svn-id: 7147484e293b9d9635886e886ece62d3d4cac5f2@156 5aee0c02-c622-0410-bcf2-d8652e674aa7

--- video/ofQtUtils.cpp
+++ video/ofQtUtils.cpp
@@ -1,5 +1,5 @@
 #include "ofQtUtils.h"
-
+#ifndef TARGET_LINUX
 static bool bQuicktimeInitialized = false;

 //----------------------------------------
@@ -354,4 +354,4 @@

 #endif
-
+#endif


[InstCombine] Move the call to isSignBitCheck into getDemandedBitsLHSMask instead of calling it outside and passing its result through a flag. NFCI

The result of the isSignBitCheck isn't used anywhere else and this allows us to share the m_APInt call in the likely case that it isn't a sign bit check.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@314018 91177308-0d34-0410-b5e6-96231b3b80d8

--- lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -3921,14 +3921,16 @@
 /// When performing a comparison against a constant, it is possible that not all
 /// the bits in the LHS are demanded. This helper method computes the mask that
 /// IS demanded.
-static APInt getDemandedBitsLHSMask(ICmpInst &I, unsigned BitWidth,
-                                    bool isSignCheck) {
-  if (isSignCheck)
-    return APInt::getSignMask(BitWidth);
-
+static APInt getDemandedBitsLHSMask(ICmpInst &I, unsigned BitWidth) {
   const APInt *RHS;
   if (!match(I.getOperand(1), m_APInt(RHS)))
     return APInt::getAllOnesValue(BitWidth);
+
+  // If this is a normal comparison, it demands all bits. If it is a sign bit
+  // comparison, it only demands the sign bit.
+  bool UnusedBit;
+  if (isSignBitCheck(I.getPredicate(), *RHS, UnusedBit))
+    return APInt::getSignMask(BitWidth);

   switch (I.getPredicate()) {
   // For a UGT comparison, we don't care about any bits that
@@ -4115,20 +4117,11 @@
   if (!BitWidth)
     return nullptr;

-  // If this is a normal comparison, it demands all bits. If it is a sign bit
-  // comparison, it only demands the sign bit.
-  bool IsSignBit = false;
-  const APInt *CmpC;
-  if (match(Op1, m_APInt(CmpC))) {
-    bool UnusedBit;
-    IsSignBit = isSignBitCheck(Pred, *CmpC, UnusedBit);
-  }
-
   KnownBits Op0Known(BitWidth);
   KnownBits Op1Known(BitWidth);

   if (SimplifyDemandedBits(&I, 0,
-                           getDemandedBitsLHSMask(I, BitWidth, IsSignBit),
+                           getDemandedBitsLHSMask(I, BitWidth),
                            Op0Known, 0))
     return &I;


INTEGRATION: CWS changefileheader (1.16.34); FILE MERGED 2008/04/01 15:57:38 thb 1.16.34.3: #i85898# Stripping all external header guards 2008/04/01 12:54:35 thb 1.16.34.2: #i85898# Stripping all external header guards 2008/03/31 16:55:16 rt 1.16.34.1: #i87441# Change license header to LPGL v3.

--- sw/source/core/unocore/unorefmk.cxx
+++ sw/source/core/unocore/unorefmk.cxx
@@ -1,35 +1,30 @@
 /*************************************************************************
  *
- *  OpenOffice.org - a multi-platform office productivity suite
- *
- *  $RCSfile: unorefmk.cxx,v $
- *
- *  $Revision: 1.16 $
- *
- *  last change: $Author: rt $ $Date: 2008-03-12 12:33:40 $
- *
- *  The Contents of this file are made available subject to
- *  the terms of GNU Lesser General Public License Version 2.1.
- *
- *
- *    GNU Lesser General Public License Version 2.1
- *    =============================================
- *    Copyright 2005 by Sun Microsystems, Inc.
- *    901 San Antonio Road, Palo Alto, CA 94303, USA
- *
- *    This library is free software; you can redistribute it and/or
- *    modify it under the terms of the GNU Lesser General Public
- *    License version 2.1, as published by the Free Software Foundation.
- *
- *    This library is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *    Lesser General Public License for more details.
- *
- *    You should have received a copy of the GNU Lesser General Public
- *    License along with this library; if not, write to the Free Software
- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- *    MA  02111-1307  USA
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: unorefmk.cxx,v $
+ * $Revision: 1.17 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
  *
  ************************************************************************/

@@ -37,36 +32,16 @@
 #include "precompiled_sw.hxx"

-#ifndef _VOS_MUTEX_HXX_ //autogen
 #include <vos/mutex.hxx>
-#endif
-#ifndef _SV_SVAPP_HXX //autogen
 #include <vcl/svapp.hxx>
-#endif
-#ifndef _UNOOBJ_HXX
 #include <unoobj.hxx>
-#endif
-#ifndef _UNOMAP_HXX
 #include <unomap.hxx>
-#endif
-#ifndef _UNOCRSR_HXX
 #include <unocrsr.hxx>
-#endif
-#ifndef _DOC_HXX //autogen
 #include <doc.hxx>
-#endif
-#ifndef _NDTXT_HXX //autogen
 #include <ndtxt.hxx>
-#endif
-#ifndef _FMTRFMRK_HXX //autogen
 #include <fmtrfmrk.hxx>
-#endif
-#ifndef _TXTRFMRK_HXX //autogen
 #include <txtrfmrk.hxx>
-#endif
-#ifndef _HINTS_HXX
 #include <hints.hxx>
-#endif

 using namespace ::com::sun::star;
 using ::rtl::OUString;


Fix small typo in variable name

Fix small typo in variable name

--- python/pybind11_Image.hpp
+++ python/pybind11_Image.hpp
@@ -161,13 +161,13 @@

     static handle cast(const eos::core::Image4u& src, return_value_policy /* policy */, handle /* parent */)
 	{
-		const std::size_t num_chanels = 4;
+		const std::size_t num_channels = 4;
 		std::vector<std::size_t> shape;
-		shape = { static_cast<std::size_t>(src.height()), static_cast<std::size_t>(src.width()), num_chanels };
+		shape = { static_cast<std::size_t>(src.height()), static_cast<std::size_t>(src.width()), num_channels };

 		// (2048, 4, 1) is default which results in transposed image
 		// Below line works now. In numpy the strides are (2048, 4, 1) though. I think a copy gets created nevertheless?
-		std::vector<size_t> strides = { num_chanels, num_chanels * src.height(), 1 }; // might be cols or rows...? I think rows?
+		std::vector<size_t> strides = { num_channels, num_channels * src.height(), 1 }; // might be cols or rows...? I think rows?
 		// Note: I think with the change to the new Image class (July 2018), which is now row-major by default, the strides here might have changed. I didn't check.
 		// Also, since the new Image stores a vector of Pixels, the question is whether there's any padding added by the compiler, but probably not, since all types that we use are 1 byte or a multiple thereof.
 		return array(pybind11::dtype::of<std::uint8_t>(), shape, strides, &src(0, 0).data()[0]).release();