bug fix. re-generating pri_bio and privateKey when new Key(string)

--- SimpleCertificateManager.hpp
+++ SimpleCertificateManager.hpp
@@ -244,6 +244,8 @@
     this->kbits = kbits;
     this->privateKey = bio2string(pri_bio);
   }
+
+  // PEM
   Key(const string& privateKey = "", const string& passphrase = "") {
     if (privateKey.empty())  // empty key.
       return;
@@ -271,7 +273,19 @@
     if(!X509_PUBKEY_set(&this->pubkey, this->key))
       throw std::runtime_error("X509_PUBKEY_set");

-    this->privateKey = privateKey;
+    // just make sure, pri_bio and privatekey are generated openssl API
+    BIO_free(this->pri_bio);
+    if ((pri_bio = BIO_new(BIO_s_mem())) == NULL )
+      throw std::runtime_error("BIO_new");
+
+    if (PEM_write_bio_PKCS8PrivateKey(this->pri_bio,
+                                      this->key,
+                                      NULL,
+                                      NULL,
+                                      0, NULL, NULL) != 1)
+      throw std::runtime_error("RSA_generate_key_ex");
+
+    this->privateKey = bio2string(pri_bio);
     this->kbits =  RSA_bits(rsa);
   }
   ~Key() {
@@ -288,6 +302,7 @@
   std::string getPrivateKeyString() {
     return privateKey;
   }
+

   std::string getPrivateKeyPrint(const int indent = 0) {
     if (this->key == NULL)


Add new card id, fix typos

Add new card id, fix typos

--- WhateverGreen/kern_model.cpp
+++ WhateverGreen/kern_model.cpp
@@ -174,6 +174,7 @@
 	{Model::DetectSub, 0x103c, 0x6882, 0x0000, "AMD Radeon HD 6670"},
 	{Model::DetectSub, 0x174b, 0xe181, 0x0000, "AMD Radeon HD 6670"},
 	{Model::DetectSub, 0x1787, 0x2309, 0x0000, "AMD Radeon HD 6670"},
+	{Model::DetectSub, 0x1458, 0x2205, 0x0000, "AMD Radeon HD 6670"},
 	{Model::DetectDef, 0x0000, 0x0000, 0x0000, "AMD Radeon HD 7670"}
 };

@@ -201,12 +202,12 @@
 	{Model::DetectSub, 0x103c, 0x167d, 0x0000, "AMD Radeon HD 6490M"},
 	{Model::DetectSub, 0x103c, 0x167f, 0x0000, "AMD Radeon HD 6490M"},
 	{Model::DetectSub, 0x103c, 0x169c, 0x0000, "AMD Radeon HD 6490M"},
-	{Model::DetectSub, 0x103c, 0x1855, 0x0000, "AMD Radeon 7450M"},
-	{Model::DetectSub, 0x103c, 0x1859, 0x0000, "AMD Radeon 7450M"},
-	{Model::DetectSub, 0x103c, 0x185c, 0x0000, "AMD Radeon 7450M"},
+	{Model::DetectSub, 0x103c, 0x1855, 0x0000, "AMD Radeon HD 7450M"},
+	{Model::DetectSub, 0x103c, 0x1859, 0x0000, "AMD Radeon HD 7450M"},
+	{Model::DetectSub, 0x103c, 0x185c, 0x0000, "AMD Radeon HD 7450M"},
 	{Model::DetectSub, 0x103c, 0x185d, 0x0000, "AMD Radeon HD 7470M"},
 	{Model::DetectSub, 0x103c, 0x185f, 0x0000, "AMD Radeon HD 7470M"},
-	{Model::DetectSub, 0x103c, 0x1863, 0x0000, "AMD Radeon 7450M"},
+	{Model::DetectSub, 0x103c, 0x1863, 0x0000, "AMD Radeon HD 7450M"},
 	{Model::DetectSub, 0x103c, 0x355c, 0x0000, "AMD Radeon HD 6490M"},
 	{Model::DetectSub, 0x103c, 0x355f, 0x0000, "AMD Radeon HD 6490M"},
 	{Model::DetectSub, 0x103c, 0x3581, 0x0000, "AMD Radeon HD 6490M"},
@@ -216,7 +217,7 @@
 	{Model::DetectSub, 0x103c, 0x3596, 0x0000, "AMD Radeon HD 6490M"},
 	{Model::DetectSub, 0x103c, 0x3671, 0x0000, "AMD FirePro M3900"},
 	{Model::DetectSub, 0x1043, 0x100a, 0x0000, "AMD Radeon HD 7470M"},
-	{Model::DetectSub, 0x1043, 0x102a, 0x0000, "AMD Radeon 7450M"},
+	{Model::DetectSub, 0x1043, 0x102a, 0x0000, "AMD Radeon HD 7450M"},
 	{Model::DetectSub, 0x1043, 0x104b, 0x0000, "AMD Radeon HD 7470M"},
 	{Model::DetectSub, 0x1043, 0x105d, 0x0000, "AMD Radeon HD 7470M"},
 	{Model::DetectSub, 0x1043, 0x106b, 0x0000, "AMD Radeon HD 7470M"},
@@ -261,14 +262,14 @@
 	{Model::DetectSub, 0x144d, 0xc0b3, 0x0000, "AMD Radeon HD 6490M"},
 	{Model::DetectSub, 0x144d, 0xc609, 0x0000, "AMD Radeon HD 7470M"},
 	{Model::DetectSub, 0x144d, 0xc625, 0x0000, "AMD Radeon HD 7470M"},
-	{Model::DetectSub, 0x144d, 0xc636, 0x0000, "AMD Radeon 7450M"},
-	{Model::DetectSub, 0x17aa, 0x3900, 0x0000, "AMD Radeon 7450M"},
-	{Model::DetectSub, 0x17aa, 0x3902, 0x0000, "AMD Radeon 7450M"},
-	{Model::DetectSub, 0x17aa, 0x3970, 0x0000, "AMD Radeon 7450M"},
+	{Model::DetectSub, 0x144d, 0xc636, 0x0000, "AMD Radeon HD 7450M"},
+	{Model::DetectSub, 0x17aa, 0x3900, 0x0000, "AMD Radeon HD 7450M"},
+	{Model::DetectSub, 0x17aa, 0x3902, 0x0000, "AMD Radeon HD 7450M"},
+	{Model::DetectSub, 0x17aa, 0x3970, 0x0000, "AMD Radeon HD 7450M"},
 	{Model::DetectSub, 0x17aa, 0x5101, 0x0000, "AMD Radeon HD 7470M"},
-	{Model::DetectSub, 0x17aa, 0x5102, 0x0000, "AMD Radeon 7450M"},
-	{Model::DetectSub, 0x17aa, 0x5103, 0x0000, "AMD Radeon 7450M"},
-	{Model::DetectSub, 0x17aa, 0x5106, 0x0000, "AMD Radeon 7450M"},
+	{Model::DetectSub, 0x17aa, 0x5102, 0x0000, "AMD Radeon HD 7450M"},
+	{Model::DetectSub, 0x17aa, 0x5103, 0x0000, "AMD Radeon HD 7450M"},
+	{Model::DetectSub, 0x17aa, 0x5106, 0x0000, "AMD Radeon HD 7450M"},
 	{Model::DetectDef, 0x0000, 0x0000, 0x0000, "AMD Radeon HD 6470M"}
 };

@@ -427,7 +428,7 @@
 };

 static constexpr Model dev6819[] {
-	{Model::DetectSub, 0x174b, 0xe221, 0x0000, "AMD Radeon 7850"},
+	{Model::DetectSub, 0x174b, 0xe221, 0x0000, "AMD Radeon HD 7850"},
 	{Model::DetectSub, 0x1462, 0x3058, 0x0000, "AMD Radeon R7 265"},
 	{Model::DetectDef, 0x0000, 0x0000, 0x0000, "AMD Radeon R9 270"}
 };
@@ -573,7 +574,7 @@
 };

 static constexpr Model dev68c1[] {
-	{Model::DetectSub, 0x1025, 0x0347, 0x0000, "ATI Mobility Radeon 5470"},
+	{Model::DetectSub, 0x1025, 0x0347, 0x0000, "ATI Mobility Radeon HD 5470"},
 	{Model::DetectSub, 0x1025, 0x0517, 0x0000, "AMD Radeon HD 6550M"},
 	{Model::DetectSub, 0x1025, 0x051a, 0x0000, "AMD Radeon HD 6550M"},
 	{Model::DetectSub, 0x1025, 0x051b, 0x0000, "AMD Radeon HD 6550M"},


Updated engine to pass lights to the trace strategy

--- Source/RTEngine/RTEngine.hpp
+++ Source/RTEngine/RTEngine.hpp
@@ -24,7 +24,7 @@
         template <class TraceStrategy, class RenderStrategy>
         void Render(void)
         {
-            TraceStrategy trace(_World);
+            TraceStrategy trace(_Shapes, _Lights);
             RenderStrategy render(_ScreenWidth, _ScreenHeight);

             Vector3D eyeLoc = {0.0, 0.0, -EyeDepth};


Logging: Time::GetTimeStamp() returns timestamp string in "YYYY-MM-DD hh:mm" format.

--- Source/Urho3D/Core/Timer.cpp
+++ Source/Urho3D/Core/Timer.cpp
@@ -163,10 +163,12 @@

 String Time::GetTimeStamp()
 {
+    char dateTime[20];
     time_t sysTime;
     time(&sysTime);
-    const char* dateTime = ctime(&sysTime);
-    return String(dateTime).Replaced("\n", "");
+    tm* timeInfo = localtime(&sysTime);
+    strftime(dateTime, sizeof(dateTime), "%F %T", timeInfo);
+    return dateTime;
 }

 void Time::Sleep(unsigned mSec)


The initial render tree update (for the empty document) triggers the parsing of
the default compiled-in style sheets (> 20k of data) which adds extra latency
before requesting the main resource.

This CL makes Blink request the main resource upon cross-site navigation (i.e.
when a renderer process is spawned) 20ms earlier (50ms -> 30ms) on Nexus4.

BUG=359048

Review URL: https://codereview.chromium.org/222063003

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@170787 bbb929c8-8fbe-4397-9dbb-9b2b20218538

--- Source/core/dom/Document.cpp
+++ Source/core/dom/Document.cpp
@@ -4475,6 +4475,12 @@
     RefPtr<Document> protect(this);

     if (RefPtr<LocalFrame> f = frame()) {
+        // Don't update the render tree if we haven't requested the main resource yet to avoid
+        // adding extra latency. Note that the first render tree update can be expensive since it
+        // triggers the parsing of the default stylesheets which are compiled-in.
+        const bool mainResourceWasAlreadyRequested =
+            m_frame->loader().stateMachine()->startedFirstRealLoad();
+
         // FrameLoader::finishedParsing() might end up calling Document::implicitClose() if all
         // resource loads are complete. HTMLObjectElements can start loading their resources from
         // post attach callbacks triggered by recalcStyle().  This means if we parse out an <object>
@@ -4482,7 +4488,8 @@
         // started the resource load and might fire the window load event too early.  To avoid this
         // we force the styles to be up to date before calling FrameLoader::finishedParsing().
         // See https://bugs.webkit.org/show_bug.cgi?id=36864 starting around comment 35.
-        updateRenderTreeIfNeeded();
+        if (mainResourceWasAlreadyRequested)
+            updateRenderTreeIfNeeded();

         f->loader().finishedParsing();


Thickness might be in the shared functional group.

The functional groups are not searched unless an index is supplied.

--- Source/vtkDICOMGenerator.cxx
+++ Source/vtkDICOMGenerator.cxx
@@ -1469,7 +1469,7 @@
     {
     vtkDICOMMetaDataAdapter sourceAdapter(source);
     thickness = sourceAdapter->GetAttributeValue(
-      DC::SliceThickness).AsDouble();
+      0, DC::SliceThickness).AsDouble();
     }
   if (thickness <= 0)
     {


Fix GenerateDateTime for pre-epoch times.

There was a mistake in the code that resulted in a negative modulus
after a division.

--- Source/vtkDICOMUtilities.cxx
+++ Source/vtkDICOMUtilities.cxx
@@ -221,6 +221,11 @@
   // separate time into days and seconds
   int td = static_cast<int>(t/86400000000ll);
   long long tus = t - td*86400000000ll;
+  if (tus < 0)
+  {
+    td -= 1;
+    tus += 86400000000ll;
+  }

   // use algorithm from Henry F. Fliegel and Thomas C. Van Flandern,
   // computes the current date according to Gregorian calendar


replace OctreePointCloud with OctreePointCloudSearch

git-svn-id: e7ea667a1d39a4453c4efcc4ba7bca3d620c3f19@2654 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- doc/tutorials/content/sources/octree_search/octree_search.cpp
+++ doc/tutorials/content/sources/octree_search/octree_search.cpp
@@ -26,7 +26,7 @@

   float resolution = 128.0f;

-  pcl::octree::OctreePointCloud<pcl::PointXYZ> octree (resolution);
+  pcl::octree::OctreePointCloudSearch<pcl::PointXYZ> octree (resolution);

   octree.setInputCloud (cloud);
   octree.addPointsFromInputCloud ();


Fixed bug when thread object is NULL for HARMONY-3971 and HARMONY-4469

svn path=/harmony/; revision=573306

--- enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_ti_instr.cpp
+++ enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_ti_instr.cpp
@@ -25,6 +25,7 @@
 #include <open/jthread.h>
 #include <open/thread_externals.h>
 #include "vm_threads.h"
+#include "object_handles.h"

 /**
  * Returns the list of all Java threads.
@@ -47,7 +48,7 @@
         hythread_t native_thread = hythread_iterator_next(&iterator);
         vm_thread_t vm_thread =
             (vm_thread_t) hythread_tls_get(native_thread, TM_THREAD_VM_TLS_KEY);
-        if (vm_thread) {
+        if (vm_thread && vm_thread->java_thread) {
             java_thread_count++;
         }
     }
@@ -64,8 +65,14 @@
         hythread_t native_thread = hythread_iterator_next(&iterator);
         vm_thread_t vm_thread =
             (vm_thread_t) hythread_tls_get(native_thread, TM_THREAD_VM_TLS_KEY);
-        if (vm_thread) {
-            java_threads[java_thread_count++] = vm_thread->java_thread;
+        if (vm_thread && vm_thread->java_thread) {
+            hythread_suspend_disable();
+            ObjectHandle thr = oh_allocate_local_handle();
+            assert(thr);
+            thr->object = vm_thread->java_thread->object;
+            assert(thr->object);
+            hythread_suspend_enable();
+            java_threads[java_thread_count++] = thr;
         }
     }
     *threads = java_threads;


L3G: updated library with timeout functions similar to the ones found in the LSM303 library.

--- L3G/L3G.cpp
+++ L3G/L3G.cpp
@@ -11,7 +11,36 @@
 #define L3GD20_ADDRESS_SA0_LOW    (0xD4 >> 1)
 #define L3GD20_ADDRESS_SA0_HIGH   (0xD6 >> 1)

+// Constructors ////////////////////////////////////////////////////////////////
+
+L3G::L3G(void)
+{
+  _device = device_auto;
+
+  io_timeout = 0;  // 0 = no timeout
+  did_timeout = false;
+}
+
 // Public Methods //////////////////////////////////////////////////////////////
+
+// Did a timeout occur in read() since the last call to timeoutOccurred()?
+bool L3G::timeoutOccurred()
+{
+  bool tmp = did_timeout;
+  did_timeout = false;
+  return tmp;
+
+}
+
+void L3G::setTimeout(unsigned int timeout)
+{
+  io_timeout = timeout;
+}
+
+unsigned int L3G::getTimeout()
+{
+  return io_timeout;
+}

 bool L3G::init(byte device, byte sa0)
 {
@@ -94,8 +123,16 @@
   Wire.write(L3G_OUT_X_L | (1 << 7));
   Wire.endTransmission();
   Wire.requestFrom(address, (byte)6);
-
-  while (Wire.available() < 6);
+
+  unsigned int millis_start = millis();
+  while (Wire.available() < 6){
+  {
+    if (io_timeout > 0 && ((unsigned int)millis() - millis_start) > io_timeout)
+    {
+      did_timeout = true;
+      return;
+    }
+  }

   uint8_t xlg = Wire.read();
   uint8_t xhg = Wire.read();


When asked for the line start of a line after the end of the buffer, returns the length of the buffer rather than double the length of the buffer.

--- src/CellBuffer.cxx
+++ src/CellBuffer.cxx
@@ -796,7 +796,7 @@
 	if (line < 0)
 		return 0;
 	else if (line > lv.lines)
-		return length;
+		return Length();
 	else
 		return lv.linesData[line].startPosition;
 }


Initial board state is counted for 3-fold draw

--- src/Game/Board.cpp
+++ src/Game/Board.cpp
@@ -45,6 +45,7 @@
     }

     all_pieces_unmoved();
+    ++repeat_count[board_status()]; // Count initial position
 }

 Board::Board(const std::string& fen) :
@@ -139,6 +140,8 @@
     {
         piece_moved[piece_on_square('a', 8)] = true;
     }
+
+    ++repeat_count[board_status()]; // Count initial position
 }

 std::shared_ptr<const Piece>& Board::piece_on_square(char file, int rank)


JS save/load

JS save/load

--- src/JSBindings.cpp
+++ src/JSBindings.cpp
@@ -467,6 +467,7 @@
         {
             if (index >= duk_get_top(ctx)) return in_default;
             if (duk_is_null_or_undefined(ctx, index)) return in_default;
+            if (!duk_is_boolean(ctx, index)) return in_default;
             return duk_to_boolean(ctx, index) == 1 ? true : false;
         }

@@ -474,6 +475,7 @@
         {
             if (index >= duk_get_top(ctx)) return in_default;
             if (duk_is_null_or_undefined(ctx, index)) return in_default;
+            if (!duk_is_number(ctx, index)) return in_default;
             return (float)duk_to_number(ctx, index);
         }

@@ -481,6 +483,7 @@
         {
             if (index >= duk_get_top(ctx)) return in_default;
             if (duk_is_null_or_undefined(ctx, index)) return in_default;
+            if (!duk_is_number(ctx, index)) return in_default;
             return duk_to_uint(ctx, index);
         }

@@ -488,6 +491,7 @@
         {
             if (index >= duk_get_top(ctx)) return in_default;
             if (duk_is_null_or_undefined(ctx, index)) return in_default;
+            if (!duk_is_number(ctx, index)) return in_default;
             return duk_to_int(ctx, index);
         }

@@ -495,6 +499,7 @@
         {
             if (index >= duk_get_top(ctx)) return in_default;
             if (duk_is_null_or_undefined(ctx, index)) return in_default;
+            if (!duk_is_string(ctx, index)) return in_default;
             return duk_to_string(ctx, index);
         }

@@ -6613,6 +6618,22 @@
             READ_INT_TYPE(uint32_t, readUInt32);
             READ_INT_TYPE(float, readFloat);

+            duk_push_c_function(ctx, [](duk_context *ctx)->duk_ret_t
+            {
+                duk_push_this(ctx);
+                duk_get_prop_string(ctx, -1, "\xff""\xff""data");
+                auto pFile = (FILE*)duk_to_pointer(ctx, -1);
+                if (pFile)
+                {
+                    uint8_t val;
+                    fread(&val, sizeof(uint8_t), 1, pFile);
+                    duk_push_boolean(ctx, (duk_bool_t)val);
+                    return 1;
+                }
+                return 0;
+            }, 0);
+            duk_put_prop_string(ctx, -2, "readBool");
+
             // readString
             duk_push_c_function(ctx, [](duk_context *ctx)->duk_ret_t
             {
@@ -6835,6 +6856,21 @@
             }, 1);
             duk_put_prop_string(ctx, -2, "writeFloat");

+            duk_push_c_function(ctx, [](duk_context *ctx)->duk_ret_t
+            {
+                duk_push_this(ctx);
+                duk_get_prop_string(ctx, -1, "\xff""\xff""data");
+                auto pFile = (FILE*)duk_to_pointer(ctx, -1);
+                if (pFile)
+                {
+                    uint8_t val = JS_BOOL(0) ? 1 : 0;
+                    fwrite(&val, sizeof(uint8_t), 1, pFile);
+                    return 0;
+                }
+                return 0;
+            }, 1);
+            duk_put_prop_string(ctx, -2, "writeBool");
+
             // writeString
             duk_push_c_function(ctx, [](duk_context *ctx)->duk_ret_t
             {
@@ -6848,7 +6884,7 @@
                     return 0;
                 }
                 return 0;
-            }, 0);
+            }, 1);
             duk_put_prop_string(ctx, -2, "writeString");

             // Vectors
@@ -6864,7 +6900,7 @@
                     return 0;
                 }
                 return 0;
-            }, 0);
+            }, 1);
             duk_put_prop_string(ctx, -2, "writeVector2");
             duk_push_c_function(ctx, [](duk_context *ctx)->duk_ret_t
             {
@@ -6878,7 +6914,7 @@
                     return 0;
                 }
                 return 0;
-            }, 0);
+            }, 1);
             duk_put_prop_string(ctx, -2, "writeVector3");
             duk_push_c_function(ctx, [](duk_context *ctx)->duk_ret_t
             {
@@ -6892,7 +6928,7 @@
                     return 0;
                 }
                 return 0;
-            }, 0);
+            }, 1);
             duk_put_prop_string(ctx, -2, "writeVector4");
             duk_push_c_function(ctx, [](duk_context *ctx)->duk_ret_t
             {
@@ -6906,7 +6942,7 @@
                     return 0;
                 }
                 return 0;
-            }, 0);
+            }, 1);
             duk_put_prop_string(ctx, -2, "writeMatrix");
             duk_push_c_function(ctx, [](duk_context *ctx)->duk_ret_t
             {
@@ -6920,7 +6956,7 @@
                     return 0;
                 }
                 return 0;
-            }, 0);
+            }, 1);
             duk_put_prop_string(ctx, -2, "writeRect");
             duk_push_c_function(ctx, [](duk_context *ctx)->duk_ret_t
             {
@@ -6934,7 +6970,7 @@
                     return 0;
                 }
                 return 0;
-            }, 0);
+            }, 1);
             duk_put_prop_string(ctx, -2, "writeColor");

             // Done with the object


add vTaskDelete to stop()

add vTaskDelete to stop()

--- src/LXESP32DMX.cpp
+++ src/LXESP32DMX.cpp
@@ -271,6 +271,8 @@
 		vTaskDelay(1);
 	}

+	vTaskDelete( _xHandle );
+
 	_xHandle = NULL;
 	LXSerial2.end();
 }


Option to enable 3.5 update on 3.12.3 utility explicitly

IB-4469

--- src/MainWindow.cpp
+++ src/MainWindow.cpp
@@ -1002,8 +1002,9 @@
 			(
 				t.retryCount( QSmartCardData::Pin1Type ) > 0 &&
 				t.isValid() && (
+					Configuration::instance().object().contains("EIDUPDATER-URL") ||
 					(t.version() == QSmartCardData::VER_3_4 && Configuration::instance().object().contains("EIDUPDATER-URL-34")) ||
-					(t.version() >= QSmartCardData::VER_3_5 && Configuration::instance().object().contains("EIDUPDATER-URL"))
+					(t.version() >= QSmartCardData::VER_3_5 && Configuration::instance().object().contains("EIDUPDATER-URL-35"))
 				) && (
 					!t.authCert().validateEncoding() ||
 					!t.signCert().validateEncoding() ||


update edge cases

update edge cases

--- src/UserServer.cpp
+++ src/UserServer.cpp
@@ -284,7 +284,7 @@
   string user_id {paths[1]};
   if (sessions[user_id] == sessions["empty value"])
   {
-    message.reply(status_codes::BadRequest);
+    message.reply(status_codes::Forbidden);
     return;
   }
   pair<status_code, value> result;
@@ -310,6 +310,11 @@
       user_partition + "/" +
       user_row
       );
+    if (result.first != status_codes::OK)
+    {
+      message.reply(result.first);
+      return;
+    }
     // TODO: Check status code
     // Parse JSON body
     unordered_map<string,string> json_body = unpack_json_object(result.second);
@@ -320,7 +325,7 @@
     string user_friends_string = friends_list_to_string(user_friends);
     result.second = build_json_value("Friends", user_friends_string);
     // Put new friends list
-    do_request(
+    result = do_request(
       methods::PUT,
       string(server_urls::basic_server) + "/" +
       update_entity_auth_op + "/" +
@@ -330,6 +335,11 @@
       user_row,
       result.second
       );
+    if (result.first != status_codes::OK)
+    {
+      message.reply(result.first);
+      return;
+    }
     // TODO: Check return results
     message.reply(status_codes::OK);
     return;
@@ -354,6 +364,11 @@
       user_partition + "/" +
       user_row
       );
+    if (result.first != status_codes::OK)
+    {
+      message.reply(result.first);
+      return;
+    }
     // TODO: Check status code
     // Parse Json body
     unordered_map<string,string> json_body = unpack_json_object(result.second);
@@ -371,7 +386,7 @@
     string user_friends_string = friends_list_to_string(new_user_friends);
     result.second = build_json_value("Friends", user_friends_string);
     // Put new friends list
-    do_request(
+    result = do_request(
       methods::PUT,
       string(server_urls::basic_server) + "/" +
       update_entity_auth_op + "/" +
@@ -381,6 +396,11 @@
       user_row,
       result.second
       );
+    if (result.first != status_codes::OK)
+    {
+      message.reply(result.first);
+      return;
+    }
     // TODO: Check return results
     message.reply(status_codes::OK);
     return;
@@ -404,6 +424,11 @@
       user_row,
       result.second
       );
+    if (result.first != status_codes::OK)
+    {
+      message.reply(result.first);
+      return;
+    }
     // Call Pushserver
     result = do_request(
       methods::POST,
@@ -413,6 +438,11 @@
       user_row + "/" +
       paths[3]
       );
+    if (result.first != status_codes::OK)
+    {
+      message.reply(result.first);
+      return;
+    }
   }
   else {
     // malformed request


Unrolled previous commit.

Unrolled previous commit.

--- src/WaspFacade.cpp
+++ src/WaspFacade.cpp
@@ -94,7 +94,7 @@

 void WaspFacade::handleWeakConstraints() {
     NoopOutputBuilder* tmp = new NoopOutputBuilder();
-    if( wasp::Options::printOnlyOptimum || wasp::Options::maxModels > 1 )
+    if( wasp::Options::printOnlyOptimum && wasp::Options::maxModels > 1 )
         solver.setOutputBuilder( tmp );
     unsigned int result = solveWithWeakConstraints();
     switch( result ) {
@@ -103,7 +103,7 @@
             break;

         case INCOHERENT:
-            if( wasp::Options::printOnlyOptimum || wasp::Options::maxModels > 1 )
+            if( wasp::Options::printOnlyOptimum && wasp::Options::maxModels > 1 )
                 solver.setOutputBuilder( outputBuilder );
             solver.foundIncoherence();
             break;


abort_flag: migrate to class Cancellable

--- src/abort_flag.hxx
+++ src/abort_flag.hxx
@@ -12,19 +12,17 @@
  * used by libraries which don't have their own implementation, but
  * need to know whether the operation has been aborted.
  */
-class AbortFlag {
-    struct async_operation operation;
-
+class AbortFlag final : Cancellable {
 public:
     bool aborted = false;

     AbortFlag(async_operation_ref &async_ref) {
-        operation.Init2<AbortFlag, &AbortFlag::operation, &AbortFlag::Abort>();
-        async_ref.Set(operation);
+        async_ref = *this;
     }

 private:
-    void Abort() {
+    /* virtual methods from class Cancellable */
+    void Cancel() override {
         assert(!aborted);

         aborted = true;


VFS-292: improve write speed

VFS-292: improve write speed

--- src/bufferAgent.cc
+++ src/bufferAgent.cc
@@ -168,7 +168,7 @@

             if(block)
             {
-                //int res = doWrite(wrapper->fileName, block->data, block->data.size(), block->offset, &wrapper->ffi);
+                int res = doWrite(wrapper->fileName, block->data, block->data.size(), block->offset, &wrapper->ffi);

                 wrapper->cond.notify_all();
             }


CheckoutError returns 404 (Not found)

CheckoutError returns 404 (Not found)

--- src/client_http.cc
+++ src/client_http.cc
@@ -514,7 +514,7 @@
 		}
 	} catch (const DocNotFoundError& exc) {
 		error_code = HTTP_STATUS_NOT_FOUND;
-		error.assign("Document not found");
+		error.assign(http_status_str(error_code));
 		// L_EXC(this, "ERROR: %s", error.c_str());
 	} catch (const MissingTypeError& exc) {
 		error_code = HTTP_STATUS_PRECONDITION_FAILED;
@@ -525,8 +525,8 @@
 		error.assign(exc.what());
 		// L_EXC(this, "ERROR: %s", error.c_str());
 	} catch (const CheckoutError& exc) {
-		error_code = HTTP_STATUS_BAD_GATEWAY;
-		error.assign(exc.what());
+		error_code = HTTP_STATUS_NOT_FOUND;
+		error.assign(std::string(http_status_str(error_code)) + ": " + exc.what());
 		// L_EXC(this, "ERROR: %s", error.c_str());
 	} catch (const BaseException& exc) {
 		error_code = HTTP_STATUS_INTERNAL_SERVER_ERROR;
@@ -1200,10 +1200,11 @@
 			mset = db_handler.get_mset(*query_field, nullptr, nullptr, suggestions);
 		}
 	} catch (const CheckoutError&) {
-		/* At the moment when the endpoint it not exist and it is chunck it will return 200 response
-		 * and zero matches this behavior may change in the future for instance ( return 404 )
-		 * if is not chunk return 404
-		 */
+		/* At the moment when the endpoint does not exist and it is chunck it will return 200 response
+		 * with zero matches this behavior may change in the future for instance ( return 404 ) */
+		if (!chunked) {
+			throw;
+		}
 	}

 	L_SEARCH(this, "Suggested queries: %s", [&suggestions]() {
@@ -1221,7 +1222,7 @@
 		enum http_status error_code = HTTP_STATUS_NOT_FOUND;
 		MsgPack err_response = {
 			{ RESPONSE_STATUS, (int)error_code },
-			{ RESPONSE_MESSAGE, "No document found" }
+			{ RESPONSE_MESSAGE, http_status_str(error_code) }
 		};
 		write_http_response(error_code, err_response);


More documentation for collections

More documentation for collections

--- src/collection.hpp
+++ src/collection.hpp
@@ -128,71 +128,102 @@
         void update(){update_trackers(); update_constraints();};
 };

-/*!
-A collection with a "solvent". Uses the Langevin equation:
+//! A collection with a "solvent", using the Langevin equation.
+/*! The Langevin Equation ((modified with \f$\vec{f}\f$):

 \f$\dot{\vec{p}} = - \xi \vec{p} + \vec{f} + \overset{\circ}{\vec{p}}\f$

 Where \f$- \xi \vec{p}\f$ is a drag term, \f$\overset{\circ}{\vec{p}}\f$ is a "random force"
-term, and \f$\vec{f}\f$ is the standard force term. When \f$\vec{f}\f = \vec{0}\f$, particles undergo
-Brownian motion, with \f$\xi = \frac{\k_B T}{m D}\f$.
+term, and \f$\vec{f}\f$ is the standard force term. When \f$\vec{f} = \vec{0}\f$, particles undergo
+Brownian motion, with \f$\xi = \frac{k_B T}{m D}\f$.

 This particular algorithm is from Allen and Tildesley, p. 263:
-\f$\vec{r}(t + \delta t) = \vec{r}(t) + c_1 \delta t \vec{v}(t) + c_2 {\delta t}^2 \vec{a}(t) + \delta{r}_G\f$
-v(t + dt) = c0 v(t) + c1 - c2) dt a(t) + c2 dt a(t + dt) + dv_G
-
-where c0 = exp(- h dt)
-   c1 = (h dt)^-1 (1 - c0)
-   c2 = (h dt)^-1 (1 - c1)
-There are expansions for all 3
-
-dr_G and dv_G are drawn from correlated Gaussian distributions, with
-
-sigma_r^2 = (h dt)^-1 (2 - (h dt)^-1 (3 - 4 exp(-h dt) + exp(-2 h dt))
-sigma_v^2 = 1 - exp(-2 h dt)
-c_{rv} = (h dt)^-1 (1 - exp(-h dt))^2 / sigma_r / sigma_v
-
-Those are the unitless versions, multiply by dt^2 kB T/m, kB T/m, and dt kB T/m respectively
-to get the unit-full versions in the book
+
+\f$
+\begin{align*}
+\vec{r}\left(t+\delta t\right)) & =\vec{r}\left(t\right)+c_{1}\delta t\vec{v}\left(t\right)+c_{2}\delta t^{2}\vec{a}\left(t\right)+\delta r^{G}\\
+\vec{v}\left(t+\delta t\right) & =c_{0}v\left(t\right)+\left(c_{1}-c_{2}\right)\delta t\vec{a}\left(t\right)+c_{2}\delta t\vec{a}\left(t+\delta t\right)+\delta v^{G}
+\end{align*}
+\f$
+
+where
+
+\f$
+\begin{align*}
+c_0 & = e^{- \xi \delta t} &
+c_1 & = \frac{1 - c_0}{\xi \delta t} &
+c_2 & = \frac{1 - c_1}{\xi \delta t}
+\end{align*}
+\f$
+
+There are expansions for all 3; see Allen and Tildesley page 261.
+
+\f$\delta r^G\f$ and \f$\delta v^G\f$ are drawn from correlated Gaussian distributions, with
+
+\f$
+\begin{align*}
+\sigma_{r}^{2} & =\left(\xi dt\right)^{-1}\left[2-\left(\xi dt\right)^{-1}\left(3-4e^{-\xi dt}+e^{-2\xi dt}\right)\right]\\
+\sigma_{v}^{2} & =1-e^{-2\xi dt}\\
+c_{rv} & =\frac{\left(1-e^{-\xi dt}\right)^{2}}{\xi dt\sigma_{r}\sigma_{v}}
+\end{align*}
+\f$
+
+Those are the unitless versions, multiply by \f$\frac{\delta t^2 k_B T}{m}\f$, \f$\frac{k_B
+T}{m}\f$, and \f$\frac{\delta t k_B T}{m}\f$ respectively to get the unit-full versions in the book
+
 */
 class CollectionSol : public Collection {
     protected:
+        //! The random number generator
         BivariateGauss gauss;
         flt dt;
+        //! Damping coefficient, \f$\xi\f$
         flt damping;
-        flt desT; // desired temperature
-        flt sigmar, sigmav, corr; // note that this is sigmar/sqrt(T/m), same for sigmav
-                                  // corr is unitless, and correct
-        flt c0, c1, c2; // from Allen and Tildesley
+        //! desired temperature
+        flt desT;
+        //! note that this is sigmar/sqrt(T/m), same for sigmav
+        //! corr is unitless, and correct
+        flt sigmar, sigmav, corr;
+        flt c0, c1, c2;
+        //! Set c0, c1, c2, sigmar, sigmav, corr from desT, dt, and damping
         void setCs();

     public:
-        CollectionSol(sptr<Box> box, sptr<AtomGroup> atoms,
-                const flt dt, const flt damping, const flt desiredT,
-                vector<sptr<Interaction> > interactions=vector<sptr<Interaction> >(),
-                vector<sptr<StateTracker> > trackers=vector<sptr<StateTracker> >(),
+        CollectionSol(
+                //! Box for the atoms
+                sptr<Box> box,
+                //! The atoms
+                sptr<AtomGroup> atoms,
+                //! The timestep \f$\delta t\f$
+                const flt dt,
+                //! Damping coefficient, \f$\xi\f$
+                const flt damping,
+                //! The desired temperature \f$T\f$
+                const flt desiredT,
+                //! The interactions, other than brownian motion. These provide \f$\vec{f}\f$.
+                vector<sptr<Interaction> > interactions=vector<sptr<Interaction> >(),
+                //! Trackers, such as a neighborlist
+                vector<sptr<StateTracker> > trackers=vector<sptr<StateTracker> >(),
+                //! Constraints
                 vector<sptr<Constraint> > constraints=vector<sptr<Constraint> >());
+        //! Change the desired damping coefficient \f$\xi\f$ or temperature \f$T\f$.
         void changeT(const flt damp, const flt desiredT){
             damping = damp; desT = desiredT; setCs();};
+        //! Change the timestep \f$\delta t\f$.
         void setdt(const flt newdt){dt = newdt; setCs();};
         void timestep();
         //void seed(uint n){gauss.seed(n);};
         //void seed(){gauss.seed();};
 };

+//! A damped collection, equivalent to `CollectionSol` but without the random forces.
+/*! Uses the Langevin Equation (modified with \f$\vec{f}\f$):
+
+\f$\dot{\vec{p}} = - \xi \vec{p} + \vec{f} + \overset{\circ}{\vec{p}}\f$
+
+Except that here, we use \f$\overset{\circ}{\vec{p}} = 0\f$.
+*/
 class CollectionDamped : public Collection {
-    /** Based on CollectionSol, above.
-     * From Allen and Tildesley, p. 263:
-     * r(t + dt) = r(t) + c1 dt v(t) + c2 dt^2 a(t) + dr_G
-     * v(t + dt) = c0 v(t) + (c1 - c2) dt a(t) + c2 dt a(t + dt) + dv_G
-     *
-     * where c0 = exp(- h dt)
-     *       c1 = (h dt)^-1 (1 - c0)
-     *       c2 = (h dt)^-1 (1 - c1)
-     * There are expansions for all 3
-     *
-     * dr_G and dv_G are drawn from correlated Gaussian distributions, which we drop for this one.
-    **/

     protected:
         flt dt;
@@ -212,31 +243,35 @@
         void timestep();
 };

+/*! for use in solution, with damped forces and random forces.
+  *
+  * This uses the same physics as `CollectionSol`, but a different algorithm from Honeycutt and Thirumalai.
+  *
+  * Note that the Honeycutt and Thirumalai algorithm is flawed, and this fixes it to some degree.
+  *
+  * Treats Atom.f as the "configurational force", and Atom.a as
+  * the acceleration due to Atom.f + random force.
+  * Note that d²r/dt² = Atom.f + random force (- damping*v), but we
+  * don't include that.
+  *
+  * 1) find positions: (x0,v0,a0,f0) -> (x, v, a, f)
+  *         sets Atom.x from previous force, velocity, and position
+  *         x = x0 + dt v0 + 1/2 dt^2 a0 - damping*dt²/2m * v0
+  * 2) intermediate v: (v0,f0) -> (v1, f0)
+  *         v1 = damped(v0) +  dt/2 f0/m
+  *                 where damped(vo) = v0*(1-h*damping/2m + (h*damping/m)²/4)
+  * 3) setForces(): (x, f0) -> (x,f)
+  *         reset and set the forces
+  *         f = grad(V(x))
+  * 4) Acceleration: (f, a0) -> (f, a1)
+  *         a1 = f/m + gaussian
+  *         set acceleration given the forces, adding in random pieces, no damping
+  * 5) Finish v and a: (v1, f, a1) -> (v, f, a)
+  *         v = v1 + dt/2 a1
+  *
+
+ **/
 class CollectionSolHT : public Collection {
-    /** for use in solution, with damped forces and random forces
-      *
-      * Treats Atom.f as the "configurational force", and Atom.a as
-      * the acceleration due to Atom.f + random force.
-      * Note that d²r/dt² = Atom.f + random force (- damping*v), but we
-      * don't include that.
-      *
-      * 1) find positions: (x0,v0,a0,f0) -> (x, v, a, f)
-      *         sets Atom.x from previous force, velocity, and position
-      *         x = x0 + dt v0 + 1/2 dt^2 a0 - damping*dt²/2m * v0
-      * 2) intermediate v: (v0,f0) -> (v1, f0)
-      *         v1 = damped(v0) +  dt/2 f0/m
-      *                 where damped(vo) = v0*(1-h*damping/2m + (h*damping/m)²/4)
-      * 3) setForces(): (x, f0) -> (x,f)
-      *         reset and set the forces
-      *         f = grad(V(x))
-      * 4) Acceleration: (f, a0) -> (f, a1)
-      *         a1 = f/m + gaussian
-      *         set acceleration given the forces, adding in random pieces, no damping
-      * 5) Finish v and a: (v1, f, a1) -> (v, f, a)
-      *         v = v1 + dt/2 a1
-      *
-
-     **/
     protected:
         flt dt;
         flt damping;


Allow ROW results for execute statements

Added comment to remember what the status it is good for here

--- src/connection.cpp
+++ src/connection.cpp
@@ -65,6 +65,7 @@
 				switch(rc)
 				{
 				case SQLITE_OK:
+				case SQLITE_ROW: // might occur if execute is called with a select
 				case SQLITE_DONE:
 					return;
 				default:


Move code is changed to work on the window sizes.

--- src/editdialog.cpp
+++ src/editdialog.cpp
@@ -259,7 +259,15 @@

 void EditDialog::on_centerButton_clicked()
 {
-    subPicture->setX((subPicture->screenWidth() - subPicture->imageWidth()) / 2);
+    QVector<QRect> &imageRects = subPicture->windowSizes();
+    int dx = ((subPicture->screenWidth() - subPicture->imageWidth()) / 2) - subPicture->x();
+
+    for (int i = 0; i < imageRects.size(); ++i)
+    {
+        int width = imageRects[i].width();
+        imageRects[i].setX(imageRects[i].x() + dx);
+        imageRects[i].setWidth(width);
+    }

     ui->horizontalSlider->blockSignals(true);

@@ -287,7 +295,16 @@
     }
     ui->verticalSlider->blockSignals(true);

-    subPicture->setY(y);
+    QVector<QRect> &imageRects = subPicture->windowSizes();
+    int dy = y - subPicture->y();
+
+    for (int i = 0; i < imageRects.size(); ++i)
+    {
+        int height = imageRects[i].height();
+        imageRects[i].setY(imageRects[i].y() + dy);
+        imageRects[i].setHeight(height);
+    }
+
     ui->verticalSlider->setValue(subPicture->screenHeight() - subPicture->y());
     ui->subtitleImage->setOffsets(subPicture->x(), subPicture->y());
     ui->subtitleImage->update();
@@ -308,7 +325,16 @@

     ui->verticalSlider->blockSignals(true);

-    subPicture->setY(y);
+    QVector<QRect> &imageRects = subPicture->windowSizes();
+    int dy = y - subPicture->y();
+
+    for (int i = 0; i < imageRects.size(); ++i)
+    {
+        int height = imageRects[i].height();
+        imageRects[i].setY(imageRects[i].y() + dy);
+        imageRects[i].setHeight(height);
+    }
+
     ui->verticalSlider->setValue(subPicture->screenHeight() - subPicture->y());
     ui->subtitleImage->setOffsets(subPicture->x(), subPicture->y());
     ui->subtitleImage->update();
@@ -399,8 +425,22 @@
     SubPicture* subPic = subtitleProcessor->getSubPictureTrg(index);
     subPic->setEndTime(subPicture->endTime());
     subPic->setStartTime(subPicture->startTime());
-    subPic->setX(subPicture->x());
-    subPic->setY(subPicture->y());
+
+    QVector<QRect> &imageRects = subPic->windowSizes();
+    int dx = subPicture->x() - subPic->x();
+    int dy = subPicture->y() - subPic->y();
+
+    for (int i = 0; i < imageRects.size(); ++i)
+    {
+        int width = imageRects[i].width();
+        imageRects[i].setX(imageRects[i].x() + dx);
+        imageRects[i].setWidth(width);
+
+        int height = imageRects[i].height();
+        imageRects[i].setY(imageRects[i].y() + dy);
+        imageRects[i].setHeight(height);
+    }
+
     subPic->setForced(subPicture->isForced());
     subPic->setExclude(subPicture->exclude());
     subPic->erasePatch = subPicture->erasePatch;
@@ -505,7 +545,17 @@
         if (x != subPicture->x())
         {
             ui->horizontalSlider->blockSignals(true);
-            subPicture->setX(x);
+
+            QVector<QRect> &imageRects = subPicture->windowSizes();
+            int dx = x - subPicture->x();
+
+            for (int i = 0; i < imageRects.size(); ++i)
+            {
+                int width = imageRects[i].width();
+                imageRects[i].setX(imageRects[i].x() + dx);
+                imageRects[i].setWidth(width);
+            }
+
             ui->horizontalSlider->setValue(subPicture->x());
             ui->subtitleImage->setOffsets(subPicture->x(), subPicture->y());
             ui->subtitleImage->update();
@@ -530,7 +580,17 @@
         if (y != subPicture->y())
         {
             ui->verticalSlider->blockSignals(true);
-            subPicture->setY(y);
+
+            QVector<QRect> &imageRects = subPicture->windowSizes();
+            int dy = y - subPicture->y();
+
+            for (int i = 0; i < imageRects.size(); ++i)
+            {
+                int height = imageRects[i].height();
+                imageRects[i].setY(imageRects[i].y() + dy);
+                imageRects[i].setHeight(height);
+            }
+
             ui->verticalSlider->setValue(subPicture->screenHeight() - subPicture->y());
             ui->subtitleImage->setOffsets(subPicture->x(), subPicture->y());
             ui->subtitleImage->update();
@@ -558,7 +618,16 @@

     if (y != subPicture->y())
     {
-        subPicture->setY(y);
+        QVector<QRect> &imageRects = subPicture->windowSizes();
+        int dy = y - subPicture->y();
+
+        for (int i = 0; i < imageRects.size(); ++i)
+        {
+            int height = imageRects[i].height();
+            imageRects[i].setY(imageRects[i].y() + dy);
+            imageRects[i].setHeight(height);
+        }
+
         ui->yOffsetLineEdit->setText(QString::number(subPicture->y()));
         ui->subtitleImage->setOffsets(subPicture->x(), subPicture->y());
         ui->subtitleImage->setScreenRatio(21.0 / 9);
@@ -584,7 +653,16 @@

     if (x != subPicture->x())
     {
-        subPicture->setX(x);
+        QVector<QRect> &imageRects = subPicture->windowSizes();
+        int dx = x - subPicture->x();
+
+        for (int i = 0; i < imageRects.size(); ++i)
+        {
+            int width = imageRects[i].width();
+            imageRects[i].setX(imageRects[i].x() + dx);
+            imageRects[i].setWidth(width);
+        }
+
         ui->xOffsetLineEdit->setText(QString::number(subPicture->x()));
         ui->subtitleImage->setOffsets(subPicture->x(), subPicture->y());
         ui->subtitleImage->update();
@@ -695,7 +773,17 @@
     if (x != subPicture->x())
     {
         ui->horizontalSlider->blockSignals(true);
-        subPicture->setX(x);
+
+        QVector<QRect> &imageRects = subPicture->windowSizes();
+        int dx = x - subPicture->x();
+
+        for (int i = 0; i < imageRects.size(); ++i)
+        {
+            int width = imageRects[i].width();
+            imageRects[i].setX(imageRects[i].x() + dx);
+            imageRects[i].setWidth(width);
+        }
+
         ui->horizontalSlider->setValue(subPicture->x());
         ui->subtitleImage->setOffsets(subPicture->x(), subPicture->y());
         ui->subtitleImage->update();
@@ -721,7 +809,17 @@
     if (y != subPicture->y())
     {
         ui->verticalSlider->blockSignals(true);
-        subPicture->setY(y);
+
+        QVector<QRect> &imageRects = subPicture->windowSizes();
+        int dy = y - subPicture->y();
+
+        for (int i = 0; i < imageRects.size(); ++i)
+        {
+            int height = imageRects[i].height();
+            imageRects[i].setY(imageRects[i].y() + dy);
+            imageRects[i].setHeight(height);
+        }
+
         ui->verticalSlider->setValue(subPicture->screenHeight() - subPicture->y());
         ui->subtitleImage->setOffsets(subPicture->x(), subPicture->y());
         ui->subtitleImage->update();


#85774#; don't resize shapes when recalculating the row height and column width while importing xml

--- sc/source/core/data/documen9.cxx
+++ sc/source/core/data/documen9.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: documen9.cxx,v $
  *
- *  $Revision: 1.8 $
- *
- *  last change: $Author: nn $ $Date: 2001-01-31 16:44:36 $
+ *  $Revision: 1.9 $
+ *
+ *  last change: $Author: sab $ $Date: 2001-04-05 15:53:33 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -280,6 +280,8 @@
             }

         UpdateDrawPrinter();
+        if (bImportingXML)
+            pDrawLayer->EnableAdjust(FALSE);
     }
 }

@@ -841,6 +843,10 @@
     }
 }

-
-
-
+void ScDocument::SetImportingXML( BOOL bVal )
+{
+    bImportingXML = bVal;
+    if (pDrawLayer)
+        pDrawLayer->EnableAdjust(!bImportingXML);
+}
+


INTEGRATION: CWS sb91 (1.16.82); FILE MERGED 2008/07/11 09:38:10 sb 1.16.82.1: #i91042# #include <cXXX> vs. <XXX.h> and using identifiers without std:: prefix (which is necessary for old MSVC versions)

--- sc/source/core/data/dptabdat.cxx
+++ sc/source/core/data/dptabdat.cxx
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: dptabdat.cxx,v $
- * $Revision: 1.17 $
+ * $Revision: 1.18 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -35,7 +35,7 @@

 // INCLUDE ---------------------------------------------------------------

-#include <cstdio>
+#include <stdio.h>
 #include <rtl/math.hxx>
 #include <tools/debug.hxx>
 #include <tools/date.hxx>


INTEGRATION: CWS dr58_SRC680 (1.52.56); FILE MERGED 2008/01/11 12:45:26 dr 1.52.56.2: #i84412# set note visibility when copying cells, remove global depenencies from postit.hxx header 2007/12/14 10:50:56 nn 1.52.56.1: #i84560# braces for gcc 4.2.1 warnings (patch fom hub)

--- sc/source/core/data/drwlayer.cxx
+++ sc/source/core/data/drwlayer.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: drwlayer.cxx,v $
  *
- *  $Revision: 1.52 $
+ *  $Revision: 1.53 $
  *
- *  last change: $Author: vg $ $Date: 2007-10-23 14:43:40 $
+ *  last change: $Author: rt $ $Date: 2008-01-29 15:19:08 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -66,11 +66,7 @@
 #include <com/sun/star/datatransfer/XTransferable.hpp>
 #endif

-
-
-
 // INCLUDE ---------------------------------------------------------------
-

 #include "scitems.hxx"
 #include <svx/eeitem.hxx>
@@ -115,6 +111,7 @@
 #include "globstr.hrc"
 #include "scmod.hxx"
 #include "chartarr.hxx"
+#include "postit.hxx"

 #define DET_ARROW_OFFSET    1000

@@ -1436,7 +1433,9 @@
                 }
             }
             else
+            {
                 DBG_ERROR("pPage?");
+            }
         }
 }


[cleanup] Use early exit and simpler temporary variables to clarify the
swap implementation.

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

--- lib/IR/Use.cpp
+++ lib/IR/Use.cpp
@@ -14,27 +14,26 @@
 namespace llvm {

 void Use::swap(Use &RHS) {
-  Value *V1(Val);
-  Value *V2(RHS.Val);
-  if (V1 != V2) {
-    if (V1) {
-      removeFromList();
-    }
+  if (Val == RHS.Val)
+    return;

-    if (V2) {
-      RHS.removeFromList();
-      Val = V2;
-      V2->addUse(*this);
-    } else {
-      Val = 0;
-    }
+  if (Val)
+    removeFromList();

-    if (V1) {
-      RHS.Val = V1;
-      V1->addUse(RHS);
-    } else {
-      RHS.Val = 0;
-    }
+  Value *OldVal = Val;
+  if (RHS.Val) {
+    RHS.removeFromList();
+    Val = RHS.Val;
+    Val->addUse(*this);
+  } else {
+    Val = 0;
+  }
+
+  if (OldVal) {
+    RHS.Val = OldVal;
+    RHS.Val->addUse(RHS);
+  } else {
+    RHS.Val = 0;
   }
 }


Adjusted this to the latest code base to get it to apply...

Change-Id: I95cc141d4d13cf27fcf1e736862093837cc1e065

--- sc/source/core/tool/interpr1.cxx
+++ sc/source/core/tool/interpr1.cxx
@@ -967,24 +967,27 @@
             fRes = (double) ScGlobal::GetCaseCollator()->compareString(
                 *rComp.pVal[ 0 ], *rComp.pVal[ 1 ] );
     }
-#ifdef FIXME_REMOVE_WHEN_RE_BASE_COMPLETE
+
     if (nStringQuery && pOptions)
     {
         const ScQueryEntry& rEntry = pOptions->aQueryEntry;
-        if (!rEntry.bQueryByString && rEntry.pStr->Len() &&
+        const ScQueryEntry::QueryItemsType& rItems = rEntry.GetQueryItems();
+        if (!rItems.empty())
+        {
+            const ScQueryEntry::Item& rItem = rItems[0];
+            if (rItem.meType != ScQueryEntry::ByString && !rItem.maString.isEmpty() &&
                 (rEntry.eOp == SC_EQUAL || rEntry.eOp == SC_NOT_EQUAL))
-        {
-            // As in ScTable::ValidQuery() match a numeric string for a
-            // number query that originated from a string, e.g. in SUMIF
-            // and COUNTIF. Transliteration is not needed here.
-            bool bEqual = rComp.pVal[nStringQuery-1]->Equals( *rEntry.pStr);
-            // match => fRes=0, else fRes=1
-            fRes = (rEntry.eOp == SC_NOT_EQUAL) ? bEqual : !bEqual;
-        }
-    }
-#else
-    (void)nStringQuery;
-#endif
+            {
+                // As in ScTable::ValidQuery() match a numeric string for a
+                // number query that originated from a string, e.g. in SUMIF
+                // and COUNTIF. Transliteration is not needed here.
+                bool bEqual = rComp.pVal[nStringQuery-1]->Equals(rItem.maString);
+                // match => fRes=0, else fRes=1
+                fRes = (rEntry.eOp == SC_NOT_EQUAL) ? bEqual : !bEqual;
+            }
+        }
+    }
+
     return fRes;
 }


Fix incorrectly written assert. This assert would pass if the work_dim was 1 but would fail for larger dimensions. We should add a test case!

--- lib/Logger.cpp
+++ lib/Logger.cpp
@@ -192,7 +192,8 @@
     printJSONArray(ki.localWorkSize);
     *output << "," << endl;

-    assert(ki.globalWorkOffset.size() == ki.globalWorkSize.size() == ki.localWorkSize.size() &&
+    assert( (ki.globalWorkOffset.size() == ki.globalWorkSize.size()) &&
+            (ki.globalWorkSize.size() == ki.localWorkSize.size()) &&
             "dimension mismatch");

     *output << "\"entry_point\": \"" << ki.entryPointName << "\"";


INTEGRATION: CWS changefileheader (1.6.32); FILE MERGED 2008/04/01 15:30:02 thb 1.6.32.2: #i85898# Stripping all external header guards 2008/03/31 17:14:17 rt 1.6.32.1: #i87441# Change license header to LPGL v3.

--- sc/source/core/tool/interpr6.cxx
+++ sc/source/core/tool/interpr6.cxx
@@ -1,35 +1,30 @@
 /*************************************************************************
  *
- *  OpenOffice.org - a multi-platform office productivity suite
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
- *  $RCSfile: interpr6.cxx,v $
+ * Copyright 2008 by Sun Microsystems, Inc.
  *
- *  $Revision: 1.6 $
+ * OpenOffice.org - a multi-platform office productivity suite
  *
- *  last change: $Author: kz $ $Date: 2008-03-06 15:34:40 $
+ * $RCSfile: interpr6.cxx,v $
+ * $Revision: 1.7 $
  *
- *  The Contents of this file are made available subject to
- *  the terms of GNU Lesser General Public License Version 2.1.
+ * 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.
  *
- *    GNU Lesser General Public License Version 2.1
- *    =============================================
- *    Copyright 2005 by Sun Microsystems, Inc.
- *    901 San Antonio Road, Palo Alto, CA 94303, USA
+ * 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).
  *
- *    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
+ * 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.
  *
  ************************************************************************/

@@ -40,10 +35,7 @@

 #include <math.h>
-
-#ifndef _TOOLS_DEBUG_HXX //autogen
 #include <tools/debug.hxx>
-#endif

 #include "interpre.hxx"


Fix dbglevel=2 build in sc.

Fix dbglevel=2 build in sc.

--- sc/source/core/tool/parclass.cxx
+++ sc/source/core/tool/parclass.cxx
@@ -420,7 +420,7 @@
             aBuf.append("ScParameterClassification::Init: too many arguments in listed function: ");
             aBuf.append(rtl::OUStringToOString(*(pDesc->pFuncName), RTL_TEXTENCODING_UTF8));
             aBuf.append(": ");
-            aBuf.append(nArgs);
+            aBuf.append(sal_Int32(nArgs));
             OSL_FAIL( aBuf.getStr());
             nArgs = CommonData::nMaxParams;
             pRun->aData.bRepeatLast = true;


INTEGRATION: CWS calc16 (1.6.42); FILE MERGED 2003/07/18 17:10:05 dr 1.6.42.3: #110656# export of cond. formats reworked 2003/07/17 15:19:48 dr 1.6.42.2: #110656# import of cond. formats reworked 2003/07/11 09:42:10 jmarmion 1.6.42.1: #105281# Excel export of escapement

--- sc/source/filter/inc/xestyle.hxx
+++ sc/source/filter/inc/xestyle.hxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: xestyle.hxx,v $
  *
- *  $Revision: 1.6 $
- *
- *  last change: $Author: vg $ $Date: 2003-05-27 15:08:05 $
+ *  $Revision: 1.7 $
+ *
+ *  last change: $Author: rt $ $Date: 2003-09-16 08:19:16 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -73,6 +73,9 @@
 #endif
 #ifndef INCLUDED_SVTOOLS_NFKEYTAB_HXX
 #include <svtools/nfkeytab.hxx>
+#endif
+#ifndef _SVX_SVXFONT_HXX
+#include <svx/svxfont.hxx>
 #endif

 #ifndef SC_XLSTYLE_HXX
@@ -118,70 +121,6 @@
     return the real Excel palette index for all color identifiers. */
 class XclExpPalette : public XclExpRecord, public XclDefaultPalette, protected XclExpRoot
 {
-private:
-    /** Represents an entry in a color list.
-        @descr  the color stores a weighting value, which increases the more the color
-        is used in the document. Heavy-weighted colors will change less than others on
-        color reduction. */
-    class XclListColor
-    {
-        DECL_FIXEDMEMPOOL_NEWDEL( XclListColor )
-
-    private:
-        Color                   maColor;    /// The color value of this palette entry.
-        sal_uInt32              mnColorId;  /// Unique color ID for color reduction.
-        sal_uInt32              mnWeight;   /// Weighting for color reduction.
-
-    public:
-        explicit                XclListColor( const Color& rColor, sal_uInt32 nColorId );
-
-        /** Returns the RGB color value of the color. */
-        inline const Color&     GetColor() const { return maColor; }
-        /** Returns the unique ID of the color. */
-        inline sal_uInt32       GetColorId() const { return mnColorId; }
-        /** Returns the current weighting of the color. */
-        inline sal_uInt32       GetWeighting() const { return mnWeight; }
-        /** Returns true, if this color value is greater than rColor (simple arithmetic comparison). */
-        inline bool             IsGreater( const Color& rColor ) const { return maColor.GetColor() > rColor.GetColor(); }
-        /** Returns true, if this color is equal to rColor. */
-        inline bool             IsEqual( const Color& rColor ) const { return maColor.GetColor() == rColor.GetColor(); }
-
-        /** Updates the weighting of this color dependent from nColorType. */
-        void                    UpdateWeighting( XclColorType eType );
-        /** Adds the weighting of rColor to this color. */
-        inline void             AddWeighting( const XclListColor& rColor ) { mnWeight += rColor.mnWeight; }
-        /** Merges this color with rColor, regarding weighting settings. */
-        void                    Merge( const XclListColor& rColor );
-    };
-
-    /** Data for each inserted original color, represented by a color ID. */
-    struct XclColorIdData
-    {
-        Color                   maColor;    /// The original inserted color.
-        sal_uInt32              mnIndex;    /// Maps current color ID to color list or export color vector.
-        /** Sets the contents of this struct. */
-        inline void             Set( const Color& rColor, sal_uInt32 nIndex ) { maColor = rColor; mnIndex = nIndex; }
-    };
-
-    /** A color that will be written to the Excel file. */
-    struct XclPaletteColor
-    {
-        Color                   maColor;    /// Resulting color to export.
-        bool                    mbDefault;  /// true = Entry is a default color.
-        /** Sets a new color.
-            @param bDefault  true = Color is a color from default palette. */
-        inline void             SetColor( const Color& rColor, bool bDefault = false ) { maColor = rColor; mbDefault = bDefault; }
-    };
-
-    typedef ScfDelList< XclListColor >          XclListColorList;
-    typedef ::std::vector< XclColorIdData >     XclColorIdDataVec;
-    typedef ::std::vector< XclPaletteColor >    XclPaletteColorVec;
-
-    XclListColorList            maColorList;        /// Working color list.
-    XclColorIdDataVec           maColorIdDataVec;   /// Data of all CIDs.
-    XclPaletteColorVec          maPalette;          /// Contains resulting colors to export.
-    sal_uInt32                  mnLastIx;           /// Last insertion index for search opt.
-
 public:
     explicit                    XclExpPalette( const XclExpRoot& rRoot );

@@ -210,13 +149,20 @@
                                     sal_uInt32 nForeColorId, sal_uInt32 nBackColorId ) const;

     /** Returns the RGB color data for a (non-zero-based) Excel palette entry.
-        @param nDefault  Is returned, if nothing else could be found. */
-    ColorData                   GetColorData( sal_uInt16 nXclIndex, ColorData nDefault = COL_AUTO ) const;
+        @return  The color from current or default palette or COL_AUTO, if nothing else found. */
+    ColorData                   GetColorData( sal_uInt16 nXclIndex ) const;
     /** Returns the color for a (non-zero-based) Excel palette entry.
-        @param nDefault  Is returned, if nothing else could be found. */
-    inline Color                GetColor( sal_uInt16 nXclIndex, ColorData nDefault = COL_AUTO ) const;
-
-private:
+        @return  The color from current or default palette or COL_AUTO, if nothing else found. */
+    inline Color                GetColor( sal_uInt16 nXclIndex ) const
+                                    { return Color( GetColorData( nXclIndex ) ); }
+
+
+private:
+    class XclListColor;
+
+    /** Returns the Excel index of a 0-based color index. */
+    inline sal_uInt16           GetXclIndex( sal_uInt32 nIndex ) const;
+
     /** Returns the original inserted color represented by the color ID nColorId. */
     const Color&                GetOriginalColor( sal_uInt32 nColorId ) const;

@@ -253,29 +199,89 @@

     /** Writes the contents of the PALETTE record. */
     virtual void                WriteBody( XclExpStream& rStrm );
-};
-
-inline Color XclExpPalette::GetColor( sal_uInt16 nXclIndex, ColorData nDefault ) const
-{
-    return Color( GetColorData( nXclIndex, nDefault ) );
+
+private:
+    /** Represents an entry in a color list.
+        @descr  the color stores a weighting value, which increases the more the color
+        is used in the document. Heavy-weighted colors will change less than others on
+        color reduction. */
+    class XclListColor
+    {
+        DECL_FIXEDMEMPOOL_NEWDEL( XclListColor )
+
+    private:
+        Color                   maColor;    /// The color value of this palette entry.
+        sal_uInt32              mnColorId;  /// Unique color ID for color reduction.
+        sal_uInt32              mnWeight;   /// Weighting for color reduction.
+
+    public:
+        explicit                XclListColor( const Color& rColor, sal_uInt32 nColorId );
+
+        /** Returns the RGB color value of the color. */
+        inline const Color&     GetColor() const { return maColor; }
+        /** Returns the unique ID of the color. */
+        inline sal_uInt32       GetColorId() const { return mnColorId; }
+        /** Returns the current weighting of the color. */
+        inline sal_uInt32       GetWeighting() const { return mnWeight; }
+        /** Returns true, if this color value is greater than rColor (simple arithmetic comparison). */
+        inline bool             IsGreater( const Color& rColor ) const { return maColor.GetColor() > rColor.GetColor(); }
+        /** Returns true, if this color is equal to rColor. */
+        inline bool             IsEqual( const Color& rColor ) const { return maColor.GetColor() == rColor.GetColor(); }
+
+        /** Updates the weighting of this color dependent from nColorType. */
+        void                    UpdateWeighting( XclColorType eType );
+        /** Adds the weighting of rColor to this color. */
+        inline void             AddWeighting( const XclListColor& rColor ) { mnWeight += rColor.mnWeight; }
+        /** Merges this color with rColor, regarding weighting settings. */
+        void                    Merge( const XclListColor& rColor );
+    };
+
+    /** Data for each inserted original color, represented by a color ID. */
+    struct XclColorIdData
+    {
+        Color                   maColor;    /// The original inserted color.
+        sal_uInt32              mnIndex;    /// Maps current color ID to color list or export color vector.
+        /** Sets the contents of this struct. */
+        inline void             Set( const Color& rColor, sal_uInt32 nIndex ) { maColor = rColor; mnIndex = nIndex; }
+    };
+
+    /** A color that will be written to the Excel file. */
+    struct XclPaletteColor
+    {
+        Color                   maColor;    /// Resulting color to export.
+        bool                    mbDefault;  /// true = Entry is a default color.
+        /** Sets a new color.
+            @param bDefault  true = Color is a color from default palette. */
+        inline void             SetColor( const Color& rColor, bool bDefault = false ) { maColor = rColor; mbDefault = bDefault; }
+    };
+
+    typedef ScfDelList< XclListColor >          XclListColorList;
+    typedef ::std::vector< XclColorIdData >     XclColorIdDataVec;
+    typedef ::std::vector< XclPaletteColor >    XclPaletteColorVec;
+
+    XclListColorList            maColorList;        /// Working color list.
+    XclColorIdDataVec           maColorIdDataVec;   /// Data of all CIDs.
+    XclPaletteColorVec          maPalette;          /// Contains resulting colors to export.
+    sal_uInt32                  mnLastIx;           /// Last insertion index for search opt.
+};
+
+inline sal_uInt16 XclExpPalette::GetXclIndex( sal_uInt32 nIndex ) const
+{
+    return static_cast< sal_uInt16 >( nIndex + EXC_COLOR_USEROFFSET );
 }

 // FONT record - font information =============================================

 class Font;
+class SvxFont;

 /** Stores all data of an Excel font and provides export of FONT records. */
 class XclExpFont : public XclExpRecord, protected XclExpRoot
 {
-private:
-    XclFontData                 maData;         /// All font attributes.
-    sal_uInt32                  mnColorId;      /// Unique color ID for text color.
-    sal_uInt32                  mnHash;         /// Hash value for fast comparison.
-    bool                        mbHasColor;     /// false = Font does not use a color (i.e. chart).
-
 public:
     explicit                    XclExpFont( const XclExpRoot& rRoot, const Font& rFont );
+    explicit                    XclExpFont( const XclExpRoot& rRoot, const SvxFont& rFont );
     explicit                    XclExpFont( const XclExpRoot& rRoot, const XclFontData& rFontData );

     /** Returns read-only access to font data. */
@@ -295,8 +301,17 @@
     /** Calculates an internal hash value for faster comparison. */
     void                        CalcHash();

+    /** Sets the ColorId, internal hash value and the record size. */
+    void                        SetColorHashAndRecSize( const Font& rFont );
+
     /** Writes the contents of the FONT record. */
     virtual void                WriteBody( XclExpStream& rStrm );
+
+private:
+    XclFontData                 maData;         /// All font attributes.
+    sal_uInt32                  mnColorId;      /// Unique color ID for text color.
+    sal_uInt32                  mnHash;         /// Hash value for fast comparison.
+    bool                        mbHasColor;     /// false = Font does not use a color (i.e. chart).
 };

@@ -307,13 +322,6 @@
 /** Stores the data of all fonts used in the document. */
 class XclExpFontBuffer : public XclExpRecordBase, protected XclExpRoot
 {
-private:
-    typedef XclExpRecordList< XclExpFont > XclExpFontList;
-
-    XclExpFontList              maFontList;     /// List of all FONT records.
-    XclFontData                 maAppFont;      /// Application font (for column width).
-    sal_uInt32                  mnXclMaxCount;  /// Maximum number of fonts.
-
 public:
     explicit                    XclExpFontBuffer( const XclExpRoot& rRoot );

@@ -333,6 +341,10 @@
         @param bAppFont  true = Sets the application font; false = Inserts a new font.
         @return  The resulting Excel font index. */
     sal_uInt16                  Insert( const Font& rFont, bool bAppFont = false );
+    /** Inserts the SvxFont into the buffer if not present i.e. where escapements are used
+        @param bAppFont  true = Sets the application font; false = Inserts a new font.
+        @return  The resulting Excel font index. */
+    sal_uInt16                  Insert( const SvxFont& rFont, bool bAppFont = false );
     /** Inserts the font contained in the passed item set into the buffer, if not present.
         @param bAppFont  true = Sets the application font; false = Inserts a new font.
         @return  The resulting Excel font index. */
@@ -352,6 +364,13 @@
     sal_uInt16                  GetXclIndex( sal_uInt32 nIndex ) const;
     /** Tries to find the passed font and returns the current list index. */
     sal_uInt32                  Find( const XclExpFont& rFont );
+
+private:
+    typedef XclExpRecordList< XclExpFont > XclExpFontList;
+
+    XclExpFontList              maFontList;     /// List of all FONT records.
+    XclFontData                 maAppFont;      /// Application font (for column width).
+    sal_uInt32                  mnXclMaxCount;  /// Maximum number of fonts.
 };

@@ -375,17 +394,6 @@
 /** Stores all number formats used in the document. */
 class XclExpNumFmtBuffer : public XclExpRecordBase, protected XclExpRoot
 {
-private:
-    typedef ::std::auto_ptr< SvNumberFormatter >    SvNumberFormatterPtr;
-    typedef NfKeywordTable*                         NfKeywordTablePtr;
-    typedef ::std::vector< XclExpNumFmt >           XclExpNumFmtVec;
-
-    SvNumberFormatterPtr        mpFormatter;    /// Special number formatter for conversion.
-    NfKeywordTablePtr           mpKeywordTable; /// Replacement table.
-    XclExpNumFmtVec             maFormatMap;    /// Maps core formats to Excel indexes.
-    sal_uInt32                  mnStdFmt;       /// Key for standard number format.
-    sal_uInt16                  mnXclOffset;    /// Offset to first user defined format.
-
 public:
     explicit                    XclExpNumFmtBuffer( const XclExpRoot& rRoot );

@@ -409,6 +417,17 @@
     void                        WriteFormatRecord( XclExpStream& rStrm, const XclExpNumFmt& rFormat );
     /** Writes default formats occuring in each Excel file. */
     void                        WriteDefaultFormats( XclExpStream& rStrm );
+
+private:
+    typedef ::std::auto_ptr< SvNumberFormatter >    SvNumberFormatterPtr;
+    typedef NfKeywordTable*                         NfKeywordTablePtr;
+    typedef ::std::vector< XclExpNumFmt >           XclExpNumFmtVec;
+
+    SvNumberFormatterPtr        mpFormatter;    /// Special number formatter for conversion.
+    NfKeywordTablePtr           mpKeywordTable; /// Replacement table.
+    XclExpNumFmtVec             maFormatMap;    /// Maps core formats to Excel indexes.
+    sal_uInt32                  mnStdFmt;       /// Key for standard number format.
+    sal_uInt16                  mnXclOffset;    /// Offset to first user defined format.
 };

@@ -542,17 +561,6 @@
 /** Represents an XF record which contains all formatting data of a cell or cell style. */
 class XclExpXF : public XclXFBase, public XclExpRecord, protected XclExpRoot
 {
-protected:  // access for XclExpDefaultXF
-    const SfxItemSet*           mpItemSet;          /// Pointer to the item set (we do not own it).
-
-    XclExpCellProt              maProtection;       /// Cell protection flags.
-    XclExpCellAlign             maAlignment;        /// All alignment attributes.
-    XclExpCellBorder            maBorder;           /// Border line style.
-    XclExpCellArea              maArea;             /// Background area style.
-    sal_uInt32                  mnParentXFId;       /// XF ID of parent XF record.
-    sal_uInt16                  mnFont;             /// Excel font index.
-    sal_uInt16                  mnNumFmt;           /// Excel number format index.
-
 public:
     /** Constructs a cell XF record from the passed Calc cell formatting.
         @param nForcedNumFmt  If not set to NUMBERFORMAT_ENTRY_NOT_FOUND, it will overwrite
@@ -562,7 +570,8 @@
                                     const XclExpRoot& rRoot,
                                     const ScPatternAttr& rPattern,
                                     sal_uInt32 nForcedNumFmt = NUMBERFORMAT_ENTRY_NOT_FOUND,
-                                    bool bForceWrapped = false );
+                                    bool bForceWrapped = false,
+                                    sal_uInt16 nFontIx = EXC_FONT_NOTFOUND);
     /** Constructs a style XF record from the passed cell style sheet. */
     explicit                    XclExpXF(
                                     const XclExpRoot& rRoot,
@@ -573,7 +582,9 @@
     bool                        Equals(
                                     const ScPatternAttr& rPattern,
                                     sal_uInt32 nForcedNumFmt,
-                                    bool bForceWrapped ) const;
+                                    bool bForceWrapped,
+                    sal_uInt16 nFontIx ) const;
+
     /** Returns true, if this XF record represents the passed style.
         @descr  Searches for style XFs only. */
     bool                        Equals( const SfxStyleSheetBase& rStyleSheet ) const;
@@ -586,6 +597,17 @@

 protected:
     explicit                    XclExpXF( const XclExpRoot& rRoot, bool bCellXF );
+
+protected:  // access for XclExpDefaultXF
+    const SfxItemSet*           mpItemSet;          /// Pointer to the item set (we do not own it).
+
+    XclExpCellProt              maProtection;       /// Cell protection flags.
+    XclExpCellAlign             maAlignment;        /// All alignment attributes.
+    XclExpCellBorder            maBorder;           /// Border line style.
+    XclExpCellArea              maArea;             /// Background area style.
+    sal_uInt32                  mnParentXFId;       /// XF ID of parent XF record.
+    sal_uInt16                  mnFont;             /// Excel font index.
+    sal_uInt16                  mnNumFmt;           /// Excel number format index.

 private:
     /** Initializes with default values. */
@@ -596,7 +618,8 @@
                                     const SfxItemSet& rItemSet,
                                     sal_uInt32 nForcedNumFmt = NUMBERFORMAT_ENTRY_NOT_FOUND,
                                     bool bForceWrapped = false,
-                                    bool bDefStyle = false );
+                                    sal_uInt16 nFontIx = EXC_FONT_NOTFOUND,
+                                    bool bDefStyle = false);

     /** Returns the bits specifying the used attributes.
         @descr  In cell XFs a set bit means a used attribute, in style XF a cleared
@@ -649,24 +672,24 @@
     @descr  The calss is able to store built-in and user-defined styles. */
 class XclExpStyle : public XclExpRecord
 {
+public:
+    explicit                    XclExpStyle( sal_uInt32 nXFId, const String& rStyleName );
+    explicit                    XclExpStyle( sal_uInt32 nXFId, sal_uInt8 nStyleId, sal_uInt8 nLevel = EXC_STYLE_NOLEVEL );
+
+    /** Returns the index of the XF record used by this style. */
+    inline sal_uInt32           GetXFId() const { return mnXFId; }
+    /** Returns true, if this record represents an Excel built-in style. */
+    inline bool                 IsBuiltIn() const { return mnStyleId != EXC_STYLE_USERDEF; }
+
+private:
+    /** Writes the contents of the STYLE record. */
+    virtual void                WriteBody( XclExpStream& rStrm );
+
 private:
     String                      maName;         /// Name of the cell style.
     sal_uInt32                  mnXFId;         /// XF record ID with style formatting.
     sal_uInt8                   mnStyleId;      /// Built-in style identifier.
     sal_uInt8                   mnLevel;        /// Outline level for RowLevel and ColLevel styles.
-
-public:
-    explicit                    XclExpStyle( sal_uInt32 nXFId, const String& rStyleName );
-    explicit                    XclExpStyle( sal_uInt32 nXFId, sal_uInt8 nStyleId, sal_uInt8 nLevel = EXC_STYLE_NOLEVEL );
-
-    /** Returns the index of the XF record used by this style. */
-    inline sal_uInt32           GetXFId() const { return mnXFId; }
-    /** Returns true, if this record represents an Excel built-in style. */
-    inline bool                 IsBuiltIn() const { return mnStyleId != EXC_STYLE_USERDEF; }
-
-private:
-    /** Writes the contents of the STYLE record. */
-    virtual void                WriteBody( XclExpStream& rStrm );
 };

@@ -683,19 +706,6 @@
     for all XF identifiers. */
 class XclExpXFBuffer : public XclExpRecordBase, protected XclExpRoot
 {
-private:
-    typedef ScfDelList< XclExpXF >          XclExpXFList;
-    typedef XclExpRecordList< XclExpStyle > XclExpStyleList;
-    typedef ::std::vector< bool >           BoolVec;
-    typedef ::std::vector< sal_uInt16 >     XclExpXFIndexVec;
-    typedef ::std::vector< XclExpXF* >      XclExpXFPtrVec;
-
-    XclExpXFList                maXFList;       /// List of all XF records.
-    XclExpStyleList             maStyleList;    /// List of all STYLE records.
-    BoolVec                     maPredefined;   /// true = Corresponding XF still predefined.
-    XclExpXFIndexVec            maXFIndexVec;   /// Maps XF IDs to XF indexes.
-    XclExpXFPtrVec              maXFPtrVec;     /// Pointer to XF records in resulting export order.
-
 public:
     explicit                    XclExpXFBuffer( const XclExpRoot& rRoot );

@@ -706,7 +716,7 @@
         @param bForceWrapped  true = cell contains hard newlines.
         In this case the text wrap flag must be set in the XF record.
         @return  A unique XF record ID. */
-    sal_uInt32                  Insert( const ScPatternAttr* pPattern, bool bForceWrapped = false );
+    sal_uInt32                  Insert( const ScPatternAttr* pPattern, bool bForceWrapped = false, sal_uInt16 nFontIx = EXC_FONT_NOTFOUND );
     /** Finds or creates a cell XF record for the passed item set, with custom number format.
         @param nForcedNumFmt  The number format to be exported, i.e. formula result type.
         This format will always overwrite the cell's number format.
@@ -731,7 +741,7 @@
     /** Returns the XF ID of the cell XF containing the passed format. */
     sal_uInt32                  FindXF(
                                     const ScPatternAttr& rPattern,
-                                    sal_uInt32 nForcedNumFmt, bool bForceWrapped ) const;
+                                    sal_uInt32 nForcedNumFmt, bool bForceWrapped, sal_uInt16 nFontIx ) const;
     /** Returns the XF ID of the style XF containing the passed style. */
     sal_uInt32                  FindXF( const SfxStyleSheetBase& rStyleSheet ) const;

@@ -742,7 +752,7 @@
         @return  The XF record ID. */
     sal_uInt32                  InsertCellXF(
                                     const ScPatternAttr* pPattern,
-                                    sal_uInt32 nForcedNumFmt, bool bForceWrapped );
+                                    sal_uInt32 nForcedNumFmt, bool bForceWrapped, sal_uInt16 nFontIx );
     /** Inserts the passed cell style. Creates a style XF record and a STYLE record.
         @return  The XF record ID. */
     sal_uInt32                  InsertStyleXF( const SfxStyleSheetBase& rStyleSheet );
@@ -757,6 +767,19 @@

     /** Appends a XF index to the internal ID<->index maps. */
     void                        AppendXFIndex( sal_uInt32 nXFId );
+
+private:
+    typedef ScfDelList< XclExpXF >          XclExpXFList;
+    typedef XclExpRecordList< XclExpStyle > XclExpStyleList;
+    typedef ::std::vector< bool >           BoolVec;
+    typedef ::std::vector< sal_uInt16 >     XclExpXFIndexVec;
+    typedef ::std::vector< XclExpXF* >      XclExpXFPtrVec;
+
+    XclExpXFList                maXFList;       /// List of all XF records.
+    XclExpStyleList             maStyleList;    /// List of all STYLE records.
+    BoolVec                     maPredefined;   /// true = Corresponding XF still predefined.
+    XclExpXFIndexVec            maXFIndexVec;   /// Maps XF IDs to XF indexes.
+    XclExpXFPtrVec              maXFPtrVec;     /// Pointer to XF records in resulting export order.
 };


INTEGRATION: CWS residcleanup (1.10.168); FILE MERGED 2007/03/20 17:23:13 pl 1.10.168.2: RESYNC: (1.10-1.11); FILE MERGED 2007/02/28 22:46:33 pl 1.10.168.1: #i74635# no more ResMgr fallback

--- sc/source/ui/drawfunc/drawsh.cxx
+++ sc/source/ui/drawfunc/drawsh.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: drawsh.cxx,v $
  *
- *  $Revision: 1.11 $
- *
- *  last change: $Author: vg $ $Date: 2007-02-27 13:10:20 $
+ *  $Revision: 1.12 $
+ *
+ *  last change: $Author: rt $ $Date: 2007-04-26 09:52:04 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -453,7 +453,7 @@
                                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
                                 if ( pFact )
                                 {
-                                    SfxAbstractTabDialog *pDlg = pFact->CreateCaptionDialog( pWin, pView, ResId( RID_SVXDLG_CAPTION ) );
+                                    SfxAbstractTabDialog *pDlg = pFact->CreateCaptionDialog( pWin, pView, RID_SVXDLG_CAPTION );

                                     const USHORT* pRange = pDlg->GetInputRanges( *aNewAttr.GetPool() );
                                     SfxItemSet aCombSet( *aNewAttr.GetPool(), pRange );
@@ -479,7 +479,7 @@
                                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
                                 if(pFact)
                                 {
-                                    SfxAbstractTabDialog* pDlg = pFact->CreateSvxTransformTabDialog( pWin, &aNewAttr,pView, ResId(RID_SVXDLG_TRANSFORM) );
+                                    SfxAbstractTabDialog* pDlg = pFact->CreateSvxTransformTabDialog( pWin, &aNewAttr,pView, RID_SVXDLG_TRANSFORM );
                                     DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
                                     if (pDlg->Execute() == RET_OK)
                                     {
@@ -529,7 +529,7 @@
         SfxAbstractTabDialog * pDlg = pFact->CreateSvxLineTabDialog( pViewData->GetDialogParent(),
                     &aNewAttr,
                 pViewData->GetDocument()->GetDrawLayer(),
-                ResId(RID_SVXDLG_LINE),
+                RID_SVXDLG_LINE,
                 pObj,
                 bHasMarked);
         DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001
@@ -571,7 +571,7 @@
     AbstractSvxAreaTabDialog * pDlg = pFact->CreateSvxAreaTabDialog( pViewData->GetDialogParent(),
                                                                     &aNewAttr,
                                                             pViewData->GetDocument()->GetDrawLayer(),
-                                                            ResId(RID_SVXDLG_AREA),
+                                                            RID_SVXDLG_AREA,
                                                             pView);
     DBG_ASSERT(pDlg, "Dialogdiet fail!");//CHINA001

@@ -604,7 +604,7 @@
         pView->MergeAttrFromMarked( aNewAttr, FALSE );

     SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-    SfxAbstractTabDialog *pDlg = pFact->CreateTextTabDialog( pViewData->GetDialogParent(), &aNewAttr, ResId( RID_SVXDLG_TEXT ), pView );
+    SfxAbstractTabDialog *pDlg = pFact->CreateTextTabDialog( pViewData->GetDialogParent(), &aNewAttr, RID_SVXDLG_TEXT, pView );

     USHORT nResult = pDlg->Execute();


INTEGRATION: CWS fwkp2fix02 (1.5.72); FILE MERGED 2004/11/03 16:16:02 mba 1.5.72.2: #29059#: code for detection of text filter was broken 2004/11/03 08:45:29 mba 1.5.72.1: #i33168#: type detection must consider template flag

--- sc/source/ui/unoobj/scdetect.cxx
+++ sc/source/ui/unoobj/scdetect.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: scdetect.cxx,v $
  *
- *  $Revision: 1.5 $
- *
- *  last change: $Author: kz $ $Date: 2004-10-04 20:21:15 $
+ *  $Revision: 1.6 $
+ *
+ *  last change: $Author: obo $ $Date: 2004-11-17 15:29:48 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -420,7 +420,7 @@
                         String aFilterName;
                         if ( pFilter )
                             aFilterName = pFilter->GetName();
-                        aTypeName = SfxFilter::GetTypeFromStorage( xStorage, &aFilterName );
+                        aTypeName = SfxFilter::GetTypeFromStorage( xStorage, pFilter ? pFilter->IsAllowedAsTemplate() : FALSE, &aFilterName );
                     }
                     catch( lang::WrappedTargetException& aWrap )
                     {
@@ -748,13 +748,10 @@
                         // file extension) it takes precedence over HTML and RTF and dBase
                         // detection. Otherwise something like, for example, "lala <SUP> gugu"
                         // would trigger HTML to be recognized.
-
-                        if ( aPreselectedFilterName.EqualsAscii(pFilterAscii) && lcl_MayBeAscii( rStr ) )
+                        if ( !pFilter->GetFilterName().EqualsAscii(pFilterAscii) || !lcl_MayBeAscii( rStr ) )
                         {
-                            pFilter = SfxFilter::GetFilterByName( aPreselectedFilterName );
-                        }
-                        else
-                        {
+                            pFilter = 0;
+
                             // get file header
                             rStr.Seek( 0 );
                             const int nTrySize = 80;


don't move sockets high by default

don't move sockets high by default

--- lib/Socket.cpp
+++ lib/Socket.cpp
@@ -395,8 +395,7 @@

     sock.close();
     do {
-	if (check((sock.sbuf->sock = ::accept(sbuf->sock, sa.data(), &sz)) ==
-	    SOCK_INVALID ? -1 : 0) && (movehigh() || true)) {
+	if (check(sock.sbuf->sock = ::accept(sbuf->sock, sa.data(), &sz))) {
 	    sock.sbuf->type = sbuf->type;
 	    return true;
 	}
@@ -466,7 +465,7 @@
 #endif
 	    ) {
 	    return false;
-	} else {
+	} else if (fd != sbuf->sock) {
 	    ::closesocket(sbuf->sock);
 	    sbuf->sock = fd;
 	}
@@ -477,8 +476,7 @@

 bool Socket::open(int family) {
     close();
-    return check((sbuf->sock = ::socket(family, sbuf->type, 0)) ==
-	SOCK_INVALID ? -1 : 0) && (movehigh() || true);
+    return check(sbuf->sock = ::socket(family, sbuf->type, 0));
 }

 bool Socket::shutdown(bool in, bool out) {


Studio: std::move studio instance in addStudioSend()

Avoids an unnecessary atomic reference count increment and decrement

--- lib/Studio.cpp
+++ lib/Studio.cpp
@@ -20,7 +20,7 @@
 }

 void Studio::addStudioSend(ObjToken<Studio> studio, float dry, float auxA, float auxB) {
-  m_studiosOut.emplace_back(studio, dry, auxA, auxB);
+  m_studiosOut.emplace_back(std::move(studio), dry, auxA, auxB);

   /* Cyclic check */
   assert(!_cyclicCheck(this));


Avoid unused-parameter warning

Avoid unused-parameter warning

--- xchainer/memory.cc
+++ xchainer/memory.cc
@@ -109,6 +109,7 @@
         throw DeviceError("invalid device");
     }
 #else
+    (void)bytesize;  // unused
     if (device == MakeDevice("cpu")) {
         return src_ptr;
     } else {


Fix small bug.

Fix small bug.

git-svn-id: 28d9401aa571d5108e51b194aae6f24ca5964c06@634 8cc4aa7f-3514-0410-904f-f2cc9021211c

--- apps/walktest/walktest.cpp
+++ apps/walktest/walktest.cpp
@@ -767,7 +767,7 @@
   if (Sys->auto_script)
     Command::start_script (Sys->auto_script);

-  TestFrustrum ();
+  //TestFrustrum ();
   // The main loop.
   Sys->Loop ();


tried C.cpp to 'C'

tried C.cpp to 'C'

--- 2020/0628_intro-heuristics/C.cpp
+++ 2020/0628_intro-heuristics/C.cpp
@@ -277,7 +277,7 @@
 private:
   ll change_score(int d, int q)
   {
-    int p{t[d]};
+    int p{t[d - 1]};
     if (p == q)
     {
       return totalScore;


Implementado método de fitness.

Implementado método de fitness.

--- C++/src/SimulationFitnessCalculator.cpp
+++ C++/src/SimulationFitnessCalculator.cpp
@@ -8,8 +8,14 @@
 #include "SimulationFitnessCalculator.h"

 void SimulationFitnessCalculator::fitness(std::vector<Cromossomo>& populacao) {
-	std::vector<std::vector<std::bitset<8>>> result;
-
+	for (auto& individuo : populacao) {
+		std::vector<std::vector<std::bitset<8>>> result;
+		for (unsigned int i = 0; i < (unsigned int) pow(2, genetic_params.num_in); i++) {
+			result.push_back(std::vector<std::bitset<8>>());
+			result[i].push_back(calcular_entrada(individuo, std::bitset<8>(i)));
+		}
+		individuo.set_fitness(fitness_calculator(result));
+	}
 }

 std::bitset<8> SimulationFitnessCalculator::calcular_entrada(


replace INT64_MAX with kc::INT64MAX

replace INT64_MAX with kc::INT64MAX

Change-Id: I00e6f15f508c6237c7cd699dd62adba5fb50b047

--- C/impl/sonLibKVDatabase_KyotoTycoon.cpp
+++ C/impl/sonLibKVDatabase_KyotoTycoon.cpp
@@ -71,7 +71,7 @@
 }

 static stKVDatabase* constructBigRecordDB(stKVDatabaseConf *conf, bool create) {
-	if (stKVDatabaseConf_getMaxKTRecordSize(conf) != INT64_MAX) {
+	if (stKVDatabaseConf_getMaxKTRecordSize(conf) != kc::INT64MAX) {
 		// warning: bypassing stKVDatabase_construct()
 		stKVDatabase *database = (stKVDatabase *)st_calloc(1, sizeof(struct stKVDatabase));
 		database->conf = stKVDatabaseConf_constructClone(conf);


Now handles failure when creating temp recording folder.

--- Malmo/src/MissionRecord.cpp
+++ Malmo/src/MissionRecord.cpp
@@ -51,11 +51,20 @@
             this->rewards_path = (this->temp_dir / "rewards.txt").string();
             this->commands_path = (this->temp_dir / "commands.txt").string();
             this->mission_init_path = (this->temp_dir / "missionInit.xml").string();
-            if (boost::filesystem::create_directories(this->temp_dir)) {
+            bool created_tmp = false;
+            try {
+                created_tmp = boost::filesystem::create_directories(this->temp_dir);
+            }
+            catch (const std::exception& e) {
+                std::cout << "Unable to create temporary folder for recording " << this->temp_dir.string() << ": " << e.what() << std::endl;
+                throw std::runtime_error("Check your MALMO_TEMP_PATH and try again.");
+            }
+
+            if (created_tmp) {
                 this->is_closed = false;
             }
             else {
-                throw std::runtime_error("Could not create temporary folder for recording - trying to write to " + this->temp_dir.string() + " - do you need to change your MALMO_TEMP_PATH environment variable?");
+                throw std::runtime_error("Unable to create temporary folder for recording " + this->temp_dir.string() + ": check your MALMO_TEMP_PATH?");
             }
         }
     }


mesh blend

mesh blend

--- scene/mesh.cpp
+++ scene/mesh.cpp
@@ -173,7 +173,7 @@
                 sh.load(value.c_str());
                 m.set_shader(sh);
             }
-            else if(name=="nya_blend")
+            else if(name=="nya_blend" && value == "src_alpha:inv_src_alpha")
                 m.set_blend(true,nya_render::blend::src_alpha,nya_render::blend::inv_src_alpha); //ToDo
         }


implement edge methods for bmi

implement edge methods for bmi

--- Child/Code/ChildInterface/bmi_child.cpp
+++ Child/Code/ChildInterface/bmi_child.cpp
@@ -343,15 +343,13 @@

 int Model::GetGridEdgeCount(const int grid_id) {
-  return 0;
-  // return this->model.mesh->getEdgeList()->getSize();
+  return this->model.mesh->getEdgeList()->getSize();
 }

 int Model::GetGridFaceCount(const int grid_id) {
   if (grid_id == 0) {
-    return 0;
-    // return this->model.mesh->getTriList()->getSize();
+    return this->model.mesh->getTriList()->getSize();
   } else {
     throw bmi::BMI_FAILURE;
   }
@@ -387,8 +385,23 @@
 }

-void Model::GetGridEdgeNodes(const int grid, int *edge_nodes) {
-  throw NotImplemented();
+void Model::GetGridEdgeNodes(const int grid_id, int *edge_nodes) {
+  if (grid_id == 0) {
+    int i = 0;
+    tMesh<tLNode>::edgeListIter_t edgeIter(this->model.mesh->getEdgeList());
+    tEdge *current_edge;
+
+    for (
+        current_edge=edgeIter.FirstP();
+        !edgeIter.AtEnd();
+        i += 2, current_edge=edgeIter.NextP()
+    ) {
+      edge_nodes[i] = current_edge->getOriginPtr()->getPermID();
+      edge_nodes[i + 1] = current_edge->getDestinationPtr()->getPermID();
+    }
+  } else {
+    throw bmi::BMI_FAILURE;
+  }
 }


cleaner handling of case nap==3

cleaner handling of case nap==3

--- Child/Code/tMesh/TipperTriangulator.cpp
+++ Child/Code/tMesh/TipperTriangulator.cpp
@@ -400,15 +400,10 @@
   edges[nap].lef=nap+1;
   edges[nap].let=0;
   // interior edges
-  if (nap==3){
-    edges[nap+1].lef=0;
-    edges[nap+1].let=nap;
-    edges[nap+1].ref=1;
-    edges[nap+1].ret=nap-1;
-  } else {
-    edges[nap+1].lef=0;
-    edges[nap+1].let=nap;
-    edges[nap+1].ref=1;
+  edges[nap+1].lef=0;
+  edges[nap+1].let=nap;
+  edges[nap+1].ref=1;
+  if (nap!=3){ // more than one interior edge
     edges[nap+1].ret=nap+2;
     int iedge2 = 1;
     for(int iedge=nap+2;iedge<2*nap-2;++iedge){
@@ -421,8 +416,8 @@
     edges[2*nap-2].lef=iedge2;
     edges[2*nap-2].let=2*nap-3;
     edges[2*nap-2].ref=iedge2+1;
-    edges[2*nap-2].ret=nap-1;
-  }
+  }
+  edges[2*nap-2].ret=nap-1;
   //
   next_edge = 2*nap-1; // number of existing edges: 2*nap-1
   next_point = nap+1;


BUG: Need an array of 4

BUG: Need an array of 4

--- Common/Testing/Cxx/otherLookupTable.cxx
+++ Common/Testing/Cxx/otherLookupTable.cxx
@@ -31,7 +31,7 @@
   lut1->SetRampToLinear();
   lut1->Build();

-  double rgb[3];
+  double rgb[4];
   lut1->GetColor(0, rgb);

   lut1->GetOpacity(0);


Deleted irrelevant comment.

Deleted irrelevant comment.

--- Contrib/QWidgetLogger/QWidgetLogger.cpp
+++ Contrib/QWidgetLogger/QWidgetLogger.cpp
@@ -24,7 +24,6 @@
 }
 QWidgetLogger::~QWidgetLogger()
 {
-	//mLogTextEdit is automatically deleted by Qt.
 	AbstractLoggingDevice::_FlushBufferedMessages();
 }
 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //


Typo in previous commit

Typo in previous commit

--- xs/src/libslic3r/PrintConfig.hpp
+++ xs/src/libslic3r/PrintConfig.hpp
@@ -274,7 +274,7 @@
         this->solid_infill_extrusion_width.value                 = 0;
         this->solid_infill_extrusion_width.percent               = false;
         this->solid_infill_every_layers.value                    = 0;
-        this->solid_infill_speed.value                           = 0;
+        this->solid_infill_speed.value                           = 20;
         this->solid_infill_speed.percent                         = false;
         this->thin_walls.value                                   = true;
         this->top_infill_extrusion_width.value                   = 0;


Another fix in gizmos update

Another fix in gizmos update

--- xs/src/slic3r/GUI/GLCanvas3D.cpp
+++ xs/src/slic3r/GUI/GLCanvas3D.cpp
@@ -2128,7 +2128,7 @@

 void GLCanvas3D::update_gizmos_data()
 {
-    if (!m_gizmos.is_running())
+    if (!m_gizmos.is_enabled())
         return;

     int id = _get_first_selected_object_id();
@@ -3323,6 +3323,7 @@
             {
                 deselect_volumes();
                 _on_select(-1);
+                update_gizmos_data();
             }
         }
         else if (evt.LeftUp() && m_gizmos.is_dragging())


Updated headers so it would compile on cygwin

--- DigitalHaze-Libraries/cpp/DH_Base64.cpp
+++ DigitalHaze-Libraries/cpp/DH_Base64.cpp
@@ -86,18 +86,15 @@

 	DigitalHaze::BitParser destBBuf(dest, 0);

-	size_t discardEqualsCount = 0;
 	for (size_t i = 0; i < srclen; ++i) {
 		unsigned char curLetter = *((unsigned char*) src + i);
-		unsigned char curValue = Base64CharToInt(curLetter);
+		//if (curLetter != '=') {
+			unsigned char curValue = Base64CharToInt(curLetter);

-		curValue = reverse8(curValue) >> 2;
+			curValue = reverse8(curValue) >> 2;

-		destBBuf.WriteBits(curValue, 6);
-
-		// Equals are not counted, they are only for padding
-		if (curLetter == (unsigned char) '=') discardEqualsCount++;
-		else discardEqualsCount = 0;
+			destBBuf.WriteBits(curValue, 6);
+		//}
 	}

 	size_t len = (unsigned char*) destBBuf.getDataPtr() - (unsigned char*) dest;
@@ -106,7 +103,7 @@
 	for (size_t i = 0; i < len; ++i)
 		*((unsigned char*) dest + i) = reverse8(*((unsigned char*) dest + i));

-	return len;// - discardEqualsCount;
+	return len;
 }

 char DigitalHaze::IntToBase64Char(int num) {


Changes: Add a hint not to style the plain QGraphicsView

RevBy: Bernd Lamecker

--- home/notifications/duicompositornotificationsink.cpp
+++ home/notifications/duicompositornotificationsink.cpp
@@ -67,6 +67,7 @@
         // Create a new toplevel window for the info banner
         QGraphicsScene *scene = new QGraphicsScene;
         QGraphicsView *view = new QGraphicsView(scene);
+        view->setProperty("NoDuiStyle", true);
         view->setFrameStyle(0);
         view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
         view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);


edits on the latex table header

edits on the latex table header

--- implementations/MaxMSP/jcom.hub/jcom.hub.autodoc.cpp
+++ implementations/MaxMSP/jcom.hub/jcom.hub.autodoc.cpp
@@ -658,7 +658,7 @@
 	jcom_core_file_writeline(file_handle, myEof, "\\begin{longtable}{llp{1.5cm}llllll p{7cm}} \\hline \\hline ");
 	jcom_core_file_writeline(file_handle, myEof, "\\rowcolor{white}  \\textbf{/name} & \\textbf{/type} & \\textbf{/range}  & \\textbf{/range} & \\textbf{/ramp} & \\textbf{/ramp} & \\textbf{/dataspace} & \\textbf{/dataspace} & \\textbf{/repetitions} & \\textbf{/description}\\\\");
     jcom_core_file_writeline(file_handle, myEof, "       &       &  \\textbf{/bounds} & \\textbf{/clipmode} & \\textbf{/drive} & \\textbf{/function} &  & \\textbf{/unit/native} & \\textbf{/allow} & \\\\");
-	jcom_core_file_writeline(file_handle, myEof, "\\hline\\hline ");
+	jcom_core_file_writeline(file_handle, myEof, "\\hline\\hline \\endhead");
 }

 // CSS definitions -- we include them in the html file itself so that we don't have problems with paths to external references


Model defines StateArray and ValueArray for vectorized evaluations

--- include/fl/model/observation/observation_density.hpp
+++ include/fl/model/observation/observation_density.hpp
@@ -23,6 +23,7 @@
 #ifndef FL__MODEL__OBSERVATION__OBSERVATION_DENSITY_HPP
 #define FL__MODEL__OBSERVATION__OBSERVATION_DENSITY_HPP

+#include <fl/util/types.hpp>
 #include <fl/util/traits.hpp>

 namespace fl
@@ -30,45 +31,20 @@

 template <
     typename Obsrv,
-    typename State
+    typename State,
+    int BatchSize = Eigen::Dynamic
 >
 class ObservationDensity
 {
 public:
-    /**
-     *
-     */
+    typedef Eigen::Array<State, BatchSize, 1 > StateArray;
+    typedef Eigen::Array<FloatingPoint, BatchSize, 1 > ValueArray;

+public:
     /// \todo should add the unnormalized log probability interface
+
     virtual FloatingPoint log_probability(const Obsrv& obsrv,
                                           const State& state) const = 0;
-
-    virtual FloatingPoint probability(const Obsrv& obsrv,
-                                      const State& state) const
-    {
-        return std::exp(log_probability(obsrv, state));
-    }
-
-    virtual Eigen::Array<FloatingPoint, Eigen::Dynamic, 1> log_probabilities(
-        const Obsrv& obsrv,
-        const Eigen::Array<State, Eigen::Dynamic, 1>& states)
-    {
-        Eigen::Array<FloatingPoint, Eigen::Dynamic, 1> probs (states.size());
-
-        for (int i = 0; i < states.size(); ++i)
-        {
-            probs[i] = log_probability(obsrv, states[i]);
-        }
-
-        return probs;
-    }
-
-    virtual Eigen::Array<FloatingPoint, Eigen::Dynamic, 1> probabilities(
-        const Obsrv& obsrv,
-        const Eigen::Array<State, Eigen::Dynamic, 1>& states)
-    {
-        return log_probabilities(obsrv, states).exp();
-    }

     /**
      * \return Dimension of the state variable $\f$x\f$
@@ -79,6 +55,32 @@
      * \return Dimension of the measurement \f$h(x, w)\f$
      */
     virtual int obsrv_dimension() const = 0;
+
+
+    virtual FloatingPoint probability(const Obsrv& obsrv,
+                                      const State& state) const
+    {
+        return std::exp(log_probability(obsrv, state));
+    }
+
+    virtual ValueArray log_probabilities(const Obsrv& obsrv,
+                                         const StateArray& states)
+    {
+        auto probs = ValueArray(states.size());
+
+        for (int i = 0; i < states.size(); ++i)
+        {
+            probs[i] = log_probability(obsrv, states[i]);
+        }
+
+        return probs;
+    }
+
+    virtual ValueArray probabilities(const Obsrv& obsrv,
+                                     const StateArray& states)
+    {
+        return log_probabilities(obsrv, states).exp();
+    }
 };

 }


Remove debug output

Remove debug output

--- include/visionaray/texture/detail/cuda_texture1d.inl
+++ include/visionaray/texture/detail/cuda_texture1d.inl
@@ -59,7 +59,7 @@

         cudaTextureObject_t obj = 0;
         cudaCreateTextureObject( &obj, &resource_desc, &texture_desc, 0 );
-        texture_obj_.reset(obj);std::cerr << cudaGetErrorString(cudaGetLastError()) << std::endl;
+        texture_obj_.reset(obj);
     }

 #if !VSNRAY_CXX_MSVC