[Libreoffice-commits] core.git: Branch 'private/jmux/win-test-nohang' - 9 commits - comphelper/source configure.ac external/breakpad external/neon package/source sc/source sfx2/source shell/source sw/CppunitTest_sw_layoutwriter.mk sw/inc sw/qa sw/source vcl/win
Jan-Marek Glogowski (via logerrit)
logerrit at kemper.freedesktop.org
Tue Feb 25 09:06:34 UTC 2020
Rebased ref, commits from common ancestor:
commit e7b3f27362948a16b95a33220f0d826dce1b5ea5
Author: Jan-Marek Glogowski <jan-marek.glogowski at extern.cib.de>
AuthorDate: Tue Feb 25 10:02:25 2020 +0100
Commit: Jan-Marek Glogowski <jan-marek.glogowski at extern.cib.de>
CommitDate: Tue Feb 25 10:05:53 2020 +0100
WIN disable AttachThreadInput hack
just a test patch to fix eventual hangs.
Change-Id: I8de0a17aaaa44c24b1ee728b2ef6ec3aea951c54
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index 8b0a64232927..298bb8e53a49 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -1930,12 +1930,16 @@ static void ImplSalToTop( HWND hWnd, SalFrameToTop nFlags )
// This magic code is necessary to connect the input focus of the
// current window thread and the thread which owns the window that
// should be the new foreground window.
+#if 0
HWND hCurrWnd = GetForegroundWindow();
DWORD myThreadID = GetCurrentThreadId();
DWORD currThreadID = GetWindowThreadProcessId(hCurrWnd,nullptr);
AttachThreadInput(myThreadID, currThreadID,TRUE);
SetForegroundWindow_Impl(hWnd);
AttachThreadInput(myThreadID,currThreadID,FALSE);
+#else
+ SetForegroundWindow_Impl(hWnd);
+#endif
}
if ( nFlags & SalFrameToTop::RestoreWhenMin )
commit 8ba958c97b72738c9aceb47354ecff7d493e2d1c
Author: Thorsten Behrens <Thorsten.Behrens at CIB.de>
AuthorDate: Mon Feb 10 01:05:35 2020 +0100
Commit: Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Mon Feb 10 01:05:35 2020 +0100
breakpad: fix build against CentOS6 baseline
Change-Id: I7f7e88bb37c945e2f01ea60af7dc2a301aa5d6b0
diff --git a/external/breakpad/0001-Handle-race-between-ExceptionHandler-SignalHandler-a.patch.1 b/external/breakpad/0001-Handle-race-between-ExceptionHandler-SignalHandler-a.patch.1
index a88c2cdd32bb..73b57ae06841 100644
--- a/external/breakpad/0001-Handle-race-between-ExceptionHandler-SignalHandler-a.patch.1
+++ b/external/breakpad/0001-Handle-race-between-ExceptionHandler-SignalHandler-a.patch.1
@@ -21,7 +21,7 @@ index b895f6d7..4d58e510 100644
bool handled = false;
- for (int i = g_handler_stack_->size() - 1; !handled && i >= 0; --i) {
- handled = (*g_handler_stack_)[i]->HandleSignal(sig, info, uc);
-+ if (g_handler_stack_ != nullptr) {
++ if (g_handler_stack_ != 0) {
+ for (int i = g_handler_stack_->size() - 1; !handled && i >= 0; --i) {
+ handled = (*g_handler_stack_)[i]->HandleSignal(sig, info, uc);
+ }
commit b8081d2ffad30e60a05f7ed9d09812b989e06b7e
Author: Thorsten Behrens <Thorsten.Behrens at CIB.de>
AuthorDate: Mon Feb 10 00:51:15 2020 +0100
Commit: Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Mon Feb 10 00:51:15 2020 +0100
Bump version to 6.1.7.9
Change-Id: I6383689734a83a71ec90806dc12726168e89a612
diff --git a/configure.ac b/configure.ac
index 6bd8da094b2e..6348c853610c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,7 +9,7 @@ dnl in order to create a configure script.
# several non-alphanumeric characters, those are split off and used only for the
# ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no idea.
-AC_INIT([LibreOffice powered by CIB],[6.1.7.8],[],[],[https://libreoffice.cib.eu/])
+AC_INIT([LibreOffice powered by CIB],[6.1.7.9],[],[],[https://libreoffice.cib.eu/])
AC_PREREQ([2.59])
commit 5b6c866d522e7eef636a5fa4048c39c1ea60e466
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Fri Jan 3 22:40:07 2020 +0300
Commit: Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Sun Feb 9 15:19:00 2020 +0100
tdf#93389: keep encryption information for autorecovered MS formats
The autorecovery data is stored in ODF, regardless of the original
document format. When restoring, type detection generates ODF data,
which is stored in the media descriptor attached to document, even
after real filter was restored (see AutoRecovery::implts_openDocs).
If real filter is not ODF, then at the save time, it doesn't find
necessary information in encryption data, and makes not encrypted
package.
This patch adds both MS binary data, and OOXML data, to existing
ODF data for recovered password-protected documents (regardless of
their real filter).
TODO: only add required information to encryption data: pass real
filter name to DocPasswordHelper::requestAndVerifyDocPassword from
AutoRecovery::implts_openDocs.
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86201
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
Tested-by: Mike Kaganski <mike.kaganski at collabora.com>
(cherry picked from commit dd198398b6e5c84ab1255a90ef96e6445b66a64f)
Conflicts:
comphelper/source/misc/docpasswordhelper.cxx
Change-Id: I4717f067ad3c40167312b99eefef5584a467bfed
(cherry picked from commit 6017cdff264afc3b98beeba1330d6df28102fe7a)
diff --git a/comphelper/source/misc/docpasswordhelper.cxx b/comphelper/source/misc/docpasswordhelper.cxx
index f75997cfe440..1a4f29755c36 100644
--- a/comphelper/source/misc/docpasswordhelper.cxx
+++ b/comphelper/source/misc/docpasswordhelper.cxx
@@ -25,6 +25,7 @@
#include <comphelper/storagehelper.hxx>
#include <comphelper/hash.hxx>
#include <comphelper/base64.hxx>
+#include <comphelper/propertysequence.hxx>
#include <comphelper/sequence.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp>
@@ -429,6 +430,25 @@ OUString DocPasswordHelper::GetOoxHashAsBase64(
OUString aPassword;
DocPasswordVerifierResult eResult = DocPasswordVerifierResult::WrongPassword;
+ sal_Int32 nMediaEncDataCount = rMediaEncData.getLength();
+
+ // tdf#93389: if the document is being restored from autorecovery, we need to add encryption
+ // data also for real document type.
+ // TODO: get real filter name here (from CheckPasswd_Impl), to only add necessary data
+ bool bForSalvage = false;
+ if (nMediaEncDataCount)
+ {
+ for (auto& val : rMediaEncData)
+ {
+ if (val.Name == "ForSalvage")
+ {
+ --nMediaEncDataCount; // don't consider this element below
+ val.Value >>= bForSalvage;
+ break;
+ }
+ }
+ }
+
// first, try provided default passwords
if( pbIsDefaultPassword )
*pbIsDefaultPassword = false;
@@ -453,7 +473,7 @@ OUString DocPasswordHelper::GetOoxHashAsBase64(
// try media encryption data (skip, if result is OK or ABORT)
if( eResult == DocPasswordVerifierResult::WrongPassword )
{
- if( rMediaEncData.getLength() > 0 )
+ if (nMediaEncDataCount)
{
eResult = rVerifier.verifyEncryptionData( rMediaEncData );
if( eResult == DocPasswordVerifierResult::OK )
@@ -512,6 +532,26 @@ OUString DocPasswordHelper::GetOoxHashAsBase64(
aEncData = comphelper::concatSequences(
aEncData, OStorageHelper::CreatePackageEncryptionData(aPassword));
}
+
+ if (bForSalvage)
+ {
+ // TODO: add individual methods for different target filter, and only call what's needed
+
+ // 1. Prepare binary MS formats encryption data
+ auto aUniqueID = GenerateRandomByteSequence(16);
+ auto aEnc97Key = GenerateStd97Key(aPassword.getStr(), aUniqueID);
+ // 2. Add MS binary and OOXML encryption data to result
+ uno::Sequence< beans::NamedValue > aContainer(3);
+ aContainer[0].Name = "STD97EncryptionKey";
+ aContainer[0].Value <<= aEnc97Key;
+ aContainer[1].Name = "STD97UniqueID";
+ aContainer[1].Value <<= aUniqueID;
+ aContainer[2].Name = "OOXPassword";
+ aContainer[2].Value <<= aPassword;
+
+ aEncData = comphelper::concatSequences(
+ aEncData, aContainer);
+ }
}
return (eResult == DocPasswordVerifierResult::OK) ? aEncData : uno::Sequence< beans::NamedValue >();
diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx
index 2f49e497dd47..19e28e9dcb33 100644
--- a/package/source/xstor/owriteablestream.cxx
+++ b/package/source/xstor/owriteablestream.cxx
@@ -79,9 +79,11 @@ struct WSInternalData_Impl
namespace package
{
-bool PackageEncryptionDatasEqual( const ::comphelper::SequenceAsHashMap& aHash1, const ::comphelper::SequenceAsHashMap& aHash2 )
+bool PackageEncryptionDataLessOrEqual( const ::comphelper::SequenceAsHashMap& aHash1, const ::comphelper::SequenceAsHashMap& aHash2 )
{
- bool bResult = !aHash1.empty() && aHash1.size() == aHash2.size();
+ // tdf#93389: aHash2 may contain more than in aHash1, if it contains also data for other package
+ // formats (as in case of autorecovery)
+ bool bResult = !aHash1.empty() && aHash1.size() <= aHash2.size();
for ( ::comphelper::SequenceAsHashMap::const_iterator aIter = aHash1.begin();
bResult && aIter != aHash1.end();
++aIter )
@@ -1160,7 +1162,7 @@ uno::Reference< io::XStream > OWriteStream_Impl::GetStream( sal_Int32 nStreamMod
if ( m_bHasCachedEncryptionData )
{
- if ( !::package::PackageEncryptionDatasEqual( m_aEncryptionData, aEncryptionData ) )
+ if ( !::package::PackageEncryptionDataLessOrEqual( m_aEncryptionData, aEncryptionData ) )
throw packages::WrongPasswordException();
// the correct key must be set already
diff --git a/package/source/xstor/owriteablestream.hxx b/package/source/xstor/owriteablestream.hxx
index e3eeaf09d4fd..5501d6a4df47 100644
--- a/package/source/xstor/owriteablestream.hxx
+++ b/package/source/xstor/owriteablestream.hxx
@@ -55,7 +55,8 @@ namespace com { namespace sun { namespace star { namespace uno {
} } } }
namespace package {
- bool PackageEncryptionDatasEqual( const ::comphelper::SequenceAsHashMap& aHash1, const ::comphelper::SequenceAsHashMap& aHash2 );
+ // all data in aHash1 is contained in aHash2
+ bool PackageEncryptionDataLessOrEqual( const ::comphelper::SequenceAsHashMap& aHash1, const ::comphelper::SequenceAsHashMap& aHash2 );
}
struct WSInternalData_Impl;
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx
index 0a43a07869f9..1725b1627762 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -857,7 +857,7 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement,
SAL_INFO("package.xstor", "No Encryption: " << rNoEncryptionException);
}
- if (bHasCommonEncryptionData && ::package::PackageEncryptionDatasEqual(pElement->m_xStream->GetCachedEncryptionData(), aCommonEncryptionData))
+ if (bHasCommonEncryptionData && ::package::PackageEncryptionDataLessOrEqual(pElement->m_xStream->GetCachedEncryptionData(), aCommonEncryptionData))
{
// If the stream can be opened with the common storage password
// it must be stored with the common storage password as well
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index 47ba55e34947..bea5aba9fe4d 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -44,6 +44,7 @@
#include <comphelper/processfactory.hxx>
#include <comphelper/storagehelper.hxx>
#include <comphelper/string.hxx>
+#include <comphelper/sequence.hxx>
#include <comphelper/synchronousdispatch.hxx>
#include <vcl/wrkwin.hxx>
@@ -240,6 +241,21 @@ ErrCode CheckPasswd_Impl
if ( !aEncryptionData.hasElements() && aGpgProperties.hasElements() )
aEncryptionData = ::comphelper::DocPasswordHelper::decryptGpgSession(aGpgProperties);
+ // tdf#93389: if recoverying a document, encryption data should contain
+ // entries for the real filter, not only for recovery ODF, to keep it
+ // encrypted. Pass this in encryption data.
+ // TODO: pass here the real filter (from AutoRecovery::implts_openDocs)
+ // to marshal this to requestAndVerifyDocPassword
+ if (pSet->GetItemState(SID_DOC_SALVAGE, false) == SfxItemState::SET)
+ {
+ uno::Sequence< beans::NamedValue > aContainer(1);
+ aContainer[0].Name = "ForSalvage";
+ aContainer[0].Value <<= true;
+
+ aEncryptionData = comphelper::concatSequences(
+ aEncryptionData, aContainer);
+ }
+
SfxDocPasswordVerifier aVerifier( xStorage );
aEncryptionData = ::comphelper::DocPasswordHelper::requestAndVerifyDocPassword(
aVerifier, aEncryptionData, aPassword, xInteractionHandler, pFile->GetOrigURL(), comphelper::DocPasswordRequestType::Standard );
commit b838986c6edfb4e5fb1e30bf47d8ad54ae2b4098
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Fri Nov 29 13:07:57 2019 +0300
Commit: Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Sun Feb 9 11:30:26 2020 +0100
tdf#118639: store ODF encryption data for autorecovery
When saving autorecovery information, ODF is used. If the original
document is password-protected, its autorecovery is also generated
password-protected (since ef87ff6680f79362a431db6e7ef2f40cfc576219).
But when the stored encryption data for non-ODF document does not
contain "PackageSHA256UTF8EncryptionKey" value, following
ZipPackage::GetEncryptionKey fails, so the whole save fails.
So just generate and append ODF encryption keys where we still have
user password.
Reviewed-on: https://gerrit.libreoffice.org/84052
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
(cherry picked from commit 63634738dd03cc74806ce6843c16ff5e51a371a0)
Reviewed-on: https://gerrit.libreoffice.org/84133
Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>
(cherry picked from commit e569dc9824e95617d921bb8f115d243aea0125b9)
Reviewed-on: https://gerrit.libreoffice.org/84232
Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
(cherry picked from commit d1450f5bddd0f108078e0dfb11c9f130175fafe7)
Conflicts:
comphelper/source/misc/docpasswordhelper.cxx
Change-Id: I776e28de784489521e4941d1075690f90c056014
diff --git a/comphelper/source/misc/docpasswordhelper.cxx b/comphelper/source/misc/docpasswordhelper.cxx
index 3f470520fbf5..f75997cfe440 100644
--- a/comphelper/source/misc/docpasswordhelper.cxx
+++ b/comphelper/source/misc/docpasswordhelper.cxx
@@ -426,6 +426,7 @@ OUString DocPasswordHelper::GetOoxHashAsBase64(
bool* pbIsDefaultPassword )
{
css::uno::Sequence< css::beans::NamedValue > aEncData;
+ OUString aPassword;
DocPasswordVerifierResult eResult = DocPasswordVerifierResult::WrongPassword;
// first, try provided default passwords
@@ -439,8 +440,12 @@ OUString DocPasswordHelper::GetOoxHashAsBase64(
if( !aIt->isEmpty() )
{
eResult = rVerifier.verifyPassword( *aIt, aEncData );
- if( pbIsDefaultPassword )
- *pbIsDefaultPassword = eResult == DocPasswordVerifierResult::OK;
+ if (eResult == DocPasswordVerifierResult::OK)
+ {
+ aPassword = *aIt;
+ if (pbIsDefaultPassword)
+ *pbIsDefaultPassword = true;
+ }
}
}
}
@@ -460,7 +465,11 @@ OUString DocPasswordHelper::GetOoxHashAsBase64(
if( eResult == DocPasswordVerifierResult::WrongPassword )
{
if( !rMediaPassword.isEmpty() )
+ {
eResult = rVerifier.verifyPassword( rMediaPassword, aEncData );
+ if (eResult == DocPasswordVerifierResult::OK)
+ aPassword = rMediaPassword;
+ }
}
// request a password (skip, if result is OK or ABORT)
@@ -476,6 +485,8 @@ OUString DocPasswordHelper::GetOoxHashAsBase64(
{
if( !pRequest->getPassword().isEmpty() )
eResult = rVerifier.verifyPassword( pRequest->getPassword(), aEncData );
+ if (eResult == DocPasswordVerifierResult::OK)
+ aPassword = pRequest->getPassword();
}
else
{
@@ -488,6 +499,21 @@ OUString DocPasswordHelper::GetOoxHashAsBase64(
{
}
+ if (eResult == DocPasswordVerifierResult::OK && !aPassword.isEmpty())
+ {
+ if (std::find_if(std::cbegin(aEncData), std::cend(aEncData),
+ [](const css::beans::NamedValue& val) {
+ return val.Name == PACKAGE_ENCRYPTIONDATA_SHA256UTF8;
+ })
+ == std::cend(aEncData))
+ {
+ // tdf#118639: We need ODF encryption data for autorecovery, where password
+ // will already be unavailable, so generate and append it here
+ aEncData = comphelper::concatSequences(
+ aEncData, OStorageHelper::CreatePackageEncryptionData(aPassword));
+ }
+ }
+
return (eResult == DocPasswordVerifierResult::OK) ? aEncData : uno::Sequence< beans::NamedValue >();
}
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index 5e4055195eb5..eaf7f484ae85 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -2704,6 +2704,8 @@ ErrCode RequestPassword(const std::shared_ptr<const SfxFilter>& pCurrentFilter,
{
if ( pPasswordRequest->getPassword().getLength() )
{
+ css::uno::Sequence< css::beans::NamedValue > aEncryptionData;
+
// TODO/LATER: The filters should show the password dialog themself in future
if ( bMSType )
{
@@ -2712,7 +2714,7 @@ ErrCode RequestPassword(const std::shared_ptr<const SfxFilter>& pCurrentFilter,
{
::comphelper::SequenceAsHashMap aHashData;
aHashData[ OUString( "OOXPassword" ) ] <<= pPasswordRequest->getPassword();
- pSet->Put( SfxUnoAnyItem( SID_ENCRYPTIONDATA, uno::makeAny( aHashData.getAsConstNamedValueList() ) ) );
+ aEncryptionData = aHashData.getAsConstNamedValueList();
}
else
{
@@ -2725,7 +2727,7 @@ ErrCode RequestPassword(const std::shared_ptr<const SfxFilter>& pCurrentFilter,
aHashData[ OUString( "STD97EncryptionKey" ) ] <<= aEncryptionKey;
aHashData[ OUString( "STD97UniqueID" ) ] <<= aUniqueID;
- pSet->Put( SfxUnoAnyItem( SID_ENCRYPTIONDATA, uno::makeAny( aHashData.getAsConstNamedValueList() ) ) );
+ aEncryptionData = aHashData.getAsConstNamedValueList();
}
else
{
@@ -2733,10 +2735,14 @@ ErrCode RequestPassword(const std::shared_ptr<const SfxFilter>& pCurrentFilter,
}
}
}
- else
- {
- pSet->Put( SfxUnoAnyItem( SID_ENCRYPTIONDATA, uno::makeAny( ::comphelper::OStorageHelper::CreatePackageEncryptionData( pPasswordRequest->getPassword() ) ) ) );
- }
+
+ // tdf#118639: We need ODF encryption data for autorecovery where password will already
+ // be unavailable, even for non-ODF documents, so append it here unconditionally
+ pSet->Put(SfxUnoAnyItem(
+ SID_ENCRYPTIONDATA,
+ uno::makeAny(comphelper::concatSequences(
+ aEncryptionData, comphelper::OStorageHelper::CreatePackageEncryptionData(
+ pPasswordRequest->getPassword())))));
}
if ( pPasswordRequest->getRecommendReadOnly() )
commit eb8307c8adc986ad9ec81a17ab3cff07fc481c6f
Author: Jan-Marek Glogowski <jan-marek.glogowski at extern.cib.de>
AuthorDate: Thu Feb 6 16:24:53 2020 +0000
Commit: Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri Feb 7 15:35:57 2020 +0100
neon: escape broken SharePoint 2016 URIs
SharePoint returns broken URIs in its href replies, which aren't
correctly URI encoded, but still "valid" URIs w.r.t. general and
UTF8 encoding, e.g. http://<host>/Shared%20Documents/ümlaut.docx
As a workaround, this allows all invalid / other bytes (except
'\0') in the path of the URI in ne_uri_parse.
Change-Id: I70e7d323837469d7ced429a42c009972f4fb0ebc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88120
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>
Tested-by: Jenkins
(cherry picked from commit 069aa870aadb9f9069e8715c8be30394410f0288)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88200
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
diff --git a/external/neon/UnpackedTarball_neon.mk b/external/neon/UnpackedTarball_neon.mk
index 74ac2eb38c97..725e1916cd28 100644
--- a/external/neon/UnpackedTarball_neon.mk
+++ b/external/neon/UnpackedTarball_neon.mk
@@ -25,6 +25,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,neon,\
external/neon/neon_fix_lock_token_on_if.patch \
external/neon/neon_fix_lock_timeout_windows.patch \
external/neon/neon_fix_sspi_session_timeout.patch \
+ external/neon/neon_uri_parse_allow_others.patch \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/neon/neon_uri_parse_allow_others.patch b/external/neon/neon_uri_parse_allow_others.patch
new file mode 100644
index 000000000000..9de2cf6b9ae7
--- /dev/null
+++ b/external/neon/neon_uri_parse_allow_others.patch
@@ -0,0 +1,22 @@
+diff -ur src/ne_uri.c
+--- src/ne_uri.c 2020-02-07 10:49:58.764417840 +0000
++++ src/ne_uri.c 2020-02-07 10:51:33.675627141 +0000
+@@ -87,7 +87,8 @@
+ #define URI_PCHAR (URI_UNRESERVED | PC | URI_SUBDELIM | CL | AT)
+ /* invented: segchar = pchar / "/" */
+ /* (TKR) WS added */
+-#define URI_SEGCHAR (URI_PCHAR | FS | WS)
++/* also allow OT characters to parse SharePoint 2016 href URIs with unescaped UTF8 */
++#define URI_SEGCHAR (URI_PCHAR | FS | WS | OT)
+ /* query = *( pchar / "/" / "?" ) */
+ #define URI_QUERY (URI_PCHAR | FS | QU)
+ /* fragment == query */
+@@ -237,7 +238,7 @@
+
+ p = s;
+
+- while (uri_lookup(*p) & URI_SEGCHAR)
++ while (uri_lookup(*p) & URI_SEGCHAR && *p != '\0')
+ p++;
+
+ /* => p = [ "?" query ] [ "#" fragment ] */
commit 0c48789be7a54ebe146de6595bb32b534618c5d7
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed Jan 15 17:16:02 2020 +0100
Commit: Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri Feb 7 15:34:38 2020 +0100
Remove a fragment from a file URL early on
...as ShellExecuteExW would ignore it anyway
Change-Id: I969db094bb7d2ea230ac8c36eb23d71a90fbe466
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86868
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
(cherry picked from commit 14b36a16b225bf7c988f118d499a7287c47cd83e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86875
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
(cherry picked from commit e033f200d74202d64f4a928c2d7b3b1cadd1c8e8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88203
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index 8a926214ba59..0b2f7895dbe1 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -276,6 +276,7 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa
static_cast< XSystemShellExecute* >( this ),
3 );
+ OUString preprocessed_command(aCommand);
if ((nFlags & URIS_ONLY) != 0)
{
css::uno::Reference< css::uri::XUriReference > uri(
@@ -289,8 +290,10 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa
static_cast< cppu::OWeakObject * >(this), 0);
}
if (uri->getScheme().equalsIgnoreAsciiCase("file")) {
+ // ShellExecuteExW appears to ignore the fragment of a file URL anyway, so remove it:
+ uri->clearFragment();
+ preprocessed_command = uri->getUriReference();
OUString pathname;
- uri->clearFragment(); // getSystemPathFromFileURL fails for URLs with fragment
auto const e1
= osl::FileBase::getSystemPathFromFileURL(uri->getUriReference(), pathname);
if (e1 != osl::FileBase::E_None) {
@@ -394,7 +397,6 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa
and names no existing file (remember the jump mark
sign '#' is a valid file name character we remove
the jump mark, else ShellExecuteEx fails */
- OUString preprocessed_command(aCommand);
if (is_system_path(preprocessed_command))
{
if (has_jump_mark(preprocessed_command) && !is_existing_file(preprocessed_command))
commit 3d2b440cd7207f1f0fe78f449441d1f9c3dafc1e
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Wed Jan 22 15:59:01 2020 +0100
Commit: Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Tue Feb 4 22:22:46 2020 +0100
tdf#125440 When inserting TSV, consider quotes as field markers
The problem is that this is "plain text" from the clipboard format,
but actually contains TSV (tab separated values). So treat them accordingly,
so that each value gets its own cell.
Change-Id: I0029e6ace90fc542c3269dd82bb7531654157a69
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87950
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 9af724054c25..e675de0e0e64 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -880,6 +880,8 @@ bool ScImportExport::Text2Doc( SvStream& rStrm )
for( ;; )
{
rStrm.ReadUniOrByteStringLine( aLine, rStrm.GetStreamCharSet(), nArbitraryLineLengthLimit );
+ // tdf#125440 When inserting tab separated string, consider quotes as field markers
+ DoubledQuoteMode mode = aLine.indexOf("\t") >= 0 ? DoubledQuoteMode::ESCAPE : DoubledQuoteMode::KEEP_ALL;
if( rStrm.eof() )
break;
SCCOL nCol = nStartCol;
@@ -892,7 +894,7 @@ bool ScImportExport::Text2Doc( SvStream& rStrm )
{
// Always look for a pairing quote and ignore separator in between.
while (*p && *p == cStr)
- q = p = lcl_ScanString( p, aCell, pSeps, cStr, DoubledQuoteMode::KEEP_ALL, bOverflowCell );
+ q = p = lcl_ScanString( p, aCell, pSeps, cStr, mode, bOverflowCell );
// All until next separator or quote.
while (*p && *p != cSep && *p != cStr)
++p;
commit 82480ecbe0dc3c99777dcc4e32b63a968a6c2ae7
Author: Jan-Marek Glogowski <jan-marek.glogowski at extern.cib.de>
AuthorDate: Fri Jan 31 16:53:47 2020 +0000
Commit: Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Tue Feb 4 22:18:41 2020 +0100
Unit test for stable at-page anchored fly position
This is the unit test for commit
5cee586a97a11c23dd252accc42099bd5e9b4187 ("sw: fix moving of
at-page anchored flys to different page"). Originally the error
was just triggered by toggling "View -> Field Names". Luckily
it's also triggered by adding some text to page four, so no need
for some UI test.
Change-Id: I3a63b50dd898788607c3d24a848d8f43ae966377
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87776
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl at cib.de>
(cherry picked from commit 5fed8bb5f6f65963fed27f96de3be14dff830d38)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87847
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
(cherry picked from commit 4db184ea279a2974679b05eaa8ca52ec087f68af)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87983
Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
diff --git a/sw/CppunitTest_sw_layoutwriter.mk b/sw/CppunitTest_sw_layoutwriter.mk
index 675299180e44..6ec6195eea72 100644
--- a/sw/CppunitTest_sw_layoutwriter.mk
+++ b/sw/CppunitTest_sw_layoutwriter.mk
@@ -44,6 +44,7 @@ $(eval $(call gb_CppunitTest_use_externals,sw_layoutwriter,\
$(eval $(call gb_CppunitTest_set_include,sw_layoutwriter,\
-I$(SRCDIR)/sw/inc \
-I$(SRCDIR)/sw/source/core/inc \
+ -I$(SRCDIR)/sw/source/uibase/inc \
-I$(SRCDIR)/sw/qa/extras/inc \
$$(INCLUDE) \
))
diff --git a/sw/inc/swrect.hxx b/sw/inc/swrect.hxx
index c4b1889ae4ae..a2beda693112 100644
--- a/sw/inc/swrect.hxx
+++ b/sw/inc/swrect.hxx
@@ -23,6 +23,7 @@
#include <sal/log.hxx>
#include <tools/gen.hxx>
+#include <swdllapi.h>
class SvStream;
@@ -30,7 +31,7 @@ class SvStream;
/// This is half-open so m_Point.X() + m_Size.getWidth() is *not* included.
/// Note the tools Rectangle is (usually? sometimes?) closed so there's a
/// SVRect() to subtract 1 for the conversion.
-class SAL_WARN_UNUSED SwRect
+class SW_DLLPUBLIC SAL_WARN_UNUSED SwRect
{
Point m_Point;
Size m_Size;
diff --git a/sw/qa/extras/layout/data/stable-at-page-anchored-fly-position.odt b/sw/qa/extras/layout/data/stable-at-page-anchored-fly-position.odt
new file mode 100644
index 000000000000..e5a3779c54c5
Binary files /dev/null and b/sw/qa/extras/layout/data/stable-at-page-anchored-fly-position.odt differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 7d6eeccd18b8..bdbcc12c9487 100755
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -10,6 +10,10 @@
#include <swmodeltestbase.hxx>
#include <comphelper/propertysequence.hxx>
#include <test/mtfxmldump.hxx>
+#include <wrtsh.hxx>
+#include <pagefrm.hxx>
+#include <sortedobjs.hxx>
+#include <anchoredobject.hxx>
static char const DATA_DIRECTORY[] = "/sw/qa/extras/layout/data/";
@@ -32,6 +36,7 @@ public:
void testTdf117188();
void testTdf119875();
void testTdf116989();
+ void testStableAtPageAnchoredFlyPosition();
CPPUNIT_TEST_SUITE(SwLayoutWriter);
CPPUNIT_TEST(testTdf116830);
@@ -49,6 +54,7 @@ public:
CPPUNIT_TEST(testTdf117188);
CPPUNIT_TEST(testTdf119875);
CPPUNIT_TEST(testTdf116989);
+ CPPUNIT_TEST(testStableAtPageAnchoredFlyPosition);
CPPUNIT_TEST_SUITE_END();
private:
@@ -304,6 +310,49 @@ void SwLayoutWriter::testTdf116989()
}
}
+static SwRect lcl_getVisibleFlyObjRect(SwWrtShell* pWrtShell)
+{
+ SwRootFrame* pRoot = pWrtShell->GetLayout();
+ SwPageFrame* pPage = static_cast<SwPageFrame*>(pRoot->GetLower());
+ pPage = static_cast<SwPageFrame*>(pPage->GetNext());
+ pPage = static_cast<SwPageFrame*>(pPage->GetNext());
+ SwSortedObjs* pDrawObjs = pPage->GetDrawObjs();
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDrawObjs->size());
+ SwAnchoredObject* pDrawObj = (*pDrawObjs)[0];
+ CPPUNIT_ASSERT_EQUAL(OUString("Rahmen8"), pDrawObj->GetFrameFormat().GetName());
+ pPage = static_cast<SwPageFrame*>(pPage->GetNext());
+ pDrawObjs = pPage->GetDrawObjs();
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pDrawObjs->size());
+ pDrawObj = (*pDrawObjs)[0];
+ CPPUNIT_ASSERT_EQUAL(OUString("Rahmen123"), pDrawObj->GetFrameFormat().GetName());
+ SwRect aFlyRect = pDrawObj->GetObjRect();
+ CPPUNIT_ASSERT(pPage->getFrameArea().IsInside(aFlyRect));
+ return aFlyRect;
+}
+
+void SwLayoutWriter::testStableAtPageAnchoredFlyPosition()
+{
+ // this doc has two page-anchored frames: one tiny on page 3 and one large on page 4.
+ // it also has a style:master-page named "StandardEntwurf", which contains some fields.
+ // if you add a break to page 2, or append some text to page 4 (or just toggle display field names),
+ // the page anchored frame on page 4 vanishes, as it is incorrectly moved out of the page bounds.
+ SwDoc* pDoc = createDoc("stable-at-page-anchored-fly-position.odt");
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+
+ // look up the layout position of the page-bound frame on page four
+ SwRect aOrigRect = lcl_getVisibleFlyObjRect(pWrtShell);
+
+ // append some text to the document to trigger bug / relayout
+ pWrtShell->SttEndDoc(false);
+ pWrtShell->Insert("foo");
+
+ // get the current position of the frame on page four
+ SwRect aRelayoutRect = lcl_getVisibleFlyObjRect(pWrtShell);
+
+ // the anchored frame should not have moved
+ CPPUNIT_ASSERT_EQUAL(aOrigRect, aRelayoutRect);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SwLayoutWriter);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/core/inc/sortedobjs.hxx b/sw/source/core/inc/sortedobjs.hxx
index 0fd6a9cb9d71..5e5dcc45712f 100644
--- a/sw/source/core/inc/sortedobjs.hxx
+++ b/sw/source/core/inc/sortedobjs.hxx
@@ -21,6 +21,7 @@
#include <sal/types.h>
#include <vector>
+#include <swdllapi.h>
class SwAnchoredObject;
@@ -45,7 +46,7 @@ class SwAnchoredObject;
If one of the sort criteria attributes of an anchored object changes,
the sorting has to be updated - use method <Update(..)>
*/
-class SwSortedObjs
+class SW_DLLPUBLIC SwSortedObjs
{
private:
std::vector< SwAnchoredObject* > maSortedObjLst;
More information about the Libreoffice-commits
mailing list