timefetch: finish adding socket code, work on getting the server's response

--- timefetch/main.cpp
+++ timefetch/main.cpp
@@ -1,30 +1,122 @@
 #include <arpa/inet.h>
+
 #include <sys/socket.h>
 #include <sys/types.h>
+
+#include <netdb.h>
+#include <unistd.h>

 #include <cstring>
 #include <iostream>

-extern "C" struct sockaddr_in;
+extern "C" {
+	struct sockaddr_in;
+	struct addrinfo;
+
+	typedef struct {
+
+		unsigned li   : 2;       // Only two bits. Leap indicator.
+		unsigned vn   : 3;       // Only three bits. Version number of the protocol.
+		unsigned mode : 3;       // Only three bits. Mode. Client will pick mode 3 for client.
+
+		uint8_t stratum;         // Eight bits. Stratum level of the local clock.
+		uint8_t poll;            // Eight bits. Maximum interval between successive messages.
+		uint8_t precision;       // Eight bits. Precision of the local clock.
+
+		uint32_t rootDelay;      // 32 bits. Total round trip delay time.
+		uint32_t rootDispersion; // 32 bits. Max error aloud from primary clock source.
+		uint32_t refId;          // 32 bits. Reference clock identifier.
+
+		uint32_t refTm_s;        // 32 bits. Reference time-stamp seconds.
+		uint32_t refTm_f;        // 32 bits. Reference time-stamp fraction of a second.
+
+		uint32_t origTm_s;       // 32 bits. Originate time-stamp seconds.
+		uint32_t origTm_f;       // 32 bits. Originate time-stamp fraction of a second.
+
+		uint32_t rxTm_s;         // 32 bits. Received time-stamp seconds.
+		uint32_t rxTm_f;         // 32 bits. Received time-stamp fraction of a second.
+
+		uint32_t txTm_s;         // 32 bits and the most important field the client cares about. Transmit time-stamp seconds.
+		uint32_t txTm_f;         // 32 bits. Transmit time-stamp fraction of a second.
+
+	} ntp_packet;              // Total: 384 bits or 48 bytes.
+};

 using namespace std;

 int main(int argc, char *argv[])
 {
-	int sockfd;
-	struct sockaddr_in my_addr;
+	int sockfd, retval = 0;
+	ssize_t sendto_retval, recv_retval;

-	sockfd = socket(AF_INET, SOCK_STREAM, 0);
-	if (errno) {
-		cerr << "Failed to call socket()" << endl;
+	string address;
+
+	ntp_packet packet = {};
+	packet.vn = 3;
+	packet.mode = 3;
+
+	struct addrinfo *result, *resp_node;
+
+	struct addrinfo hints = {};
+	hints.ai_family = AF_UNSPEC; // IPv4 and v6 are allowed
+	hints.ai_socktype = SOCK_DGRAM;
+
+	if (argc != 2) {
+		address = "pool.ntp.org";
+		cerr << "Wrong number of arguments, using the default server "
+		     << '"' << address << '"' << endl;
+	} else {
+		address = argv[1];
+	}
+
+	if (int e = getaddrinfo(address.c_str(), "123", &hints, &result)) {
+		cerr << "getaddrinfo() failed with" << e << endl;
 		exit(1);
 	}

-	my_addr.sin_family = AF_INET; // AF_INET means we want to send stuff via IP
-	my_addr.sin_port = 0; // Choose the port automatically
-	my_addr.sin_addr.s_addr = INADDR_ANY; // Choose this machine's IP address
-	memset(&(my_addr.sin_zero), 0x00, 8);
+	for (resp_node = result; resp_node != nullptr; resp_node = resp_node->ai_next) {
+		sockfd = socket(resp_node->ai_family, resp_node->ai_socktype, resp_node->ai_protocol);

-	bind(sockfd, (struct sockaddr *)&my_addr, sizeof(struct sockaddr));
-	return 0;
+		if (sockfd == -1)
+			continue;
+
+		if (connect(sockfd, resp_node->ai_addr, resp_node->ai_addrlen) == 0)
+			break;
+
+		close(sockfd);
+	}
+
+	if (resp_node == nullptr) {
+		cerr << "Could not connect() to any of the results" << endl;
+		exit(1);
+	}
+
+	struct sockaddr_in *addr = (sockaddr_in *)resp_node->ai_addr;
+	cout << "Connected to " << inet_ntoa(addr->sin_addr) << endl;
+
+	sendto_retval = send(sockfd, &packet, sizeof(packet), 0);
+	if (sendto_retval != -1) {
+		cout << "Successfuly sent " << sendto_retval << " bytes"
+		     << endl;
+	} else {
+		cerr << "Failed to send the NTP packet" << endl;
+		cerr << "Errno: " << gai_strerror(errno) << endl;
+		retval = 1;
+		goto fini;
+	}
+
+	recv_retval = recv(sockfd, &packet, sizeof(packet), 0);
+	if (recv_retval != -1) {
+		cout << "Successfuly received " << recv_retval << " bytes"
+		     << endl;
+	} else {
+		cerr << "Failed to receive the NTP packet" << endl;
+		retval = 1;
+		goto fini;
+	}
+
+fini:
+	close(sockfd);
+
+	return retval;
 }


Liport.Asio: Fix test.

Liport.Asio: Fix test.

	* tests/libport/asio.cc: Everyone in IPv4.
	Remove debugging code.

--- tests/libport/asio.cc
+++ tests/libport/asio.cc
@@ -17,12 +17,13 @@

 // On OSX:
 //   listen            connect        status
-// "127.0.0.1"       "127.0.0.1"       PASS
-// "localhost"       "localhost"       PASS
-// ""                "localhost"       PASS
+// "127.0.0.1"       "127.0.0.1"       PASS  IPv4
+// "localhost"       "localhost"       PASS  IPv6
+// ""                "localhost"       PASS  IPv6
 // ""                "127.0.0.1"       FAIL
-static const char* listen_host = "";
-static const char* connect_host = "localhost";
+// ""                ""                PASS  IPv6
+static const char* listen_host = "127.0.0.1";
+static const char* connect_host = "127.0.0.1";

 template<class T>
 void
@@ -185,10 +186,8 @@
   RESOLVE();
   RESOLVE();
   RESOLVE();
-  std::cerr << "BEFORE TEST_ONE" << std::endl;
   test_one(false);
   BOOST_CHECK_EQUAL(h->getLocalPort(), AVAIL_PORT);
-  std::cerr << "AFTER TEST_ONE" << std::endl;
   RESOLVE();
   test_one(false);
   BOOST_CHECK_EQUAL(h->getLocalPort(), AVAIL_PORT);


FIX: mem dealloc bug + circular dep

FIX: mem dealloc bug + circular dep

--- Rendering/vtkTkImageViewerWidget.cxx
+++ Rendering/vtkTkImageViewerWidget.cxx
@@ -274,14 +274,12 @@
     {
     int netRefCount = 0;
     netRefCount =  self->ImageViewer->GetReferenceCount();
-    /*
     if (self->ImageViewer->GetRenderWindow()->GetInteractor() &&
         self->ImageViewer->GetRenderWindow()->GetInteractor()->GetRenderWindow() == self->ImageViewer->GetRenderWindow() &&
         self->ImageViewer->GetRenderWindow()->GetInteractor()->GetReferenceCount() == 1)
       {
       netRefCount = netRefCount - 1;
       }
-    */
     if (netRefCount > 1)
       {
       vtkGenericWarningMacro("A TkImageViewerWidget is being destroyed before it associated vtkImageViewer is destroyed. This is very bad and usually due to the order in which objects are being destroyed. Always destroy the vtkImageViewer before destroying the user interface components.");
@@ -291,7 +289,7 @@
     self->ImageViewer->SetWindowId ( (void*)NULL );
     self->ImageViewer->UnRegister(NULL);
     self->ImageViewer = NULL;
-    free (self->IV);
+    ckfree (self->IV);
   }
   ckfree((char *) memPtr);
 }


[clang-tidy] Remove target specification hicpp-signed-bitwise

This patch removes the targetspecification of a testcase, that broke
for ARM. The underlying problem was fixed which makes it unnecessary to
specify the target architecture (problem was the signedness of `char`).

Committing without review was accepted in https://reviews.llvm.org/D38399
by aaron.ballman.

git-svn-id: a34e9779ed74578ad5922b3306b3d80a0c825546@314811 91177308-0d34-0410-b5e6-96231b3b80d8

--- test/clang-tidy/hicpp-signed-bitwise.cpp
+++ test/clang-tidy/hicpp-signed-bitwise.cpp
@@ -1,4 +1,4 @@
-// RUN: %check_clang_tidy %s hicpp-signed-bitwise %t -- -- -std=c++11 -target x86_64-unknown-unknown
+// RUN: %check_clang_tidy %s hicpp-signed-bitwise %t -- -- -std=c++11

 // These could cause false positives and should not be considered.
 struct StreamClass {


API: Workaround for bloom filter memory calculation

The bloom filter memory calculation is missing, as a workaround until
it will be completed, the memory calculation will return 0.

It is needed by the nodetool info command.

Signed-off-by: Amnon Heiman <ed5fc74c4692051ad0b19749fd7cea6ec2d74b9e@cloudius-systems.com>

--- api/column_family.cc
+++ api/column_family.cc
@@ -475,7 +475,10 @@

     cf::get_bloom_filter_off_heap_memory_used.set(r, [] (std::unique_ptr<request> req) {
         //TBD
-        unimplemented();
+        // FIXME
+        // We are missing the off heap memory calculation
+        // Return 0 is the wrong value. It's a work around
+        // until the memory calculation will be available
         //auto id = get_uuid(req->param["name"], ctx.db.local());
         return make_ready_future<json::json_return_type>(0);
     });
@@ -488,7 +491,10 @@

     cf::get_index_summary_off_heap_memory_used.set(r, [] (std::unique_ptr<request> req) {
         //TBD
-        unimplemented();
+        // FIXME
+        // We are missing the off heap memory calculation
+        // Return 0 is the wrong value. It's a work around
+        // until the memory calculation will be available
         //auto id = get_uuid(req->param["name"], ctx.db.local());
         return make_ready_future<json::json_return_type>(0);
     });
@@ -501,7 +507,10 @@

     cf::get_compression_metadata_off_heap_memory_used.set(r, [] (std::unique_ptr<request> req) {
         //TBD
-        unimplemented();
+        // FIXME
+        // We are missing the off heap memory calculation
+        // Return 0 is the wrong value. It's a work around
+        // until the memory calculation will be available
         //auto id = get_uuid(req->param["name"], ctx.db.local());
         return make_ready_future<json::json_return_type>(0);
     });


checking for self-complement edges

checking for self-complement edges

--- src/repeat_graph/repeat_graph.cpp
+++ src/repeat_graph/repeat_graph.cpp
@@ -376,7 +376,7 @@
 		for (auto& edgeClust : edgeClusters)
 		{
 			//in case we have complement edges within the node pair
-			auto anySegment = *edgeClust.second.front();
+			auto& anySegment = *edgeClust.second.front();
 			if (std::find(usedSegments.begin(), usedSegments.end(), anySegment)
 						  != usedSegments.end()) continue;

@@ -391,14 +391,22 @@
 				usedSegments.push_back(seg->complement());
 			}

-			leftNode = complEdges[nodePairSeqs.first].first;
-			rightNode = complEdges[nodePairSeqs.first].second;
-			GraphEdge* complEdge = this->addEdge(GraphEdge(leftNode, rightNode,
-										   	FastaRecord::Id(_nextEdgeId + 1)));
-			for (auto& seg : edgeClust.second)
-			{
-				complEdge->seqSegments.push_back(seg->complement());
-				++complEdge->multiplicity;
+			//check if it's self-complmenet
+			bool selfComplement = std::find(usedSegments.begin(),
+						usedSegments.end(), anySegment) != usedSegments.end();
+
+			newEdge->selfComplement = selfComplement;
+			if (!selfComplement)
+			{
+				leftNode = complEdges[nodePairSeqs.first].first;
+				rightNode = complEdges[nodePairSeqs.first].second;
+				GraphEdge* complEdge = this->addEdge(GraphEdge(leftNode, rightNode,
+												FastaRecord::Id(_nextEdgeId + 1)));
+				for (auto& seg : edgeClust.second)
+				{
+					complEdge->seqSegments.push_back(seg->complement());
+					++complEdge->multiplicity;
+				}
 			}

 			_nextEdgeId += 2;


Repositioned and resized some elements in TransactionCtrl. Date is now on
bottom row. Added labels "Source:", "Destination:" and "Comment:" to help
user navigate the interface. Put spaces between rows.

git-svn-id: 0231d2b9506727b8389b50bfeac72ec1f38c13c1@1601 ac3cbfda-f6ac-4daa-b570-d46c5f00fc98

--- graphical_session/wxs/transaction_ctrl.cpp
+++ graphical_session/wxs/transaction_ctrl.cpp
@@ -162,6 +162,23 @@
 	);
 	m_transaction_type_ctrl->set_transaction_type(initial_transaction_type);
 	m_top_sizer->Add(m_transaction_type_ctrl, wxGBPosition(row, 1));
+	wxString const currency_abbreviation = bstring_to_wx
+	(	m_database_connection.default_commodity().abbreviation()
+	);
+	wxStaticText* const currency_text = new wxStaticText
+	(	this,
+		wxID_ANY,
+		currency_abbreviation,
+		wxDefaultPosition,
+		ok_button_size,
+		wxALIGN_RIGHT
+	);
+	m_top_sizer->Add
+	(	currency_text,
+		wxGBPosition(row, 2),
+		wxDefaultSpan,
+		wxALIGN_RIGHT
+	);
 	m_primary_amount_ctrl = new DecimalTextCtrl
 	(	this,
 		s_primary_amount_ctrl_id,
@@ -169,10 +186,13 @@
 		m_database_connection.default_commodity().precision(),
 		false
 	);
-	m_top_sizer->Add(m_primary_amount_ctrl, wxGBPosition(row, 2));
+	m_top_sizer->Add
+	(	m_primary_amount_ctrl,
+		wxGBPosition(row, 3),
+		wxDefaultSpan,
+		wxALIGN_RIGHT
+	);
 	wxSize const date_ctrl_sz(ok_button_size.x, ok_button_size.y);
-	m_date_ctrl = new DateCtrl(this, wxID_ANY, date_ctrl_sz);
-	m_top_sizer->Add(m_date_ctrl, wxGBPosition(row, 4));

 	row += 2;

@@ -198,9 +218,29 @@
 	accounts.push_back(account_x);
 	accounts.push_back(account_y);

+	++row;
+
 	Size const sz = accounts.size();
-	for (Size id = s_min_entry_row_id, i = 0 ; i != sz; ++i, id += 2, ++row)
-	{
+	for (Size id = s_min_entry_row_id, i = 0 ; i != sz; ++i, id += 2, row += 3)
+	{
+		wxStaticText* const account_label = new wxStaticText
+		(	this,
+			wxID_ANY,
+			((i == 0)? wxString(" Source:"): wxString(" Destination:")),
+			wxDefaultPosition,
+			wxDefaultSize,
+			wxALIGN_LEFT
+		);
+		m_top_sizer->Add(account_label, wxGBPosition(row - 1, 1));
+		wxStaticText* const comment_label = new wxStaticText
+		(	this,
+			wxID_ANY,
+			wxString("Comment:"),
+			wxDefaultPosition,
+			wxDefaultSize,
+			wxALIGN_LEFT
+		);
+		m_top_sizer->Add(comment_label, wxGBPosition(row - 1, 2));
 		Account const account = accounts[i];
 		assert ((i == 0) || (i == 1));
 		assert (accounts.size() == 2);
@@ -230,7 +270,7 @@
 		wxButton* split_button = new wxButton
 		(	this,
 			id + 1,
-			wxString("&Split..."),
+			wxString("Split..."),
 			wxDefaultPosition,
 			ok_button_size
 		);
@@ -245,7 +285,6 @@
 		m_split_buttons.push_back(split_button);
 	}

-	// Button row
 	m_cancel_button = new wxButton
 	(	this,
 		wxID_CANCEL,
@@ -254,6 +293,8 @@
 		ok_button_size
 	);
 	m_top_sizer->Add(m_cancel_button, wxGBPosition(row, 1));
+	m_date_ctrl = new DateCtrl(this, wxID_ANY, date_ctrl_sz);
+	m_top_sizer->Add(m_date_ctrl, wxGBPosition(row, 2));
 	m_recurring_transaction_button = new wxButton
 	(	this,
 		s_recurring_transaction_button_id,
@@ -261,7 +302,7 @@
 		wxDefaultPosition,
 		wxSize(ok_button_size.x, ok_button_size.y)
 	);
-	m_top_sizer->Add(m_recurring_transaction_button, wxGBPosition(row, 2));
+	m_top_sizer->Add(m_recurring_transaction_button, wxGBPosition(row, 3));
 	m_top_sizer->Add(m_ok_button, wxGBPosition(row, 4));
 	m_ok_button->SetDefault();  // Enter key will now trigger "OK" button


[tidy] Fix arithmetic in Log2Histogram

[tidy] Fix arithmetic in Log2Histogram

--- cvmfs/util/algorithm.cc
+++ cvmfs/util/algorithm.cc
@@ -109,7 +109,7 @@
 unsigned int Log2Histogram::GetQuantile(float n) {
   uint64_t total = this->N();
   // pivot is the index of the element corresponding to the requested quantile
-  uint64_t pivot = total * static_cast<uint64_t>(n);
+  uint64_t pivot = static_cast<uint64_t>(static_cast<float>(total) * n);
   float normalized_pivot = 0.0;
   // now we iterate through all the bins
   // note that we _exclude_ the overflow bin


Added messages when items = 0

Added messages when items = 0

--- Turn/src/Player.cpp
+++ Turn/src/Player.cpp
@@ -150,6 +150,9 @@
 			if (potions > 0) {
 				UsePotion();
 				Sleep(SLEEP_MS);
+			} else {
+				cout << "No potions in the inventory!" << endl;
+				Sleep(SLEEP_MS);
 			}

 			break;
@@ -159,6 +162,9 @@
 			// No damage is done to the enemy.
 			if (whetstones > 0) {
 				UseWhetstone();
+				Sleep(SLEEP_MS);
+			} else {
+				cout << "No whetstones in the inventory!" << endl;
 				Sleep(SLEEP_MS);
 			}

@@ -388,4 +394,4 @@
 	ColourPrint(name, DARK_GREY);
     cout << " chooses to flee!" << endl;
     return -1;
-}+}


Removed pointless RSI comment.

Removed pointless RSI comment.

--- src/rpc/connectivity/messages.hpp
+++ src/rpc/connectivity/messages.hpp
@@ -4,9 +4,6 @@

 #include <vector>

-// For cluster_version_t.  Once we drop old gcc's, we can just declare "enum class
-// cluster_version_t;" in this header.
-// RSI: Can we do that now?
 #include "version.hpp"

 class connectivity_service_t;


added comment to test refing in commit messages

refs #28

--- hardware/cores/minicommand2/weak_funcs.cpp
+++ hardware/cores/minicommand2/weak_funcs.cpp
@@ -75,6 +75,7 @@

 	void setupClockCallbacks() {
 		MidiClock.addOn16Callback(this, (midi_clock_callback_ptr_t)&DefaultCallbacks::on16Callback);
+		// on32callbacks weakly linked, XXX check performance
 		MidiClock.addOn32Callback(this, (midi_clock_callback_ptr_t)&DefaultCallbacks::on32Callback);
 	}


Script/Spell: Shadowmourne - Soul Fragment Proc (Enable on BG And Arena) (#307)

--- src/scripts/Spells/spell_item.cpp
+++ src/scripts/Spells/spell_item.cpp
@@ -2444,8 +2444,8 @@
                     return false;

                 // Xinef: Not on BG / Arena
-                if (!GetTarget()->FindMap() || GetTarget()->FindMap()->IsBattlegroundOrArena())
-                    return false;
+                /*if (!GetTarget()->FindMap() || GetTarget()->FindMap()->IsBattlegroundOrArena())
+                    return false;*/

                 if (const SpellInfo* procSpell = eventInfo.GetDamageInfo()->GetSpellInfo())
                     if (!eventInfo.GetDamageInfo()->GetDamage())


Use auto const & to iterate over vector

Use auto const & to iterate over vector

--- examples/udp-client.cxx
+++ examples/udp-client.cxx
@@ -1,6 +1,6 @@
 /* -*- coding: utf-8; mode: c++; tab-width: 3; indent-tabs-mode: nil -*-

-Copyright 2017 Raffaello D. Di Napoli
+Copyright 2017-2018 Raffaello D. Di Napoli

 This file is part of Lofty.

@@ -40,7 +40,7 @@
       LOFTY_UNUSED_ARG(args);

       net::udp::client client;
-      LOFTY_FOR_EACH(auto arg, args) {
+      LOFTY_FOR_EACH(auto const & arg, args) {
          auto dgram_data(_std::make_shared<io::binary::memory_stream>());
          {
             auto dgram_ostream(io::text::make_ostream(dgram_data));


Fixed a tsan warning in db_stress.cc

Fixed a tsan warning in db_stress.cc

Summary:
Fixed the following tsan warning in db_stress.cc

  WARNING: ThreadSanitizer: data race (pid=3163194)
  Read of size 8 at 0x7fd1797cb518 by thread T32:
    #0 VerifyDb tools/db_stress.cc:1731 (db_stress+0x000000040674)
    #1 rocksdb::StressTest::ThreadBody(void*) tools/db_stress.cc:1191 (db_stress+0x0000000625a9)
    #2 StartThreadWrapper util/env_posix.cc:1648 (db_stress+0x00000028bbbd)

  Previous write of size 8 at 0x7fd1797cb518 by thread T31:
    #0 VerifyDb tools/db_stress.cc:1726 (db_stress+0x00000004072a)
    #1 rocksdb::StressTest::ThreadBody(void*) tools/db_stress.cc:1191 (db_stress+0x0000000625a9)
    #2 StartThreadWrapper util/env_posix.cc:1648 (db_stress+0x00000028bbbd)

The cause is that in VerifyDb(), the static local const variable long max_key
can be read and written at the same time.  This patch fixed it by making it
non-static.

Test Plan: db_stress

Reviewers: igor, sdong, IslamAbdelRahman, anthony

Reviewed By: anthony

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D47703

--- tools/db_stress.cc
+++ tools/db_stress.cc
@@ -1723,10 +1723,10 @@
   void VerifyDb(ThreadState* thread) const {
     ReadOptions options(FLAGS_verify_checksum, true);
     auto shared = thread->shared;
-    static const long max_key = shared->GetMaxKey();
-    static const long keys_per_thread = max_key / shared->GetNumThreads();
-    long start = keys_per_thread * thread->tid;
-    long end = start + keys_per_thread;
+    const int64_t max_key = shared->GetMaxKey();
+    const int64_t keys_per_thread = max_key / shared->GetNumThreads();
+    int64_t start = keys_per_thread * thread->tid;
+    int64_t end = start + keys_per_thread;
     if (thread->tid == shared->GetNumThreads() - 1) {
       end = max_key;
     }


Coverage for reset.cpp (take 2)

Coverage for reset.cpp (take 2)

--- tests/reset/reset.cpp
+++ tests/reset/reset.cpp
@@ -129,15 +129,15 @@
     r.setOrder(1);
     // Testing assignment for Reset
     r1 = r;
-    EXPECT_EQ(size_t(1), r1.order());
+    EXPECT_EQ(1, r1.order());

     // Testing move assignment for Reset
     r2 = std::move(r1);
-    EXPECT_EQ(size_t(1), r2.order());
+    EXPECT_EQ(1, r2.order());

     // Testing move constructor for Reset
     libcellml::Reset r3 = std::move(r2);
-    EXPECT_EQ(size_t(1), r3.order());
+    EXPECT_EQ(1, r3.order());
 }

 TEST(Reset, printResetWithVariable)


Fixed linking problem on Windows.

Fixed linking problem on Windows.

--- dashel/dashel-win32.cpp
+++ dashel/dashel-win32.cpp
@@ -61,6 +61,7 @@
 #include <winsock2.h>
 #include <windows.h>
 #include <setupapi.h>
+#include <initguid.h>
 #include <devguid.h>
 #include <regstr.h>
 #include <winnls.h>


Opacity is now encoded in diffuse colors alpha value.

This can be used with a transparent shader in unity.

Converting cell to point data is disabled because this crashes both in
ParaView as in OGS.

--- VtkFbxConverter.cxx
+++ VtkFbxConverter.cxx
@@ -348,8 +348,8 @@
 	}
 	else
 	{
-		material->Diffuse.Set(FbxDouble3(diffuseColor[0],
-			diffuseColor[1], diffuseColor[2]));
+		material->Diffuse.Set(FbxDouble4(diffuseColor[0],
+			diffuseColor[1], diffuseColor[2], 1.0 - opacity));
 		material->DiffuseFactor.Set(diffuse);
 	}

@@ -368,7 +368,7 @@
 	vtkMapper* actorMapper = _actor->GetMapper();
 	// Get the color range from actors lookup table
 	double range[2] = {0, 0};
-	vtkLookupTable* actorLut = dynamic_cast<vtkLookupTable*>(actorMapper->GetLookupTable());
+	vtkLookupTable* actorLut = static_cast<vtkLookupTable*>(actorMapper->GetLookupTable());
 	if(actorLut)
 	{
 		cout << "Getting color range from lut ..." << endl; // Without this cout it crashes??!
@@ -378,7 +378,7 @@
 	// Copy mapper to a new one
 	vtkPolyDataMapper* pm = vtkPolyDataMapper::New();
 	// Convert cell data to point data
-	if(convertCellToPointData && (
+	if(false && (
 	   actorMapper->GetScalarMode() == VTK_SCALAR_MODE_USE_CELL_DATA ||
 	   actorMapper->GetScalarMode() == VTK_SCALAR_MODE_USE_CELL_FIELD_DATA))
 	{


Update init.cpp

Update init.cpp

--- tests/source/init.cpp
+++ tests/source/init.cpp
@@ -1,8 +1,7 @@
-
 #include <stack.cpp>
 #include <catch.hpp>
 #include <iostream>
-//using namespace std;
+using namespace std;

 SCENARIO("count", "[count]"){
   stack<int> s;
@@ -14,23 +13,14 @@
   stack<int> s;
   s.push(1);
   REQUIRE(s.count()==1);
-  REQUIRE(s.top()==1);
-}
-
-SCENARIO("top", "[top]"){
-  stack<int> s;
-  s.push(1);
-  REQUIRE(s.count()==1);
-  REQUIRE(s.top()==1);
+  REQUIRE(s.pop()==1);
 }

 SCENARIO("pop", "[pop]"){
   stack<int> s;
   s.push(1);
-  s.push(2);
-  s.pop();
   REQUIRE(s.count()==1);
-  REQUIRE(s.top()==1);
+  REQUIRE(s.pop()==1);
 }

@@ -40,20 +30,16 @@
   stack<int> s2;
   s2=s;
   REQUIRE(s.count()==1);
-  REQUIRE(s.top()==1);
+  REQUIRE(s.pop()==1);
 }
 SCENARIO("copy", "[copy]"){
   stack<int> s;
   s.push(1);
   stack <int> a = s;
   REQUIRE(a.count()==1);
-  REQUIRE(a.top()==1);
+  REQUIRE(a.pop()==1);
 }
 SCENARIO("test", "[test]"){
   stack<int> s;
   REQUIRE(s.count()==0);
 }
-SCENARIO("empty", "[empty]"){
-  stack<int> s;
-  REQUIRE(s.empty()==true);
-}


Fix pointer dereferencing.

Fix pointer dereferencing.

--- python/brotlimodule.cc
+++ python/brotlimodule.cc
@@ -191,7 +191,7 @@
                                     &total_out, &state);
     size_t used_out = kBufferSize - available_out;
     if (used_out != 0)
-      output->insert(output->end(), buffer, buffer + used_out);
+      output.insert(output.end(), buffer, buffer + used_out);
   }
   ok = result == BROTLI_RESULT_SUCCESS;
   if (ok) {


Cleanups.

Cleanups.

--- python/fixfmt/Table.cc
+++ python/fixfmt/Table.cc
@@ -83,12 +83,13 @@
  * Template method for adding a column to the table.
  *
  * 'buf' is a 'bytes' object containing contiguous values of type 'TYPE', e.g.
- * 'int' or 'double'.  'PYFMT" is a Python object that wraps a formatter for
+ * 'int' or 'double'.  'PYFMT' is a Python object that wraps a formatter for
  * 'TYPE' values.
  */
 template<typename TYPE, typename PYFMT>
 ref<Object> add_column(Table* self, Tuple* args, Dict* kw_args)
 {
+  // Parse args.
   static char const* arg_names[] = {"buf", "format", nullptr};
   PyObject* array;
   PYFMT* format;
@@ -96,19 +97,22 @@
       args, kw_args, "OO!", arg_names,
       &array, &PYFMT::type_, &format);

-  BufferRef buffer(array, PyBUF_CONTIG_RO);
+  // Validate args.
+  BufferRef buffer(array, PyBUF_ND);
   if (buffer->ndim != 1)
     throw Exception(PyExc_TypeError, "not a one-dimensional array");
   if (buffer->itemsize != sizeof(TYPE))
     throw Exception(PyExc_TypeError, "wrong itemsize");

-  using ColumnUptr = unique_ptr<fixfmt::Column>;
+  // Add the column.
   using Column = fixfmt::ColumnImpl<TYPE, typename PYFMT::Formatter>;
-
-  long const len = buffer->len / buffer->itemsize;
-  self->table_->add_column(
-    ColumnUptr(new Column((TYPE*) buffer->buf, len, *format->fmt_)));
-  self->buffers_.emplace_back(std::move(buffer));
+  self->table_->add_column(std::make_unique<Column>(
+    reinterpret_cast<TYPE*>(buffer->buf),
+    buffer->shape[0],
+    *format->fmt_));
+  // Hold on to the buffer ref.
+  self->buffers_.push_back(std::move(buffer));
+
   return none_ref();
 }

@@ -154,6 +158,7 @@

 ref<Object> add_str_object_column(Table* self, Tuple* args, Dict* kw_args)
 {
+  // Parse args.
   static char const* arg_names[] = {"buf", "format", nullptr};
   PyObject* array;
   String* format;
@@ -161,18 +166,21 @@
       args, kw_args, "OO!", arg_names,
       &array, &String::type_, &format);

-  BufferRef buffer(array, PyBUF_CONTIG_RO);
+  // Validate args.
+  BufferRef buffer(array, PyBUF_ND);
   if (buffer->ndim != 1)
     throw Exception(PyExc_TypeError, "not a one-dimensional array");
   if (buffer->itemsize != sizeof(Object*))
     throw Exception(PyExc_TypeError, "wrong itemsize");

-  using ColumnUptr = unique_ptr<fixfmt::Column>;
-
-  long const len = buffer->len / buffer->itemsize;
-  self->table_->add_column(ColumnUptr(
-    new StrObjectColumn((Object**) buffer->buf, len, *format->fmt_)));
+  // Add the column.
+  self->table_->add_column(std::make_unique<StrObjectColumn>(
+    reinterpret_cast<Object**>(buffer->buf),
+    buffer->shape[0],
+    *format->fmt_));
+  // Hold on to the buffer ref.
   self->buffers_.emplace_back(std::move(buffer));
+
   return none_ref();
 }


コンストラクトをsetupにまとめた

コンストラクトをsetupにまとめた

--- tests/testReadVrp.cpp
+++ tests/testReadVrp.cpp
@@ -6,26 +6,32 @@

 TEST_GROUP(ReadVrpFile)
 {
+    Vrp *vrp;
+
+    void setup(void)
+    {
+        vrp = new Vrp("Vrp-All/E/E-n13-k4.vrp");
+    }
+
+    void teardown(void)
+    {
+        delete vrp;
+    }
 };

 TEST(ReadVrpFile, name)
 {
-    Vrp vrp("Vrp-All/E/E-n13-k4.vrp");
-
-    std::string name = vrp.name();
+    std::string name = vrp->name();

     CHECK_EQUAL("E-n13-k4", name);
 }

 TEST(ReadVrpFile, demension)
 {
-    Vrp vrp("Vrp-All/E/E-n13-k4.vrp");
-
-    LONGS_EQUAL(13, vrp.demension());
+    LONGS_EQUAL(13, vrp->demension());
 }

 TEST(ReadVrpFile, edge_weight_type)
 {
-    Vrp vrp("Vrp-All/E/E-n13-k4.vrp");
-    CHECK_EQUAL("EXPLICIT", vrp.edge_weight_type());
+    CHECK_EQUAL("EXPLICIT", vrp->edge_weight_type());
 }


Update xtp_md_source_function.cpp

Update xtp_md_source_function.cpp

--- vnpy/api/xtp/generator/xtp_md_source_function.cpp
+++ vnpy/api/xtp/generator/xtp_md_source_function.cpp
@@ -6,11 +6,11 @@
 	return i;
 };

-int MdApi::queryTickersPriceInfo(char ticker, int count, int exchange_id)
+int MdApi::queryTickersPriceInfo(string ticker, int count, int exchange_id)
 {
 	char myreq = char();
 	memset(&myreq, 0, sizeof(myreq));
-	int i = this->api->QueryTickersPriceInfo(&myreq, (XTP_EXCHANGE_TYPE) exchange_id);
+	int i = this->api->QueryTickersPriceInfo(&myreq, reqid);
 	return i;
 };

@@ -18,7 +18,7 @@
 {
 	char myreq = char();
 	memset(&myreq, 0, sizeof(myreq));
-	int i = this->api->QueryAllTickersPriceInfo(&myreq, (XTP_EXCHANGE_TYPE) exchange_id);
+	int i = this->api->QueryAllTickersPriceInfo(&myreq, reqid);
 	return i;
 };


RCORE: tests: split off CxxPrintf tests

RCORE: tests: split off CxxPrintf tests

--- rcore/tests/strings.cc
+++ rcore/tests/strings.cc
@@ -440,7 +440,7 @@
 };

 static void
-test_string_functions (void)
+test_string_functions()
 {
   TASSERT (string_startswith ("foo", "fo") == true);
   TASSERT (string_startswith ("foo", "o") == false);
@@ -448,16 +448,6 @@
   TASSERT (string_endswith ("foo", "oo") == true);
   TASSERT (string_endswith ("foo", "foo") == true);
   TASSERT (string_endswith ("foo", "loo") == false);
-  // string_format
-  enum { TEST17 = 17 };
-  TCMP (string_format ("%d %s", -9223372036854775808uLL, "FOO"), ==, "-9223372036854775808 FOO");
-  TCMP (string_format ("%g %d", 0.5, int (TEST17)), ==, "0.5 17"); // gcc corrupts anonymous enums without the cast
-  TCMP (string_format ("0x%08x", 0xc0ffee), ==, "0x00c0ffee");
-  static_assert (TEST17 == 17, "!");
-  TCMP (string_format ("Only %c%%", '3'), ==, "Only 3%");
-  UncopyablePoint point { 1, 2 };
-  vector<String> foo;
-  TCMP (string_format ("%s", point), ==, "{1;2}");
   // string_hexdump
   String dump;
   const uint8 mem[] = { 0x00, 0x01, 0x02, 0x03, 0x34, 0x35, 0x36, 0x37,
@@ -471,6 +461,22 @@
   TCMP (dump, ==, String() + expect00 + expect10);
 }
 REGISTER_TEST ("Strings/String Functions", test_string_functions);
+
+static void
+test_cxxprintf()
+{
+  // string_format
+  enum { TEST17 = 17 };
+  TCMP (string_format ("%d %s", -9223372036854775808uLL, "FOO"), ==, "-9223372036854775808 FOO");
+  TCMP (string_format ("%g %d", 0.5, int (TEST17)), ==, "0.5 17"); // gcc corrupts anonymous enums without the cast
+  TCMP (string_format ("0x%08x", 0xc0ffee), ==, "0x00c0ffee");
+  static_assert (TEST17 == 17, "!");
+  TCMP (string_format ("Only %c%%", '3'), ==, "Only 3%");
+  UncopyablePoint point { 1, 2 };
+  vector<String> foo;
+  TCMP (string_format ("%s", point), ==, "{1;2}");
+}
+REGISTER_TEST ("Strings/CxxPrintf", test_cxxprintf);

 struct AAData
 {


Fixed #2 und #6

Fixed #2 und #6


Update test for MsgPack

Update test for MsgPack

--- tests/test_msgpack.cc
+++ tests/test_msgpack.cc
@@ -226,7 +226,7 @@
 		L_ERR(nullptr, "ERROR: Msgpack::move assigment from ARRAY to MAP is not working. Result:\n %s\nExpected:\n %s\n", result.c_str(), res2.c_str());
 		++res;
 	}
-	if (m_map.capacity() != MSGPACK_MAP_INIT_SIZE) {
+	if (m_map.capacity() != m_map.size()) {
 		L_ERR(nullptr, "ERROR: Msgpack::move assigment from ARRAY to MAP is not reserving correctly. Result:\n %zu\nExpected:\n %zu\n", m_map.capacity(), m_map.size());
 		++res;
 	}


添加读写配置文件

添加读写配置文件

--- tests/test_server.cpp
+++ tests/test_server.cpp
@@ -26,6 +26,7 @@
 #include "Thread/WorkThreadPool.h"
 #include "Device/PlayerProxy.h"
 #include "Shell/ShellSession.h"
+#include "Common/config.h"
 #include <map>
 using namespace std;
 using namespace ZL::Util;
@@ -43,7 +44,7 @@
 int main(int argc,char *argv[]){
 	signal(SIGINT, programExit);
 	Logger::Instance().add(std::make_shared<ConsoleChannel>("stdout", LTrace));
-
+	Config::loaIniConfig();
 	//support rtmp and rtsp url
 	//just support H264+AAC
 	auto urlList = {"rtmp://live.hkstv.hk.lxdns.com/live/hks",


recommitting to check if memcheck re-fails

--- tests/units/units.cpp
+++ tests/units/units.cpp
@@ -1486,8 +1486,8 @@

     model->addUnits(u);

+    import->setModel(model);
     u->setImportSource(import);
-    import->setModel(model);

     EXPECT_TRUE(u->isImport());
     EXPECT_TRUE(u->isBaseUnit());


restore headers

restore headers

--- tmux-mem-cpu-load.cpp
+++ tmux-mem-cpu-load.cpp
@@ -15,7 +15,8 @@
  * */

 #include <cstring>
-#include <ostream>
+#include <iostream>
+#include <fstream>
 #include <sstream>
 #include <string>
 #include <cstdlib> // EXIT_SUCCESS


Add guard to protect against ...->Future being null

--- tomviz/DataSource.cxx
+++ tomviz/DataSource.cxx
@@ -1078,7 +1078,9 @@

 void DataSource::cancelPipeline()
 {
-  this->Internals->Future->cancel();
+  if (this->Internals->Future) {
+    this->Internals->Future->cancel();
+  }
 }

 void DataSource::setPersistenceState(DataSource::PersistenceState state)


format fix

format fix

--- franka_control/src/franka_control_node.cpp
+++ franka_control/src/franka_control_node.cpp
@@ -82,7 +82,7 @@
   };

   auto connectHandler = [&](std_srvs::Trigger::Request& request,
-                     std_srvs::Trigger::Response& response) -> bool {
+                            std_srvs::Trigger::Response& response) -> bool {
     if (franka_control.connected()) {
       response.success = 0u;
       response.message = "Already connected to robot. Cannot connect twice.";


typo fix

typo fix

--- franka_control/src/franka_control_node.cpp
+++ franka_control/src/franka_control_node.cpp
@@ -70,7 +70,7 @@
                                 std_srvs::Trigger::Response& response) -> bool {
     if (franka_control.controllerActive()) {
       response.success = 0u;
-      response.message = "Controller is active. Cannont disconnect while a controller is running.";
+      response.message = "Controller is active. Cannot disconnect while a controller is running.";
       return true;
     }
     services.reset();


Fixed error in colorer.

Fixed error in colorer.

--- Colorer.cpp
+++ Colorer.cpp
@@ -118,6 +118,7 @@
 			for(unsigned int i = 0; i < typeInfo.size(); i++)
 				if(typeInfo[i] == hash)
 					return true;
+			*str = curr;
 			return false;
 		}
 	protected:
@@ -305,6 +306,20 @@
 		logStream << logStr << "\r\n";
 	}

+	class DebugBreakP: public BaseP
+	{
+	public:
+		DebugBreakP(){ }
+		virtual ~DebugBreakP(){ }
+		virtual bool	Parse(char** str, SpaceRule space)
+		{
+			(void)str; (void)space;
+			return true;
+		}
+	protected:
+	};
+	Rule	breakP(){ return Rule(new DebugBreakP()); }
+
 	class Grammar
 	{
 	public:
@@ -325,7 +340,7 @@
 				!(
 					chP('<')[ColorText] >>
 					(typeExpr | (chP('@')[ColorText] >> idP[ColorRWord])) >>
-					*(chP(',') >> (typeExpr | (chP('@')[ColorText] >> idP[ColorRWord]))) >>
+					*(chP(',')[ColorText] >> (typeExpr | (chP('@')[ColorText] >> idP[ColorRWord]))) >>
 					chP('>')[ColorText]
 				) >>
 				*(
@@ -365,9 +380,10 @@
 				((strP("align")[ColorRWord] >> '(' >> intP[ColorReal] >> ')') | (strP("noalign")[ColorRWord] | epsP)) >>
 				strP("class")[ColorRWord] >>
 				(idP[StartType][ColorRWord] | epsP[LogError("ERROR: class name expected")]) >>
-				!(chP('<')[ColorText] >> idP[ColorRWord][StartType] >> *(chP(',') >> idP[ColorRWord][StartType]) >> chP('>')[ColorText]) >>
+				!(chP('<')[ColorText] >> idP[ColorRWord][StartType] >> *(chP(',')[ColorText] >> idP[ColorRWord][StartType]) >> chP('>')[ColorText]) >>
 				(chP('{') | epsP[LogError("ERROR: '{' not found after class name")])[ColorText] >>
 				*(
+					(strWP("const")[ColorRWord] >> typeExpr >> idP[ColorVarDef] >> chP('=')[ColorText] >> term4_9 >> *(chP(',')[ColorText] >> idP[ColorVarDef] >> !(chP('=')[ColorText] >> term4_9)) >> chP(';')[ColorText]) |
 					typeDef |
 					funcdef |
 					(
@@ -452,7 +468,7 @@
 								(
 									chP(':')[ColorBold] |
 									chP('.')[ColorBold] |
-									(chP('<')[ColorText] >> typeExpr >> *(chP(',') >> typeExpr) >> chP('>')[ColorText] >> chP(':')[ColorBold])
+									(chP('<')[ColorText] >> typeExpr >> *(chP(',')[ColorText] >> typeExpr) >> chP('>')[ColorText] >> chP(':')[ColorBold])
 								) >>
 								(idP[ColorFunc] | epsP[LogError("ERROR: function name expected after ':'")]) >>
 								chP('(')[ColorBold]
@@ -566,7 +582,7 @@
 					idP[StartType][ColorRWord] |
 					epsP[LogError("ERROR: alias name expected after typename in typedef expression")]
 				) >>
-				(chP(';') | epsP[LogError("ERROR: ';' expected after typedef")]);
+				(chP(';')[ColorText] | epsP[LogError("ERROR: ';' expected after typedef")]);

 			returnExpr		=	(strWP("return") | strWP("yield"))[ColorRWord] >> (term5 | epsP) >> (+(';' >> epsP)[ColorBold] | epsP[LogError("ERROR: return statement must be followed by ';'")]);
 			breakExpr		=	strWP("break")[ColorRWord] >> (term4_9 | epsP) >> (+chP(';')[ColorBold] | epsP[LogError("ERROR: break statement must be followed by ';'")]);


Simplified randomness test

Simplified randomness test

--- src/Tests/Unit/Network/TestNetworkBalancer.hpp
+++ src/Tests/Unit/Network/TestNetworkBalancer.hpp
@@ -25,8 +25,10 @@
     const static int MAX_TESTS_TO_FAIL = 500000;
     /* @brief Flag to control the output of the send method and the expected result comparison */
     bool isMatching;
-    /* @brief Maximum tolerance allowed when comparing the expected appearance ratio with the real one */
-    constexpr static double RANDOM_TOLERANCE = 0.05;
+    /* @brief Maximum tolerance allowed when comparing the expected appearance ratio with the real
+     * one. In this case we assume a 0.25% of variability from the max number of tests. This should
+     * be enough for any random number generator without compromising the reliability of the test */
+    constexpr static int RANDOM_TOLERANCE = MAX_TESTS_TO_FAIL*0.0025;

 public:

@@ -41,6 +43,8 @@
     void tearDown()
     {
     }
+
+ //-------------------------------------------------------------------------------------------------

     /**
      * @brief testSendIsNotRr Test that iterates until the expected result based on
@@ -76,7 +80,9 @@
         // test as failed
         CPPUNIT_ASSERT( !isMatching );
     }
-
+
+//--------------------------------------------------------------------------------------------------
+
     /**
      * @brief testSendIsRandom Tests that the send method is producing a randomized output by
      * checking that all the possible combinations are appearing near the same number of times in
@@ -84,82 +90,37 @@
      */
     void testSendIsRandom()
     {
-    // Create and fill a list containing all possible combinations of four consecutive numbers
-    std::list<int> aPossibleResList = std::list<int>();
-    for ( int i=1; i<Network::NetworkBalancer::MAX_OUTPUTS+1; i++ )
-    {
-        for( int j=1; j<Network::NetworkBalancer::MAX_OUTPUTS+1; j++ )
-        {
-            for ( int k=1;  k<Network::NetworkBalancer::MAX_OUTPUTS+1; k++ )
-            {
-                for ( int l=1; l<Network::NetworkBalancer::MAX_OUTPUTS+1; l++ )
-                {
-                    // Calculate a number "signature" for each four-number combination
-                    aPossibleResList.insert( aPossibleResList.end(), i*1000 + j*100 + k*10 + l );
-                }
-            }
-        }
-    }
-
     // Create a data to be sent
     std::string aTestPacket( "TestPacketIsRandom" );

-    // Create a map to store the results of the iteration
-    std::map<int, int> aResultsMap = std::map<int, int>();
-    // Initialize all possible keys in the map
-    for ( std::list<int>::iterator it = aPossibleResList.begin(); it!=aPossibleResList.end(); ++it )
-    {
-        aResultsMap[ *it ] = 0;
-    }
-
-    // Must be assured the number of repetitions is big enough for the results to be statistically coherent
-    // Iteration process
+    // Counter for matches
+    int aMatchCounter = 0;
+
+    // Given an execution, count the number of times that the next execution returns the next
+    // number of the series. In a random system, this should be near to 1/number_of_outputs
     for ( int i=0; i<MAX_TESTS_TO_FAIL; i++ )
     {
-        // Calculate a signature value for each four iteration
-        int aSignatureValue = ( theNetSender.sendTroughBalancer( aTestPacket.c_str(), aTestPacket.size() )*1000
-                              + theNetSender.sendTroughBalancer( aTestPacket.c_str(), aTestPacket.size() )*100
-                              + theNetSender.sendTroughBalancer( aTestPacket.c_str(), aTestPacket.size() )*10
-                              + theNetSender.sendTroughBalancer( aTestPacket.c_str(), aTestPacket.size() ) );
+        int aFirst  = theNetSender.sendTroughBalancer( aTestPacket.c_str(), aTestPacket.size() );
+        int aSecond = theNetSender.sendTroughBalancer( aTestPacket.c_str(), aTestPacket.size() );

-        // Check the key exists (all possible values should) prior to incrementing the counter
-        // for that signature in one unit
-        if ( aResultsMap.find( aSignatureValue )!=aResultsMap.end() )
-        {
-            aResultsMap[ aSignatureValue ] = aResultsMap.at( aSignatureValue )+1;
-        }
-        else
-        {
-            // Key not found, but the map should already content all possible values, so something
-            // wicked happened! Fail the test
-            CPPUNIT_ASSERT( false );
-        }
+        if ( aSecond == ( aFirst%Network::NetworkBalancer::MAX_OUTPUTS )+1)
+            aMatchCounter++;
     }
-
-    // Calculate the appearance ratio for each signature value
-    double aEstimatedPercentage = 100.0 / (double)aPossibleResList.size();

-    // Iterate through the map to check the appearance rate of each signature
-    for ( std::map<int, int>::iterator it = aResultsMap.begin(); it!=aResultsMap.end(); ++it )
+    // Check if the abs value of the difference between the real appearance count and the
+    // expected one is lower than the calculated tolerance
+    if ( std::abs( aMatchCounter - ( MAX_TESTS_TO_FAIL / Network::NetworkBalancer::MAX_OUTPUTS )) < RANDOM_TOLERANCE )
     {
-        std::cout << it->first << " -> " << ( ( double )it->second / ( double ) MAX_TESTS_TO_FAIL )
-                     * 100.0 << "% (" << ( ( ( double )it->second / ( double ) MAX_TESTS_TO_FAIL )
-                     * 100.0 ) - aEstimatedPercentage << "%)\n" ;
-
-        // Check if the abs value of the difference between the real appearance ratio and the
-        // expected for every signature is bigger than a tolerance margin
-        if ( std::abs( ( ( ( double )it->second/( double )MAX_TESTS_TO_FAIL) * 100.0 )
-                       - aEstimatedPercentage ) > RANDOM_TOLERANCE )
-        {
-            // If any value has an appearance ratio that differs more than the tolerance from the
-            // expected one, fail the test
-            CPPUNIT_ASSERT( false );
-        }
+        // If the value is between the limits, the test is passed
+        CPPUNIT_ASSERT( true );
     }
-    // If we reach this execution point, the test is passed
-    CPPUNIT_ASSERT( true );
-
+    else
+    {
+        // If the value is bigger than the limits, the test is passed
+        CPPUNIT_ASSERT( false );
+    }
     }
 };

+
 #endif // __TESTNETWORKBALANCER_HPP


Fixing preemption bug.

Fixing preemption bug.

--- free_gait_ros/src/FreeGaitActionServer.cpp
+++ free_gait_ros/src/FreeGaitActionServer.cpp
@@ -132,6 +132,7 @@
   }
   executor_.setPreemptionType(preemptionType);
   nStepsInCurrentGoal_ = goal->steps.size();
+  isPreempting_ = false;
   lock.unlock();
 }


moved ifdef...

moved ifdef...

--- frontend/resources/src/CommandRegistry.cpp
+++ frontend/resources/src/CommandRegistry.cpp
@@ -328,8 +328,8 @@
 }

 void megamol::frontend_resources::CommandRegistry::remove_color_from_layer(
-#ifdef CUESDK_ENABLED
     const megamol::frontend_resources::Command& c) {
+#ifdef CUESDK_ENABLED
     auto& layer = key_colors[c.key.mods];
     const auto& k = corsair_led_from_glfw_key[c.key.key];
     const auto it = std::remove_if(layer.begin(), layer.end(), [k](const CorsairLedColor& c) {return c.ledId == k;});


Pulled in bugfix

Pulled in bugfix

git-svn-id: 3ad904ec35b89a071badd9cb0113dfe58093e920@633 726aef4b-f618-498e-8847-2d620e286838

--- Csocket.cpp
+++ Csocket.cpp
@@ -694,20 +694,17 @@
 	m_address.SinFamily();
 	if ( !sBindHost.empty() )
 	{
+		if( !GetIPv6() )
+		{
+			if ( GetHostByName( sBindHost, m_address.GetAddr() ) != 0 )
+				return( false );
+		}
 #ifdef HAVE_IPV6
-		if( GetIPv6() )
+		else
 		{
 			if ( GetHostByName6( sBindHost, m_address.GetAddr6() ) != 0 )
 				return( false );
 		}
-		else
-		{
-			if ( GetHostByName( sBindHost, m_address.GetAddr() ) != 0 )
-				return( false );
-		}
-#else
-		if ( GetHostByName( sBindHost, m_address.GetAddr() ) != 0 )
-			return( false );
 #endif /* HAVE_IPV6 */
 	}
 	m_address.SinPort( iPort );
@@ -1856,9 +1853,7 @@
 			iRet = GetHostByName( m_sBindHost, m_bindhost.GetAddr(), 1 );
 #ifdef HAVE_IPV6
 		else
-		{
 			iRet = GetHostByName6( m_sBindHost, m_bindhost.GetAddr6(), 1 );
-		}
 #endif /* HAVE_IPV6 */
 	}
 	else
@@ -1903,7 +1898,15 @@
 			m_eConState = CST_CONNECT;
 		return( true );
 	}
-	if ( bind( m_iReadSock, (struct sockaddr *) &m_bindhost, sizeof( m_bindhost ) ) == 0 )
+	int iRet = -1;
+	if( !GetIPv6() )
+		iRet = bind( m_iReadSock, (struct sockaddr *) m_bindhost.GetSockAddr(), m_bindhost.GetSockAddrLen() );
+#ifdef HAVE_IPV6
+	else
+		iRet = bind( m_iReadSock, (struct sockaddr *) m_bindhost.GetSockAddr6(), m_bindhost.GetSockAddrLen6() );
+#endif /* HAVE_IPV6 */
+
+	if ( iRet == 0 )
 	{
 		if ( m_eConState != CST_OK )
 			m_eConState = CST_CONNECT;


Cleanup to triangulation sample

Cleanup to triangulation sample

--- samples/Triangulation/src/TriangulationApp.cpp
+++ samples/Triangulation/src/TriangulationApp.cpp
@@ -10,7 +10,7 @@
 using namespace std;

 class TriangulationApp : public AppBasic {
- public:
+  public:
 	void		setup();
 	void		draw();

@@ -28,17 +28,25 @@
 	params::InterfaceGl	mParams;
 	bool				mDrawWireframe;
 	int					mFontSize;
+	float				mZoom;
+	float				mPrecision, mOldPrecision;
+	int					mNumPoints;
 };

 void TriangulationApp::setup()
 {
-	mParams = params::InterfaceGl( "Parameters", Vec2i( 200, 400 ) );
+	mParams = params::InterfaceGl( "Parameters", Vec2i( 220, 170 ) );
 	mFontSize = 256;
-	mParams.addParam( "Font Size", &mFontSize, "min=1 max=2000 keyIncr== keyDecr=-" );
 	mDrawWireframe = true;
 	mParams.addParam( "Draw Wireframe", &mDrawWireframe, "min=1 max=2000 keyIncr== keyDecr=-" );
 	mParams.addButton( "Random Font", bind( &TriangulationApp::setRandomFont, this ), "key=f" );
 	mParams.addButton( "Random Glyph", bind( &TriangulationApp::setRandomGlyph, this ) );
+	mZoom = 1.0f;
+	mParams.addParam( "Zoom", &mZoom, "min=0.01 max=20 keyIncr=z keyDecr=Z" );
+	mOldPrecision = mPrecision = 1.0f;
+	mParams.addParam( "Precision", &mPrecision, "min=0.01 max=20 keyIncr=p keyDecr=P" );
+	mNumPoints = 0;
+	mParams.addParam( "Num Points", &mNumPoints, "", true );

 	mFontNames = Font::getNames();
 	mFont = Font( "Times", mFontSize );
@@ -52,7 +60,10 @@

 void TriangulationApp::recalcMesh()
 {
-	mVboMesh = gl::VboMesh( Triangulator( mShape ).calcMesh( Triangulator::WINDING_ODD ) );
+	TriMesh2d mesh = Triangulator( mShape, mPrecision ).calcMesh( Triangulator::WINDING_ODD );
+	mNumPoints = mesh.getNumIndices();
+	mVboMesh = gl::VboMesh( mesh );
+	mOldPrecision = mPrecision;
 }

 void TriangulationApp::setRandomFont()
@@ -76,10 +87,14 @@

 void TriangulationApp::draw()
 {
+	if( mOldPrecision != mPrecision )
+		recalcMesh();
+
 	gl::clear();
 	gl::pushModelView();
-		gl::translate( getWindowCenter() );
-		gl::color( Color( 0, 0, 0.8f ) );
+		gl::translate( getWindowCenter() * Vec2f( 0.8f, 1.2f ) );
+		gl::scale( Vec3f( mZoom, mZoom, mZoom ) );
+		gl::color( Color( 0.8f, 0.4f, 0.0f ) );
 		gl::draw( mVboMesh );
 		if( mDrawWireframe ) {
 			gl::enableWireframe();


add default port for ZK connection

add default port for ZK connection

--- samson/apps/samsonWorker/main_samsonWorker.cpp
+++ samson/apps/samsonWorker/main_samsonWorker.cpp
@@ -344,8 +344,12 @@
   valgrindExit(12);

   // Instance of SamsonWorker object
-  // -----------------------------------------------------------------------------------
-  worker = new samson::SamsonWorker(zoo_host, port, web_port);
+  std::string my_zoo_host = zoo_host;
+  if (my_zoo_host.find(':') == std::string::npos) {
+    my_zoo_host += ":2181";
+  }
+
+  worker = new samson::SamsonWorker(my_zoo_host, port, web_port);

   // At the moment BlockManager is still an isolated singleton
   samson::stream::BlockManager::shared()->set_samson_worker(worker);


INTEGRATION: CWS pchfix02 (1.17.92); FILE MERGED 2006/09/01 17:42:48 kaib 1.17.92.1: #i68856# Added header markers and pch files


Convert directly from RTL_TEXTENCODING_IBM_437 to unicode

When we draw this text we assume it's in RTL_TEXTENCODING_IBM_437 and convert
from RTL_TEXTENCODING_IBM_437 to unicode.

So why when we determine the width to use convert from RTL_TEXTENCODING_IBM_437
to the system encoding, which could be anything, and get the width of that ?

--- svtools/source/filter/sgvtext.cxx
+++ svtools/source/filter/sgvtext.cxx
@@ -695,27 +695,28 @@

 sal_uInt16 GetCharWidth(OutputDevice& rOut, UCHAR c)
 {
-    UCHAR  c1;
     sal_uInt16 ChrWidth;

-    c1 = ByteString::Convert((char)c,RTL_TEXTENCODING_IBM_437, gsl_getSystemTextEncoding() );
     if (c==' ')
     {
         ChrWidth=(sal_uInt16)rOut.GetTextWidth( String('A') );
         if (rOut.GetFont().GetPitch()!=PITCH_FIXED) {
             ChrWidth=MulDiv(ChrWidth,DefaultSpace,100);
         }
-    } else {
+    }
+    else
+    {
          // with MaxChar == 255 c cannot be greater than MaxChar
          // assert if MaxChar is ever changed
         OSL_ENSURE( MaxChar == 255, "MaxChar not 255" );
+        OSL_ENSURE(sizeof(UCHAR) == 1, "should be 1");
         if (c>=MinChar /*&& c<=MaxChar*/)
         {
-            ChrWidth=(sal_uInt16)rOut.GetTextWidth(String((char)c1));
+            ChrWidth=(sal_uInt16)rOut.GetTextWidth(rtl::OUString(reinterpret_cast<sal_Char*>(&c), 1, RTL_TEXTENCODING_IBM_437));
         }
         else
         {
-            ChrWidth=(sal_uInt16)rOut.GetTextWidth(String('A'));
+            ChrWidth=(sal_uInt16)rOut.GetTextWidth(rtl::OUString(static_cast<sal_Unicode>('A')));
         }
     }
     return ChrWidth;


updating copyright

updating copyright

--- cpp/example_code/transcribe/get_transcript.cpp
+++ cpp/example_code/transcribe/get_transcript.cpp
@@ -1,3 +1,8 @@
+/*
+   Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+   SPDX-License-Identifier: Apache-2.0
+*/
+
 #include <aws/core/Aws.h>
 #include <aws/core/utils/threading/Semaphore.h>
 #include <aws/core/auth/AWSCredentialsProviderChain.h>


INTEGRATION: CWS changefileheader (1.7.246); FILE MERGED 2008/03/31 13:02:10 rt 1.7.246.1: #i87441# Change license header to LPGL v3.

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


INTEGRATION: CWS eforms2 (1.15.88); FILE MERGED 2004/11/05 16:28:26 fs 1.15.88.3: #i36484# no form properties in XML form documents 2004/07/27 13:42:25 fs 1.15.88.2: RESYNC: (1.15-1.17); FILE MERGED 2004/07/21 15:20:48 fs 1.15.88.1: #i31762# no current object/control/form anymore, but a current selection

--- svx/source/form/navigatortree.cxx
+++ svx/source/form/navigatortree.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: navigatortree.cxx,v $
  *
- *  $Revision: 1.17 $
+ *  $Revision: 1.18 $
  *
- *  last change: $Author: rt $ $Date: 2004-07-12 14:37:56 $
+ *  last change: $Author: obo $ $Date: 2004-11-16 11:26:56 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -102,9 +102,6 @@
 #ifndef _SVX_FMUNOPGE_HXX
 #include "fmpgeimp.hxx"
 #endif
-#ifndef _MULTIPRO_HXX
-#include "multipro.hxx"
-#endif
 #ifndef _SVX_FMITEMS_HXX
 #include "fmitems.hxx"
 #endif
@@ -540,10 +537,15 @@
                     // der TabDialog, wenn es genau ein Formular ist ...
                     aContextMenu.EnableItem( SID_FM_TAB_DIALOG, bSingleSelection && m_nFormsSelected );

-                    // Properties, wenn es nur Controls oder genau ein Formular ist
-                    // (und der ProBrowser nicht sowieso schon offen ist)
+                    // in XML forms, we don't allow for the properties of a form
+                    // #i36484# / 2004-11-04 /- fs@openoffice.org
+                    if ( pFormShell->GetImpl()->getDocumentType() == eEnhancedForm && !m_nControlsSelected )
+                        aContextMenu.RemoveItem( aContextMenu.GetItemPos( SID_FM_SHOW_PROPERTY_BROWSER ) );
+
+                    // if the property browser is already open, we don't allow for the properties, too
                     if( pFormShell->GetImpl()->IsPropBrwOpen() )
-                        aContextMenu.RemoveItem( aContextMenu.GetItemPos(SID_FM_SHOW_PROPERTY_BROWSER) );
+                        aContextMenu.RemoveItem( aContextMenu.GetItemPos( SID_FM_SHOW_PROPERTY_BROWSER ) );
+                    // and finally, if there's a mixed selection of forms and controls, disable the entry, too
                     else
                         aContextMenu.EnableItem( SID_FM_SHOW_PROPERTY_BROWSER,
                             (m_nControlsSelected && !m_nFormsSelected) || (!m_nControlsSelected && m_nFormsSelected) );
@@ -562,9 +564,11 @@
                     {
                         aContextMenu.SetPopupMenu( SID_FM_CHANGECONTROLTYPE, FmXFormShell::GetConversionMenu() );
                         FmControlData* pCurrent = (FmControlData*)(m_arrCurrentSelection[0]->GetUserData());
-                        Reference< XPropertySet >  xCurrentProps(pCurrent->GetFormComponent(), UNO_QUERY);
-                        pFormShell->GetImpl()->CheckControlConversionSlots(xCurrentProps, *aContextMenu.GetPopupMenu(SID_FM_CHANGECONTROLTYPE));
-                            // die Shell filtert nach weiteren Bedingungen, zum Beispiel kein 'hidden control'
+
+                        OSL_ENSURE( pFormShell->GetImpl()->isSolelySelected( pCurrent->GetFormComponent() ),
+                            "NavigatorTree::Command: inconsistency between the navigator selection, and the selection as the shell knows it!" );
+
+                        pFormShell->GetImpl()->checkControlConversionSlotsForCurrentSelection( *aContextMenu.GetPopupMenu( SID_FM_CHANGECONTROLTYPE ) );
                     }
                     else
                         aContextMenu.EnableItem( SID_FM_CHANGECONTROLTYPE, sal_False );
@@ -664,10 +668,10 @@
                         }
                         break;
                         default:
-                            if (pFormShell->GetImpl()->IsControlConversionSlot(nSlotId))
+                            if (pFormShell->GetImpl()->isControlConversionSlot(nSlotId))
                             {
                                 FmControlData* pCurrent = (FmControlData*)(m_arrCurrentSelection[0]->GetUserData());
-                                if (pFormShell->GetImpl()->ExecuteControlConversionSlot(pCurrent->GetFormComponent(), nSlotId))
+                                if ( pFormShell->GetImpl()->executeControlConversionSlot( pCurrent->GetFormComponent(), nSlotId ) )
                                     ShowSelectionProperties();
                             }
                     }
@@ -1520,8 +1524,9 @@
         FmFormShell* pFormShell = GetNavModel()->GetFormShell();
         if( pFormShell )
         {
-            pFormShell->GetImpl()->setCurForm( xNewForm );
-            pFormShell->GetCurPage()->GetImpl()->setCurForm( xNewForm );
+            InterfaceBag aSelection;
+            aSelection.insert( Reference< XInterface >( xNewForm, UNO_QUERY ) );
+            pFormShell->GetImpl()->setCurrentSelection( aSelection );

             pFormShell->GetViewShell()->GetViewFrame()->GetBindings().Invalidate(SID_FM_PROPERTIES,sal_True,sal_True);
         }
@@ -1748,113 +1753,71 @@
             "NavigatorTree::ShowSelectionProperties : selection meta data invalid !");

-        Reference< XInterface >  xInterfaceSelected;
-        Reference< XForm >  xFormSelected;
-        sal_Bool bPropertiesAvailable = sal_True;
-        sal_Bool bNeedSetCurControl = sal_True;
+        InterfaceBag aSelection;
+        sal_Bool bSetSelectionAsMarkList = sal_False;

         if (m_bRootSelected)
-            bPropertiesAvailable = sal_False;   // fuer die Root habe ich keine - weder einzeln noch in einer Gruppe - Properties
-        else if (m_nFormsSelected + m_nControlsSelected == 0)   // keines der beiden sollte kleiner 0 sein !
-            bPropertiesAvailable = sal_False;   // keine Selektion -> keine Properties
-        else if (m_nFormsSelected * m_nControlsSelected != 0)
-            bPropertiesAvailable = sal_False;   // gemischte Selektion -> keine Properties
+            ;                                   // no properties for the root, neither for single nor for multi selection
+        else if ( m_nFormsSelected + m_nControlsSelected == 0 )   // none of the two should be less 0
+            ;                                   // no selection -> no properties
+        else if ( m_nFormsSelected * m_nControlsSelected != 0 )
+            ;                                   // mixed selection -> no properties
         else
-        {   // so, hier bin ich, wenn entweder nur Forms oder nur Controls selektiert sind
-           if (m_arrCurrentSelection.Count() == 1)
+        {   // either only forms, or only controls are selected
+            if (m_arrCurrentSelection.Count() == 1)
             {
                 if (m_nFormsSelected > 0)
                 {   // es ist genau eine Form selektiert
                     FmFormData* pFormData = (FmFormData*)m_arrCurrentSelection.GetObject(0)->GetUserData();
-                    xFormSelected = pFormData->GetFormIface();
-                    xInterfaceSelected = xFormSelected;
-                } else
+                    aSelection.insert( Reference< XInterface >( pFormData->GetFormIface(), UNO_QUERY ) );
+                }
+                else
                 {   // es ist genau ein Control selektiert (egal ob hidden oder normal)
                     FmEntryData* pEntryData = (FmEntryData*)m_arrCurrentSelection.GetObject(0)->GetUserData();
-                    xInterfaceSelected = pEntryData->GetElement();
-                    pFormShell->GetImpl()->setCurControl(xInterfaceSelected);
-                    bNeedSetCurControl = sal_False;
-
-                    if (pEntryData->GetParent())
-                        xFormSelected = ((FmFormData*)pEntryData->GetParent())->GetFormIface();
+
+                    aSelection.insert( Reference< XInterface >( pEntryData->GetElement(), UNO_QUERY ) );
                 }
-            } else
+            }
+            else
             {   // wir haben eine MultiSelection, also muessen wir ein MultiSet dafuer aufbauen
                 if (m_nFormsSelected > 0)
                 {   // ... nur Forms
                     // erstmal die PropertySet-Interfaces der Forms einsammeln
-                    Sequence< Reference< XPropertySet > > seqForms(m_nFormsSelected);
-                    Reference< XPropertySet > * pPropSets = seqForms.getArray();
-                    for (int i=0; i<m_nFormsSelected; i++)
+                    for ( sal_Int32 i = 0; i < m_nFormsSelected; ++i )
                     {
-                        FmFormData* pFormData = (FmFormData*)m_arrCurrentSelection.GetObject(i)->GetUserData();
-                        pPropSets[i] = pFormData->GetPropertySet();
+                        FmFormData* pFormData = (FmFormData*)m_arrCurrentSelection.GetObject((USHORT)i)->GetUserData();
+                        aSelection.insert( Reference< XInterface >( pFormData->GetPropertySet(), UNO_QUERY ) );
                     }
-                    // dann diese in ein MultiSet packen
-                    FmXMultiSet* pSelectionSet = new FmXMultiSet( seqForms );
-                    xInterfaceSelected = Reference< XInterface > ( (XPropertySet*)pSelectionSet );
                 }
                 else
                 {   // ... nur Controls
                     if (m_nHiddenControls == m_nControlsSelected)
                     {   // ein MultiSet fuer die Properties der hidden controls
-                        Sequence< Reference< XPropertySet > > seqHiddenControls(m_nHiddenControls);
-                        Reference< XPropertySet > * pPropSets = seqHiddenControls.getArray();
-                        FmEntryData* pParentData = ((FmEntryData*)m_arrCurrentSelection.GetObject(0)->GetUserData())->GetParent();
-                        for (int i=0; i<m_nHiddenControls; i++)
+                        for ( sal_Int32 i = 0; i < m_nHiddenControls; ++i )
                         {
-                            FmEntryData* pEntryData = (FmEntryData*)m_arrCurrentSelection.GetObject(i)->GetUserData();
-                            pPropSets[i] = pEntryData->GetPropertySet();
-
-                            if (pParentData && pParentData != pEntryData->GetParent())
-                                pParentData = NULL;
+                            FmEntryData* pEntryData = (FmEntryData*)m_arrCurrentSelection.GetObject((USHORT)i)->GetUserData();
+                            aSelection.insert( Reference< XInterface >( pEntryData->GetPropertySet(), UNO_QUERY ) );
                         }
-
-                        // dann diese in ein MultiSet packen
-                        FmXMultiSet* pSelectionSet = new FmXMultiSet( seqHiddenControls );
-                        xInterfaceSelected = Reference< XInterface > ( (XPropertySet*)pSelectionSet );
-                        // und der Shell als aktuelles Objekt anzeigen
-                        pFormShell->GetImpl()->setCurControl( xInterfaceSelected );
-                        bNeedSetCurControl = sal_False;
-
-                        if (pParentData)
-                            // alle hidden controls gehoeren zu einer Form
-                            xFormSelected = ((FmFormData*)pParentData)->GetFormIface();
                     }
                     else if (m_nHiddenControls == 0)
                     {   // nur normale Controls
-                        // ein MultiSet aus der MarkList der View aufbauen ...
-                        const SdrMarkList& mlMarked = pFormShell->GetFormView()->GetMarkedObjectList();
-                        FmXMultiSet* pSelectionSet = FmXMultiSet::Create( mlMarked );
-                        xInterfaceSelected = Reference< XInterface > ( (XPropertySet*)pSelectionSet );
-                        pFormShell->GetImpl()->setCurControl( xInterfaceSelected );
-                        bNeedSetCurControl = sal_False;
-
-                        // jetzt das Formular setzen
-                        sal_Bool bMixedWithFormControls;
-                        xFormSelected = pFormShell->GetImpl()->DetermineCurForm(mlMarked,bMixedWithFormControls);
-                    } else
-                        // gemischte Selektion aus hidden und normalen Controls -> keine Properties
-                        bPropertiesAvailable = sal_False;
+                        bSetSelectionAsMarkList = sal_True;
+                    }
                 }
             }

         }

-        // um das Setzen des current Controls kann sich die Shell kuemmern (da gibt es einige Feinheiten, die ich hier nicht
-        // neu implementieren moechte)
-        if (bNeedSetCurControl)
-            pFormShell->GetImpl()->DetermineSelection(pFormShell->GetFormView()->GetMarkedObjectList());
         // und dann meine Form und mein SelObject
-        pFormShell->GetImpl()->setSelObject(xInterfaceSelected);
-        pFormShell->GetImpl()->setCurForm(xFormSelected);
-
-        if (pFormShell->GetImpl()->IsPropBrwOpen() || bForce)
+        if ( bSetSelectionAsMarkList )
+            pFormShell->GetImpl()->setCurrentSelectionFromMark( pFormShell->GetFormView()->GetMarkedObjectList() );
+        else
+            pFormShell->GetImpl()->setCurrentSelection( aSelection );
+
+        if ( pFormShell->GetImpl()->IsPropBrwOpen() || bForce )
         {
             // und jetzt kann ich das Ganze dem PropertyBrowser uebergeben
-            FmInterfaceItem aInterfaceItem( SID_FM_SHOW_PROPERTY_BROWSER, xInterfaceSelected );
-            pFormShell->GetViewShell()->GetViewFrame()->GetDispatcher()->Execute( SID_FM_SHOW_PROPERTY_BROWSER, SFX_CALLMODE_ASYNCHRON,
-                &aInterfaceItem, 0L );
+            pFormShell->GetViewShell()->GetViewFrame()->GetDispatcher()->Execute( SID_FM_SHOW_PROPERTY_BROWSER, SFX_CALLMODE_ASYNCHRON );
         }
     }

@@ -1986,8 +1949,8 @@
             if (pCurrent->ISA(FmFormData))
             {
                 Reference< XForm >  xCurrentForm( static_cast< FmFormData* >( pCurrent )->GetFormIface() );
-                if (pFormShell->GetImpl()->getCurForm() == xCurrentForm)    // die Shell kennt die zu loeschende Form ?
-                    pFormShell->GetImpl()->setCurForm( NULL );              // -> wegnehmen ...
+                if ( pFormShell->GetImpl()->getCurrentForm() == xCurrentForm )  // die Shell kennt die zu loeschende Form ?
+                    pFormShell->GetImpl()->forgetCurrentForm();                 // -> wegnehmen ...
             }
             GetNavModel()->Remove(pCurrent, sal_True);
         }
@@ -2204,7 +2167,11 @@
             FmFormData* pSingleSelectionData = PTR_CAST( FmFormData, static_cast< FmEntryData* >( FirstSelected()->GetUserData() ) );
             DBG_ASSERT( pSingleSelectionData, "NavigatorTree::SynchronizeMarkList: invalid selected form!" );
             if ( pSingleSelectionData )
-                pFormShell->GetImpl()->setCurForm( pSingleSelectionData->GetFormIface() );
+            {
+                InterfaceBag aSelection;
+                aSelection.insert( Reference< XInterface >( pSingleSelectionData->GetFormIface(), UNO_QUERY ) );
+                pFormShell->GetImpl()->setCurrentSelection( aSelection );
+            }
         }
     }


handle_or_ignore needs to use insert_unique_handle instead of insert_handle; multiple instances of the same handle might be within a view when using inserter otherwise

--- viennagrid/storage/container_collection.hpp
+++ viennagrid/storage/container_collection.hpp
@@ -172,12 +172,12 @@

                 static void handle_or_ignore( container_collection_type & collection, const handle_type & handle )
                 {
-                    collection.get( viennagrid::meta::tag<value_type>() ).insert_handle(handle);
+                    collection.get( viennagrid::meta::tag<value_type>() ).insert_unique_handle(handle);
                 }

                 static void handle_or_ignore( container_collection_type & collection, handle_type & handle )
                 {
-                    collection.get( viennagrid::meta::tag<value_type>() ).insert_handle(handle);
+                    collection.get( viennagrid::meta::tag<value_type>() ).insert_unique_handle(handle);
                 }
             };


INTEGRATION: CWS cellbreak (1.6.154); FILE MERGED 2003/11/24 15:07:05 fme 1.6.154.3: #2109# Feature table row split - SetRowSplit should be recursive 2003/11/20 08:48:47 fme 1.6.154.2: #i2109# Feature - Table row split - new attribute 2003/11/14 10:05:27 fme 1.6.154.1: #i2109# Split table rows

--- sw/source/core/docnode/ndtbl1.cxx
+++ sw/source/core/docnode/ndtbl1.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: ndtbl1.cxx,v $
  *
- *  $Revision: 1.7 $
- *
- *  last change: $Author: rt $ $Date: 2003-12-01 17:02:29 $
+ *  $Revision: 1.8 $
+ *
+ *  last change: $Author: obo $ $Date: 2004-01-13 11:09:05 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -84,6 +84,12 @@
 #endif
 #ifndef _FMTFSIZE_HXX //autogen
 #include <fmtfsize.hxx>
+#endif
+#ifndef _FMTTSPLT_HXX //autogen
+#include <fmtlsplt.hxx>
+#endif
+#ifndef _FMTROWSPLT_HXX //autogen
+#include <fmtrowsplt.hxx>
 #endif
 #ifndef _TABCOL_HXX //autogen
 #include <tabcol.hxx>
@@ -284,7 +290,7 @@
     return TRUE;
 }

-void lcl_CollectLines( SvPtrarr &rArr, const SwCursor& rCursor )
+void lcl_CollectLines( SvPtrarr &rArr, const SwCursor& rCursor, bool bRemoveLines )
 {
     //Zuerst die selektierten Boxen einsammeln.
     SwSelBoxes aBoxes;
@@ -304,19 +310,22 @@
     const _FndBox *pTmp = &aFndBox;
     ::_FindBox( pTmp, &aPara );

-    //Jetzt die Lines entfernen, die von einer gemeinsamen uebergeordneten Line
-    //erfasst werden.
-    for ( USHORT i = 0; i < rArr.Count(); ++i )
-    {
-        SwTableLine *pUpLine = (SwTableLine*)rArr[i];
-        for ( USHORT k = 0; k < rArr.Count(); ++k )
-        {
-            if ( k != i && ::lcl_IsAnLower( pUpLine, (SwTableLine*)rArr[k] ) )
-            {
-                rArr.Remove( k );
-                if ( k <= i )
-                    --i;
-                --k;
+    // Remove lines, that have a common superordinate row.
+    // (Not for row split)
+    if ( bRemoveLines )
+    {
+        for ( USHORT i = 0; i < rArr.Count(); ++i )
+        {
+            SwTableLine *pUpLine = (SwTableLine*)rArr[i];
+            for ( USHORT k = 0; k < rArr.Count(); ++k )
+            {
+                if ( k != i && ::lcl_IsAnLower( pUpLine, (SwTableLine*)rArr[k] ) )
+                {
+                    rArr.Remove( k );
+                    if ( k <= i )
+                        --i;
+                    --k;
+                }
             }
         }
     }
@@ -324,9 +333,7 @@

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

-void lcl_ProcessBoxSize( SvPtrarr &rFmtCmp, SwTableBox *pBox, const SwFmtFrmSize &rNew );
-
-void lcl_ProcessRowSize( SvPtrarr &rFmtCmp, SwTableLine *pLine, const SwFmtFrmSize &rNew )
+void lcl_ProcessRowAttr( SvPtrarr& rFmtCmp, SwTableLine* pLine, const SfxPoolItem& rNew )
 {
     SwFrmFmt *pNewFmt;
     if ( 0 != (pNewFmt = SwTblFmtCmp::FindNewFmt( rFmtCmp, pLine->GetFrmFmt(), 0 )))
@@ -338,6 +345,26 @@
         pNew->SetAttr( rNew );
         rFmtCmp.Insert( new SwTblFmtCmp( pOld, pNew, 0 ), rFmtCmp.Count());
     }
+}
+
+//-----------------------------------------------------------------------------
+
+void lcl_ProcessBoxSize( SvPtrarr &rFmtCmp, SwTableBox *pBox, const SwFmtFrmSize &rNew );
+
+void lcl_ProcessRowSize( SvPtrarr &rFmtCmp, SwTableLine *pLine, const SwFmtFrmSize &rNew )
+{
+    lcl_ProcessRowAttr( rFmtCmp, pLine, rNew );
+/*
+    SwFrmFmt *pNewFmt;
+    if ( 0 != (pNewFmt = SwTblFmtCmp::FindNewFmt( rFmtCmp, pLine->GetFrmFmt(), 0 )))
+        pLine->ChgFrmFmt( (SwTableLineFmt*)pNewFmt );
+    else
+    {
+        SwFrmFmt *pOld = pLine->GetFrmFmt();
+        SwFrmFmt *pNew = pLine->ClaimFrmFmt();
+        pNew->SetAttr( rNew );
+        rFmtCmp.Insert( new SwTblFmtCmp( pOld, pNew, 0 ), rFmtCmp.Count());
+    }                                           */
     SwTableBoxes &rBoxes = pLine->GetTabBoxes();
     for ( USHORT i = 0; i < rBoxes.Count(); ++i )
         ::lcl_ProcessBoxSize( rFmtCmp, rBoxes[i], rNew );
@@ -357,6 +384,69 @@
     }
 }

+//-----------------------------------------------------------------------------
+
+/******************************************************************************
+ *              void SwDoc::SetRowSplit()
+ ******************************************************************************/
+void SwDoc::SetRowSplit( const SwCursor& rCursor, const SwFmtRowSplit &rNew )
+{
+    SwTableNode* pTblNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode();
+    if( pTblNd )
+    {
+        SvPtrarr aRowArr( 25, 50 ); //Zum sammeln Lines.
+        ::lcl_CollectLines( aRowArr, rCursor, false );
+
+        if( aRowArr.Count() )
+        {
+            if( DoesUndo() )
+            {
+                ClearRedo();
+                AppendUndo( new SwUndoAttrTbl( *pTblNd ));
+            }
+
+            SvPtrarr aFmtCmp( Max( BYTE(255), BYTE(aRowArr.Count()) ), 255 );
+
+            for( USHORT i = 0; i < aRowArr.Count(); ++i )
+                ::lcl_ProcessRowAttr( aFmtCmp, (SwTableLine*)aRowArr[i], rNew );
+
+            SwTblFmtCmp::Delete( aFmtCmp );
+            SetModified();
+        }
+    }
+}
+
+
+/******************************************************************************
+ *               SwTwips SwDoc::GetRowSplit() const
+ ******************************************************************************/
+void SwDoc::GetRowSplit( const SwCursor& rCursor, SwFmtRowSplit *& rpSz ) const
+{
+    rpSz = 0;
+
+    SwTableNode* pTblNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode();
+    if( pTblNd )
+    {
+        SvPtrarr aRowArr( 25, 50 ); //Zum sammeln der Lines.
+        ::lcl_CollectLines( aRowArr, rCursor, false );
+
+        if( aRowArr.Count() )
+        {
+            rpSz = &(SwFmtRowSplit&)((SwTableLine*)aRowArr[0])->
+                                                GetFrmFmt()->GetRowSplit();
+
+            for ( USHORT i = 1; i < aRowArr.Count() && rpSz; ++i )
+            {
+                if ( (*rpSz).GetValue() != ((SwTableLine*)aRowArr[i])->GetFrmFmt()->GetRowSplit().GetValue() )
+                    rpSz = 0;
+            }
+            if ( rpSz )
+                rpSz = new SwFmtRowSplit( *rpSz );
+        }
+    }
+}
+
+
 /******************************************************************************
  *              void SwDoc::SetRowHeight( SwTwips nNew )
  ******************************************************************************/
@@ -366,7 +456,7 @@
     if( pTblNd )
     {
         SvPtrarr aRowArr( 25, 50 ); //Zum sammeln Lines.
-        ::lcl_CollectLines( aRowArr, rCursor );
+        ::lcl_CollectLines( aRowArr, rCursor, true );

         if( aRowArr.Count() )
         {
@@ -398,7 +488,7 @@
     if( pTblNd )
     {
         SvPtrarr aRowArr( 25, 50 ); //Zum sammeln der Lines.
-        ::lcl_CollectLines( aRowArr, rCursor );
+        ::lcl_CollectLines( aRowArr, rCursor, true );

         if( aRowArr.Count() )
         {
@@ -423,7 +513,7 @@
     if( pTblNd )
     {
         SvPtrarr aRowArr( 25, 50 ); //Zum sammeln der Lines.
-        ::lcl_CollectLines( aRowArr, rCursor );
+        ::lcl_CollectLines( aRowArr, rCursor, true );

         if( 1 < aRowArr.Count() )
         {
@@ -472,7 +562,7 @@
     if( pTblNd )
     {
         SvPtrarr aRowArr( 25, 50 ); //Zum sammeln Lines.
-        ::lcl_CollectLines( aRowArr, rCursor );
+        ::lcl_CollectLines( aRowArr, rCursor, true );

         if( aRowArr.Count() )
         {
@@ -486,6 +576,8 @@

             for( USHORT i = 0; i < aRowArr.Count(); ++i )
             {
+                ::lcl_ProcessRowAttr( aFmtCmp, (SwTableLine*)aRowArr[i], rNew );
+/*
                 SwTableLine *pLine = (SwTableLine*)aRowArr[i];

                 SwFrmFmt *pNewFmt;
@@ -498,7 +590,7 @@
                     SwFrmFmt *pNew = pLine->ClaimFrmFmt();
                     pNew->SetAttr( rNew );
                     aFmtCmp.Insert( new SwTblFmtCmp( pOld, pNew, 0 ), aFmtCmp.Count());
-                }
+                }*/
             }

             SwTblFmtCmp::Delete( aFmtCmp );
@@ -517,7 +609,7 @@
     if( pTblNd )
     {
         SvPtrarr aRowArr( 25, 50 ); //Zum sammeln Lines.
-        ::lcl_CollectLines( aRowArr, rCursor );
+        ::lcl_CollectLines( aRowArr, rCursor, true );

         if( aRowArr.Count() )
         {


aura: Keep using the non-aura RWHV stuff for touchui.

BUG=none
TEST=manually

Review URL: http://codereview.chromium.org/8364021

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@106592 0039d316-1c4b-4281-b951-d872f2087c98

--- chrome/browser/ui/views/tab_contents/native_tab_contents_container_aura.cc
+++ chrome/browser/ui/views/tab_contents/native_tab_contents_container_aura.cc
@@ -139,7 +139,10 @@
 // static
 NativeTabContentsContainer* NativeTabContentsContainer::CreateNativeContainer(
     TabContentsContainer* container) {
-  // return new NativeTabContentsContainerViews(container);
+#if defined(TOUCH_UI)
+  return new NativeTabContentsContainerViews(container);
+#else
   // TODO(beng): switch this over once we're using this container.
   return new NativeTabContentsContainerAura(container);
+#endif
 }


Replace SvUShortsSort with std::set in dbg_lay.cxx. LGPLv3+/MPL.

--- sw/source/core/layout/dbg_lay.cxx
+++ sw/source/core/layout/dbg_lay.cxx
@@ -117,7 +117,6 @@

 #ifndef _SVSTDARR_HXX
 #define _SVSTDARR_USHORTS
-#define _SVSTDARR_USHORTSSORT
 #include <svl/svstdarr.hxx>
 #endif

@@ -151,7 +150,7 @@
 class SwImplProtocol
 {
     SvFileStream *pStream;      // Ausgabestream
-    SvUShortsSort *pFrmIds;     // welche FrmIds sollen aufgezeichnet werden ( NULL == alle )
+    std::set<sal_uInt16> *pFrmIds;      // welche FrmIds sollen aufgezeichnet werden ( NULL == alle )
     std::vector<long> aVars;    // Variables
     ByteString aLayer;          // Einrueckung der Ausgabe ("  " pro Start/End)
     sal_uInt16 nTypes;              // welche Typen sollen aufgezeichnet werden
@@ -328,6 +327,7 @@
         pStream->Close();
         delete pStream;
     }
+    pFrmIds->clear();
     delete pFrmIds;
     aVars.clear();
 }
@@ -349,6 +349,7 @@
         if( "[frmid" == aTmp )      // Bereich FrmIds
         {
             nInitFile = 1;
+            pFrmIds->clear();
             delete pFrmIds;
             pFrmIds = NULL;         // Default: Alle Frames aufzeichnen
         }
@@ -568,7 +569,7 @@
         {
             case 1: InsertFrm( nId ); break;
             case 2: DeleteFrm( nId ); break;
-            case 3: delete pFrmIds; pFrmIds = NULL; break;
+            case 3: pFrmIds->clear(); delete pFrmIds; pFrmIds = NULL; break;
             case 4: delete pStream; pStream = NULL; break;
         }
         return;
@@ -576,7 +577,7 @@
     if( !pStream && !NewStream() )
         return; // Immer noch kein Stream

-    if( pFrmIds && !pFrmIds->Seek_Entry( sal_uInt16(lcl_GetFrameId( pFrm )) ) )
+    if( pFrmIds && !pFrmIds->count( sal_uInt16(lcl_GetFrameId( pFrm )) ) )
         return; // gehoert nicht zu den gewuenschten FrmIds

     if( !(pFrm->GetType() & nTypes) )
@@ -735,10 +736,10 @@
 sal_Bool SwImplProtocol::InsertFrm( sal_uInt16 nId )
 {
     if( !pFrmIds )
-        pFrmIds = new SvUShortsSort(5,5);
-    if( pFrmIds->Seek_Entry( nId ) )
+        pFrmIds = new std::set<sal_uInt16>;
+    if( pFrmIds->count( nId ) )
         return sal_False;
-    pFrmIds->Insert( nId );
+    pFrmIds->insert( nId );
     return sal_True;
 }

@@ -748,11 +749,11 @@
  * --------------------------------------------------*/
 sal_Bool SwImplProtocol::DeleteFrm( sal_uInt16 nId )
 {
-    sal_uInt16 nPos;
-    if( !pFrmIds || !pFrmIds->Seek_Entry( nId, &nPos ) )
+    if( !pFrmIds )
         return sal_False;
-    pFrmIds->Remove( nPos );
-    return sal_True;
+    if ( pFrmIds->erase(nId) )
+        return sal_True;
+    return sal_False;
 }

 /*--------------------------------------------------


Fixed name of constructor

Fixed name of constructor

--- ColorCoordinator.cpp
+++ ColorCoordinator.cpp
@@ -1,6 +1,6 @@
 #include "ColorCoordinator.h"

-ColorCoordinator::olorCoordinator() {
+ColorCoordinator::ColorCoordinator() {
 	_red_mgr = ColorManager();
 	_grn_mgr = ColorManager();
 	_blu_mgr = ColorManager();


INTEGRATION: CWS swformatcells (1.28.66); FILE MERGED 2004/03/03 09:02:58 od 1.28.66.2: RESYNC: (1.28-1.31); FILE MERGED 2004/03/02 15:22:46 od 1.28.66.1: #106629# <SwFlowFrm::CalcLowerSpace(..)> - implementation 	 <SwFlowFrm::CalcUpperSpace(..)> - corrections

--- sw/source/core/layout/flowfrm.cxx
+++ sw/source/core/layout/flowfrm.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: flowfrm.cxx,v $
  *
- *  $Revision: 1.33 $
+ *  $Revision: 1.34 $
  *
- *  last change: $Author: obo $ $Date: 2004-03-17 12:48:53 $
+ *  last change: $Author: kz $ $Date: 2004-03-23 11:25:05 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -124,6 +124,10 @@
 #include "section.hxx"
 #include "dbg_lay.hxx"
 #include "lineinfo.hxx"
+// OD 2004-03-02 #106629#
+#ifndef _FMTCLBL_HXX
+#include <fmtclbl.hxx>
+#endif

 BOOL SwFlowFrm::bMoveBwdJump = FALSE;

@@ -1378,8 +1382,24 @@
             pPre = pSect->FindLastCntnt();
             // If the last content is in a table _inside_ the section,
             // take the table herself.
-            if( pPre && pPre->IsInTab() && !pSect->IsInTab() )
-                pPre = pPre->FindTabFrm();
+            // OD 2004-02-18 #106629# - correction:
+            // Check directly, if table is inside table, instead of indirectly
+            // by checking, if section isn't inside a table
+            if ( pPre && pPre->IsInTab() )
+            {
+                const SwTabFrm* pTableFrm = pPre->FindTabFrm();
+                if ( pSect->IsAnLower( pTableFrm ) )
+                {
+                    pPre = pTableFrm;
+                }
+            }
+            // OD 2004-02-18 #106629# correction: skip hidden text frames
+            while ( pPre &&
+                    pPre->IsTxtFrm() &&
+                    static_cast<const SwTxtFrm*>(pPre)->IsHiddenNow() )
+            {
+                pPre = pPre->GetPrev();
+            }
         }
         break;
     } while( pPre );
@@ -1522,6 +1542,44 @@

     delete pAccess;
     return nUpper;
+}
+
+/** calculation of lower space
+
+    OD 2004-03-02 #106629#
+
+    @author OD
+*/
+SwTwips SwFlowFrm::CalcLowerSpace( const SwBorderAttrs* _pAttrs ) const
+{
+    SwTwips nLowerSpace = 0;
+
+    SwBorderAttrAccess* pAttrAccess = 0L;
+    if ( !_pAttrs )
+    {
+        pAttrAccess = new SwBorderAttrAccess( SwFrm::GetCache(), &rThis );
+        _pAttrs = pAttrAccess->Get();
+    }
+
+    sal_Bool bCommonBorder = sal_True;
+    if ( rThis.IsInSct() && rThis.GetUpper()->IsColBodyFrm() )
+    {
+        const SwSectionFrm* pSectFrm = rThis.FindSctFrm();
+        bCommonBorder = pSectFrm->GetFmt()->GetBalancedColumns().GetValue();
+    }
+    nLowerSpace = bCommonBorder ?
+                  _pAttrs->GetBottomLine( &rThis ) :
+                  _pAttrs->CalcBottomLine();
+
+    if ( rThis.GetShell()->GetDoc()->IsAddParaSpacingToTableCells() &&
+         rThis.IsInTab() && !rThis.GetIndNext() )
+    {
+        nLowerSpace += _pAttrs->GetULSpace().GetLower();
+    }
+
+    delete pAttrAccess;
+
+    return nLowerSpace;
 }

 /*************************************************************************


INTEGRATION: CWS swselection (1.52.82); FILE MERGED 2007/03/21 08:20:38 ama 1.52.82.2: RESYNC: (1.52-1.53); FILE MERGED 2007/01/25 09:25:36 ama 1.52.82.1: Fix #i73849#: Preparation for better selection handling

--- sw/source/core/layout/trvlfrm.cxx
+++ sw/source/core/layout/trvlfrm.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: trvlfrm.cxx,v $
  *
- *  $Revision: 1.54 $
+ *  $Revision: 1.55 $
  *
- *  last change: $Author: rt $ $Date: 2007-04-25 09:09:05 $
+ *  last change: $Author: rt $ $Date: 2007-04-26 09:39:16 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -2019,6 +2019,11 @@

 void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, BOOL bIsTblMode )
 {
+    const SwNodes &rNds = GetFmt()->GetDoc()->GetNodes();
+    SwPosition *pStartPos = rCrsr.Start(),
+               *pEndPos   = rCrsr.GetPoint() == pStartPos ?
+                            rCrsr.GetMark() : rCrsr.GetPoint();
+
     ViewShell *pSh = GetShell();

 // --> FME 2004-06-08 #i12836# enhanced pdf
@@ -2026,13 +2031,30 @@
                            pSh->VisArea() :
                            Frm() );
 // <--
-    const SwNodes &rNds = GetFmt()->GetDoc()->GetNodes();
+    if( !pStartPos->nNode.GetNode().IsCntntNode() ||
+        !pStartPos->nNode.GetNode().GetCntntNode()->GetFrm() ||
+        ( pStartPos->nNode != pEndPos->nNode &&
+          ( !pEndPos->nNode.GetNode().IsCntntNode() ||
+            !pEndPos->nNode.GetNode().GetCntntNode()->GetFrm() ) ) )
+    {
+        /* For SelectAll we will need something like this later on...
+        const SwFrm* pPageFrm = GetLower();
+        while( pPageFrm )
+        {
+            SwRect aTmp( pPageFrm->Prt() );
+            aTmp.Pos() += pPageFrm->Frm().Pos();
+            Sub( aRegion, aTmp );
+            pPageFrm = pPageFrm->GetNext();
+        }
+        aRegion.Invert();
+        rCrsr.Remove( 0, rCrsr.Count() );
+        rCrsr.Insert( &aRegion, 0 );
+        */
+        return;
+    }

     //Erstmal die CntntFrms zum Start und End besorgen, die brauch ich auf
     //jedenfall.
-    SwPosition *pStartPos = rCrsr.Start(),
-               *pEndPos   = rCrsr.GetPoint() == pStartPos ?
-                                rCrsr.GetMark() : rCrsr.GetPoint();
     const SwCntntFrm *pStartFrm = rNds[ pStartPos->nNode ]->
         GetCntntNode()->GetFrm( &rCrsr.GetSttPos(), pStartPos );


Silence warning due to unused function.

Silence warning due to unused function.

sql/field.cc:
  Function is only used if replication is compiled in.

--- sql/field.cc
+++ sql/field.cc
@@ -6644,6 +6644,7 @@
   Field *field;
 };

+#ifdef HAVE_REPLICATION
 static bool
 check_field_for_37426(const void *param_arg)
 {
@@ -6655,7 +6656,7 @@
                        param->field->row_pack_length()));
   return param->field->row_pack_length() > 255;
 }
-
+#endif

 int Field_string::compatible_field_size(uint field_metadata,
                                         const Relay_log_info *rli_arg)


Update eample

Update eample

--- example/instantiation.hh
+++ example/instantiation.hh
@@ -6,11 +6,10 @@

 use package\Package;

-$params = shape(
+$package = Package::fromOptions(shape(
     'namespace' => 'package\\examples\\classes\\',
     'packageDirectory' => realpath(__DIR__ . '/src')
-);
-$package = new Package($params);
+));

 foreach ($package->getClassFiles() as $class) {
     $instance = $class->instantiate();


fdo#40102 show full footnote text in index tooltip

Change-Id: I35acdaf4f62df7a1d375aed663c270e78ea70779

--- sw/source/core/txtnode/atrftn.cxx
+++ sw/source/core/txtnode/atrftn.cxx
@@ -172,8 +172,16 @@
         if( !pCNd )
             pCNd = aIdx.GetNodes().GoNext( &aIdx );

-        if( pCNd->IsTxtNode() )
+        if( pCNd->IsTxtNode() ) {
             rStr = ((SwTxtNode*)pCNd)->GetExpandTxt();
+
+            ++aIdx;
+            while ( !aIdx.GetNode().IsEndNode() ) {
+                if ( aIdx.GetNode().IsTxtNode() )
+                    rStr += OUString("  ") + ((SwTxtNode*)(aIdx.GetNode().GetTxtNode()))->GetExpandTxt();
+                ++aIdx;
+            }
+        }
     }
 }


Portability fix. Why not to use UINT_MAX32 here?

--- sql/field.cc
+++ sql/field.cc
@@ -1860,9 +1860,9 @@
       set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
       error= 1;
     }
-    else if (nr > (double) (ulong) ~0L)
-    {
-      res=(int32) (uint32) ~0L;
+    else if (nr > (double) UINT_MAX32)
+    {
+      res= UINT_MAX32;
       set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
       error= 1;
     }


INTEGRATION: CWS ooo19126 (1.66.184); FILE MERGED 2005/09/05 13:41:20 rt 1.66.184.1: #i54170# Change license header: remove SISSL

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


Double-free Cocoa fix: Redux

Double-free Cocoa fix: Redux

Summary: Need get_true_type to evaluate string status

Reviewed By: mcslee

Other Notes: Submission from Andrew McGeachie

git-svn-id: 8d8e29b1fb681c884914062b88f3633e3a187774@665362 13f79535-47bb-0310-9956-ffa450edef68

--- compiler/cpp/src/generate/t_cocoa_generator.cc
+++ compiler/cpp/src/generate/t_cocoa_generator.cc
@@ -486,7 +486,7 @@
         // is now retaining it
         if (type_can_be_null((*f_iter)->get_type())) {
           // deserialized strings are autorelease, so don't release them
-          if (!((*f_iter)->get_type()->is_string())) {
+          if (!(get_true_type((*f_iter)->get_type())->is_string())) {
             indent(out) << "[fieldValue release];" << endl;
           }
         }


Fix for BUG#2452 "Empty LOAD DATA INFILE failes with the master in 3.23.x": do not write the Execute_load_log_event if there was no Create_file_log_event (empty file).

--- sql/slave.cc
+++ sql/slave.cc
@@ -2840,6 +2840,14 @@
       if (unlikely(!num_bytes)) /* eof */
       {
        send_ok(net); /* 3.23 master wants it */
+       /*
+         If we wrote Create_file_log_event, then we need to write
+         Execute_load_log_event. If we did not write Create_file_log_event,
+         then this is an empty file and we can just do as if the LOAD DATA
+         INFILE had not existed, i.e. write nothing.
+       */
+       if (unlikely(cev_not_written))
+         break;
        Execute_load_log_event xev(thd,0,0);
        xev.log_pos = mi->master_log_pos;
        if (unlikely(mi->rli.relay_log.append(&xev)))


[共通] fix BuildClosedLineString()

[共通] fix BuildClosedLineString()

--- Siv3D/src/Siv3D/Renderer2D/Vertex2DBuilder.cpp
+++ Siv3D/src/Siv3D/Renderer2D/Vertex2DBuilder.cpp
@@ -1043,7 +1043,8 @@
 				const Float2 p2 = buf2[1];
 				const Float2 line = p1 - p0;
 				const Float2 normal = Float2{ -line.y, line.x }.normalized();
-				const Float2 tangent = ((p2 - p1).normalized() + (p1 - p0).normalized()).normalized();
+				const Float2 v = (p2 - p1).normalized() + (p1 - p0).normalized();
+				const Float2 tangent = (v.lengthSq() > 0.001f) ? v.normalized() : (p2 - p0).normalized();
 				const Float2 miter = Float2{ -tangent.y, tangent.x };
 				const float length = thicknessHalf / miter.dot(normal);
 				const Float2 result0 = p1 + miter * length;
@@ -1060,7 +1061,8 @@
 				const Float2 p2 = buf2[i + 2];
 				const Float2 line = p1 - p0;
 				const Float2 normal = Float2{ -line.y, line.x }.normalized();
-				const Float2 tangent = ((p2 - p1).normalized() + (p1 - p0).normalized()).normalized();
+				const Float2 v = (p2 - p1).normalized() + (p1 - p0).normalized();
+				const Float2 tangent = (v.lengthSq() > 0.001f) ? v.normalized() : (p2 - p0).normalized();
 				const Float2 miter = Float2{ -tangent.y, tangent.x };
 				const float length = thicknessHalf / miter.dot(normal);
 				const Float2 result0 = p1 + miter * length;
@@ -1077,7 +1079,8 @@
 				const Float2 p2 = buf2[0];
 				const Float2 line = p1 - p0;
 				const Float2 normal = Float2{ -line.y, line.x }.normalized();
-				const Float2 tangent = ((p2 - p1).normalized() + (p1 - p0).normalized()).normalized();
+				const Float2 v = (p2 - p1).normalized() + (p1 - p0).normalized();
+				const Float2 tangent = (v.lengthSq() > 0.001f) ? v.normalized() : (p2 - p0).normalized();
 				const Float2 miter = Float2{ -tangent.y, tangent.x };
 				const float length = thicknessHalf / miter.dot(normal);
 				const Float2 result0 = p1 + miter * length;


#80863#: online-spelling in the page margin

--- sw/source/core/txtnode/txtedt.cxx
+++ sw/source/core/txtnode/txtedt.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: txtedt.cxx,v $
  *
- *  $Revision: 1.6 $
- *
- *  last change: $Author: jp $ $Date: 2000-11-20 16:22:08 $
+ *  $Revision: 1.7 $
+ *
+ *  last change: $Author: ama $ $Date: 2000-11-30 14:40:11 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -793,19 +793,21 @@
                 if( pEndFrm != pStartFrm )
                 {
                     bSameFrame = FALSE;
-                    aTmp.Left( pStartFrm->Frm().Left() );
-                    aTmp.Right( pStartFrm->Frm().Right() );
-                    aTmp.Bottom( pStartFrm->Frm().Bottom() );
-                    aRect.Top( pEndFrm->Frm().Top() );
-                    aRect.Left( pEndFrm->Frm().Left() );
-                    aRect.Right( pEndFrm->Frm().Right() );
+                    SwRect aStFrm( pStartFrm->PaintArea() );
+                    aTmp.Left( aStFrm.Left() );
+                    aTmp.Right( aStFrm.Right() );
+                    aTmp.Bottom( aStFrm.Bottom() );
+                    aStFrm = pEndFrm->PaintArea();
+                    aRect.Top( aStFrm.Top() );
+                    aRect.Left( aStFrm.Left() );
+                    aRect.Right( aStFrm.Right() );
                     aRect.Union( aTmp );
                     while( TRUE )
                     {
                         pStartFrm = pStartFrm->GetFollow();
                         if( pStartFrm == pEndFrm )
                             break;
-                        aRect.Union( pStartFrm->Frm() );
+                        aRect.Union( pStartFrm->PaintArea() );
                     }
                 }
             }
@@ -815,8 +817,9 @@
                     aRect.Left( aTmp.Left() );
                 else
                 {
-                    aRect.Left( pStartFrm->Frm().Left() );
-                    aRect.Right( pStartFrm->Frm().Right() );
+                    SwRect aStFrm( pStartFrm->PaintArea() );
+                    aRect.Left( aStFrm.Left() );
+                    aRect.Right( aStFrm.Right() );
                     aRect.Top( aTmp.Top() );
                 }
                 if( aTmp.Height() > aRect.Height() )


filling the event creation time in the EventData struct before invoking component data processing required to set the ESD timestamp also when running in AliSimulation/Reconstruction

--- HLT/BASE/AliHLTTask.cxx
+++ HLT/BASE/AliHLTTask.cxx
@@ -36,6 +36,7 @@
 #include <cassert>
 #include <iostream>
 #include <string>
+#include <ctime>
 #include "AliHLTTask.h"
 #include "AliHLTConfiguration.h"
 #include "AliHLTComponent.h"
@@ -560,6 +561,7 @@
       AliHLTComponent::FillEventData(evtData);
       if (eventNo>=0)
 	evtData.fEventID=(AliHLTEventID_t)eventNo;
+      evtData.fEventCreation_s=static_cast<AliHLTUInt32_t>(time(NULL));
       AliHLTComponentTriggerData trigData;
       trigData.fStructSize=sizeof(trigData);
       trigData.fDataSize=0;


testing bk/make for Monty

testing bk/make for Monty

--- sql/slave.cc
+++ sql/slave.cc
@@ -169,7 +169,7 @@
   tables.name = tables.real_name = (char*)table_name;
   tables.lock_type = TL_WRITE;
   thd->proc_info = "Opening master dump table";
-  if(open_tables(thd, &tables) || !tables.table)
+  if(open_ltable(thd, &tables) || !tables.table)
     {
       // open tables will send the error
       sql_print_error("create_table_from_dump: could not open created table");