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

2022-06-01 Thread Caolán McNamara (via logerrit)
 binaryurp/source/reader.cxx   |2 +-
 sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 1fe266c22fb7d277ae612cffd6cc89ef4dcb4269
Author: Caolán McNamara 
AuthorDate: Wed Jun 1 11:57:30 2022 +0100
Commit: Caolán McNamara 
CommitDate: Wed Jun 1 16:02:34 2022 +0200

Resolves: tdf#149408 inspector crash with a writer OLE inside calc

toplevel isn't a SwDocShell at this point, its a ScDocShell

Change-Id: I3aa3c72e494cf6c0ceff1286a7026ca01385ab8e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135236
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx 
b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
index 46b1486f5e57..b043852d309e 100644
--- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
+++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
@@ -64,7 +64,7 @@ 
WriterInspectorTextPanel::WriterInspectorTextPanel(weld::Widget* pParent)
 : InspectorTextPanel(pParent)
 , m_nParIdx(0)
 {
-SwDocShell* pDocSh = static_cast(SfxObjectShell::Current());
+SwDocShell* pDocSh = dynamic_cast(SfxObjectShell::Current());
 m_pShell = pDocSh ? pDocSh->GetWrtShell() : nullptr;
 if (m_pShell)
 {
commit 7d8d65d850cdd0bdaa84e9cff9f8c1654c61ddb4
Author: Stephan Bergmann 
AuthorDate: Wed Jun 1 10:34:07 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Jun 1 16:02:19 2022 +0200

The return value of XConnection::read is guaranteed to be non-negative

...so use o3tl::make_unsigned when comparing it against an expression of
unsigned integer type, instead of casting that expression to a signed type

Change-Id: Id2bea3010bf67bdaeb0766b20baecba195bf0181
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135227
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/binaryurp/source/reader.cxx b/binaryurp/source/reader.cxx
index 7cabbd41c8a1..cbd18f1d8252 100644
--- a/binaryurp/source/reader.cxx
+++ b/binaryurp/source/reader.cxx
@@ -71,7 +71,7 @@ css::uno::Sequence< sal_Int8 > read(
 if (n == 0 && eofOk) {
 return css::uno::Sequence< sal_Int8 >();
 }
-if (n != static_cast< sal_Int32 >(size)) {
+if (o3tl::make_unsigned(n) != size) {
 throw css::io::IOException(
 "binaryurp::Reader: premature end of input");
 }


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

2014-02-07 Thread Stephan Bergmann
 binaryurp/source/bridge.cxx  |   16 
 binaryurp/source/reader.cxx  |1 +
 binaryurp/source/writer.cxx  |1 +
 sw/source/ui/dochdl/swdtflvr.cxx |4 ++--
 4 files changed, 16 insertions(+), 6 deletions(-)

New commits:
commit f6245d5bcb18dff2721d5975cd84711559cefe65
Author: Stephan Bergmann 
Date:   Fri Feb 7 14:28:07 2014 +0100

fdo#56511 Don't unduly delay Bridge termination

When terminate is called from the Reader or Writer thread, the final 
terminate
was delayed until disposal of the BridgeFactory, as an unfortunate 
consequence
of always trying to join on the Reader and Writer.  Instead, forgo the join 
in
such a case and rely on the underlying osl::Thread becoming detached after
calling termiante.

Change-Id: Ifba788c4d0d2e9b14b4f7f6b5f0f1380b712ce36

diff --git a/binaryurp/source/bridge.cxx b/binaryurp/source/bridge.cxx
index cb69b0c..63cc9a7 100644
--- a/binaryurp/source/bridge.cxx
+++ b/binaryurp/source/bridge.cxx
@@ -255,10 +255,18 @@ void Bridge::terminate(bool final) {
 osl::MutexGuard g2(mutex_);
 tp = threadPool_;
 threadPool_ = 0;
-assert(!(reader_.is() && isThread(reader_.get(;
-std::swap(reader_, r);
-assert(!(writer_.is() && isThread(writer_.get(;
-std::swap(writer_, w);
+if (reader_.is()) {
+if (!isThread(reader_.get())) {
+r = reader_;
+}
+reader_.clear();
+}
+if (writer_.is()) {
+if (!isThread(writer_.get())) {
+w = writer_;
+}
+writer_.clear();
+}
 state_ = STATE_FINAL;
 }
 assert(!(r.is() && w.is()));
diff --git a/binaryurp/source/reader.cxx b/binaryurp/source/reader.cxx
index 17a8863..4402888 100644
--- a/binaryurp/source/reader.cxx
+++ b/binaryurp/source/reader.cxx
@@ -128,6 +128,7 @@ void Reader::execute() {
 SAL_WARN("binaryurp", "caught C++ exception '" << e.what() << '\'');
 }
 bridge_->terminate(false);
+bridge_.clear();
 }
 
 void Reader::readMessage(Unmarshal & unmarshal) {
diff --git a/binaryurp/source/writer.cxx b/binaryurp/source/writer.cxx
index 3d5c199..edcb0f5 100644
--- a/binaryurp/source/writer.cxx
+++ b/binaryurp/source/writer.cxx
@@ -177,6 +177,7 @@ void Writer::execute() {
 OSL_TRACE(OSL_LOG_PREFIX "caught C++ exception '%s'", e.what());
 }
 bridge_->terminate(false);
+bridge_.clear();
 }
 
 void Writer::sendRequest(
commit d4b5a9ead177579c7d8091881da91d6766fd8ff1
Author: Stephan Bergmann 
Date:   Fri Feb 7 14:24:28 2014 +0100

sal_Bool -> bool

Change-Id: Ia4309b93518bc9625d02a728edc57606d6b715fb

diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index f0d7f9d..82e93fb 100644
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -2356,7 +2356,7 @@ bool SwTransferable::_PasteGrf( TransferableDataHelper& 
rData, SwWrtShell& rSh,
 SfxItemSet aSet( rSh.GetAttrPool(), RES_URL, RES_URL );
 rSh.GetFlyFrmAttr( aSet );
 SwFmtURL aURL( (SwFmtURL&)aSet.Get( RES_URL ) );
-aURL.SetURL( aBkmk.GetURL(), sal_False );
+aURL.SetURL( aBkmk.GetURL(), false );
 aSet.Put( aURL );
 rSh.SetFlyFrmAttr( aSet );
 }
@@ -2380,7 +2380,7 @@ bool SwTransferable::_PasteGrf( TransferableDataHelper& 
rData, SwWrtShell& rSh,
 }
 default:
 {
-nRet = 0;
+nRet = false;
 break;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits