[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3-desktop' - filter/source
filter/source/xsltfilter/OleHandler.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 3bf20599bb3afe03086e602ccebabd77b8896f71 Author: Andras Timar AuthorDate: Thu Aug 22 15:31:45 2019 +0200 Commit: Andras Timar CommitDate: Thu Aug 22 15:31:45 2019 +0200 build fix Change-Id: Ic0be0c6fd0d498b3f0512461480f166ad3f7b5f8 diff --git a/filter/source/xsltfilter/OleHandler.cxx b/filter/source/xsltfilter/OleHandler.cxx index 057b69ada620..807a8a04fed1 100644 --- a/filter/source/xsltfilter/OleHandler.cxx +++ b/filter/source/xsltfilter/OleHandler.cxx @@ -97,7 +97,7 @@ namespace XSLT OString SAL_CALL OleHandler::encodeSubStorage(const OUString& streamName) { -if (!m_storage || !m_storage->hasByName(streamName)) +if (!m_storage.is() || !m_storage->hasByName(streamName)) { return "Not Found:";// + streamName; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3-desktop' - filter/source include/unotools officecfg/registry sw/CppunitTest_sw_mailmerge.mk sw/inc sw/qa sw/source sw/uiconfig unotools/
filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx | 13 include/unotools/compatibility.hxx|8 officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs |6 sw/CppunitTest_sw_mailmerge.mk|4 sw/inc/IDocumentSettingAccess.hxx |1 sw/inc/doc.hxx|3 sw/inc/ndhints.hxx| 26 + sw/inc/ndtxt.hxx | 12 sw/inc/viewsh.hxx |2 sw/qa/extras/mailmerge/data/5-with-blanks.ods |binary sw/qa/extras/mailmerge/data/tdf35798-legacy.fodt | 37 ++ sw/qa/extras/mailmerge/data/tdf35798-legacy.odt |binary sw/qa/extras/mailmerge/data/tdf35798-new.fodt | 38 ++ sw/qa/extras/mailmerge/data/tdf35798-new.odt |binary sw/qa/extras/mailmerge/mailmerge.cxx | 141 ++ sw/source/core/doc/DocumentSettingManager.cxx |7 sw/source/core/doc/doc.cxx| 128 + sw/source/core/doc/doctxm.cxx |4 sw/source/core/inc/DocumentSettingManager.hxx |1 sw/source/core/text/txtfrm.cxx|9 sw/source/core/txtnode/atrfld.cxx | 27 + sw/source/core/txtnode/ndtxt.cxx |2 sw/source/core/txtnode/thints.cxx | 71 ++--- sw/source/core/view/viewsh.cxx| 20 + sw/source/filter/xml/xmlimp.cxx | 26 + sw/source/ui/config/optcomp.cxx | 33 +- sw/source/uibase/app/docshini.cxx | 22 - sw/source/uibase/uno/SwXDocumentSettings.cxx | 18 + sw/uiconfig/swriter/ui/optcompatpage.ui |1 unotools/source/config/compatibility.cxx | 52 +++ 30 files changed, 573 insertions(+), 139 deletions(-) New commits: commit 281fba83860c9635ac7b9b00286b68270abf3c27 Author: Mike KaganskiDate: Fri May 18 18:48:38 2018 +0300 tdf#35798: Hide empty Database fields' paragraphs (+ compat option) With this change, Database fields that expand to empty values behave as if they are "Hidden Paragraph" fields. A compatibility option to enable this behaviour is added. The option is enabled by default, and for any non-native documents (for compatibility with other office suites). For existing (F)ODT documents, the option is disabled for those documents that don't have this setting set, to keep the layout of legacy documents. Change-Id: Ic5e8cb15a3a7d1a765a984eef4b0d97666df7dfd Reviewed-on: https://gerrit.libreoffice.org/54552 Tested-by: Jenkins Reviewed-by: Mike Kaganski Reviewed-on: https://gerrit.libreoffice.org/54661 Reviewed-by: Andras Timar Tested-by: Andras Timar diff --git a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx index 88d829dead0b..bf1b0b2ea427 100644 --- a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx +++ b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx @@ -96,12 +96,25 @@ bool SAL_CALL XmlFilterAdaptor::importImpl( const Sequence< css::beans::Property PropertyMapEntry aImportInfoMap[] = { { OUString("BaseURI"), 0, ::cppu::UnoType::get(), PropertyAttribute::MAYBEVOID, 0}, +{ OUString("DefaultDocumentSettings"), 0, + ::cppu::UnoType ::get(), PropertyAttribute::MAYBEVOID, 0 }, { OUString(), 0, css::uno::Type(), 0, 0 } }; Reference< XPropertySet > xInfoSet( GenericPropertySet_CreateInstance( new PropertySetInfo( aImportInfoMap ) ) ); xInfoSet->setPropertyValue( "BaseURI", makeAny( aBaseURI )); + +OUString aFilterName; +auto It = aMediaMap.find(OUString("FilterName")); +if (It != aMediaMap.end() && (It->second >>= aFilterName) +&& aFilterName == "OpenDocument Text Flat XML") +{ +PropertyValue EmptyDbFieldHidesPara("EmptyDbFieldHidesPara", 0, Any(false), + PropertyState::PropertyState_DIRECT_VALUE); +Sequence aSettings{ EmptyDbFieldHidesPara }; +xInfoSet->setPropertyValue("DefaultDocumentSettings", makeAny(aSettings)); +} aAnys[0] <<= xInfoSet; diff --git a/include/unotools/compatibility.hxx b/include/unotools/compatibility.hxx
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3-desktop' - filter/source include/filter sw/qa sw/source writerfilter/source
filter/source/msfilter/util.cxx |7 ++- include/filter/msfilter/util.hxx |5 + sw/qa/extras/ooxmlexport/ooxmlexport.cxx |2 +- sw/qa/extras/ooxmlexport/ooxmlexport5.cxx| 16 sw/qa/extras/ooxmlexport/ooxmlexport9.cxx| 10 ++ sw/source/core/text/xmldump.cxx |3 ++- writerfilter/source/dmapper/BorderHandler.cxx|2 +- writerfilter/source/dmapper/CellColorHandler.cxx | 10 +- writerfilter/source/dmapper/DomainMapper.cxx |2 +- writerfilter/source/dmapper/TDefTableHandler.cxx |2 +- writerfilter/source/ooxml/OOXMLFactory.cxx |9 + writerfilter/source/ooxml/OOXMLFactory.hxx |1 + writerfilter/source/ooxml/OOXMLPropertySet.cxx | 16 writerfilter/source/ooxml/OOXMLPropertySet.hxx |7 +++ writerfilter/source/ooxml/factoryimpl.py |5 - writerfilter/source/ooxml/model.xml |2 +- writerfilter/source/rtftok/rtfdocumentimpl.cxx |6 -- 17 files changed, 74 insertions(+), 31 deletions(-) New commits: commit e9c69bfa7254106458744bd832b101319ca518d8 Author: Luke DellerDate: Thu Mar 8 01:11:40 2018 +1100 tdf#116179 Support reading "auto" colour from docx In docx a colour value is represented as a 6-digit hex RGB value, or alternatively the word "auto" to represent automatic colour. - Add support for reading the value "auto" as COL_AUTO. Previously this would be read as if it were a hex value, stopping at the letter 'u' which is not a valid hex digit, resulting in the colour 0x0A - a very dark blue, which looks close enough to black that it went unnoticed for a long time :-) - Remove code which tried to handle this wrong 0x0A value, including the constant OOXML_COLOR_AUTO, as it is no longer needed and will cause surprises for anyone who really wanted this exact shade of dark blue - Fix unit tests that were checking for 0x0A Reviewed-on: https://gerrit.libreoffice.org/50995 Tested-by: Jenkins Reviewed-by: Miklos Vajna Reviewed-on: https://gerrit.libreoffice.org/51461 Reviewed-by: Mike Kaganski (cherry picked from commit 3967aebca94be9ceea3e36b43f7f53589473ad4e) Change-Id: I670341931147ff9341ad6281cd3b53c02b46 (cherry picked from commit ccef956c4f11ac6c0612a0d22845d02743c91039) diff --git a/filter/source/msfilter/util.cxx b/filter/source/msfilter/util.cxx index 607791f96a1f..24603aa4d704 100644 --- a/filter/source/msfilter/util.cxx +++ b/filter/source/msfilter/util.cxx @@ -126,14 +126,11 @@ sal_Unicode bestFitOpenSymbolToMSFont(sal_Unicode cChar, } -OString ConvertColor( const Color , bool bAutoColor ) +OString ConvertColor( const Color ) { OString color( "auto" ); -if (bAutoColor && rColor.GetColor() == OOXML_COLOR_AUTO) -return color; - -if ( rColor.GetColor() != COL_AUTO ) +if ( rColor != COL_AUTO ) { const char pHexDigits[] = "0123456789ABCDEF"; char pBuffer[] = "00"; diff --git a/include/filter/msfilter/util.hxx b/include/filter/msfilter/util.hxx index 8aa01f5be952..66183e35f2b9 100644 --- a/include/filter/msfilter/util.hxx +++ b/include/filter/msfilter/util.hxx @@ -58,15 +58,12 @@ MSFILTER_DLLPUBLIC sal_Unicode bestFitOpenSymbolToMSFont(sal_Unicode cBullet, rtl_TextEncoding& r_ioChrSet, OUString& r_ioFontName); -#define OOXML_COLOR_AUTO 0x0a - /** * Converts tools Color to HTML color (without leading hashmark). * * @param rColor color to convert - * @param bAutoColor if OOXML_COLOR_AUTO should be recognized as an auto color */ -MSFILTER_DLLPUBLIC OString ConvertColor( const Color , bool bAutoColor = false ); +MSFILTER_DLLPUBLIC OString ConvertColor( const Color ); /** Paper size in 1/100 millimeters. */ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index a767a6e5955a..0c2a84620139 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -694,7 +694,7 @@ DECLARE_OOXMLEXPORT_TEST(testNumOverrideLvltext, "num-override-lvltext.docx") CPPUNIT_ASSERT_EQUAL(sal_Int16(2), comphelper::SequenceAsHashMap(xRules->getByIndex(1))["ParentNumbering"].get()); // The paragraph marker's red font color was inherited by the number portion, this was ff. -CPPUNIT_ASSERT_EQUAL(OUString("0a"), parseDump("//Special[@nType='POR_NUMBER']/SwFont", "color")); +CPPUNIT_ASSERT_EQUAL(OUString(""), parseDump("//Special[@nType='POR_NUMBER']/SwFont", "color")); } DECLARE_OOXMLEXPORT_TEST(testNumOverrideStart, "num-override-start.docx") diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3-desktop' - filter/source include/sfx2 include/tools officecfg/registry sfx2/source svx/source
filter/source/config/cache/constant.hxx |1 + filter/source/config/cache/filtercache.cxx|7 --- include/sfx2/docfilt.hxx |5 - include/tools/errcode.hxx |2 ++ officecfg/registry/schema/org/openoffice/TypeDetection/Filter.xcs |8 sfx2/source/bastyp/fltfnc.cxx | 10 +- sfx2/source/doc/docfilt.cxx |9 ++--- sfx2/source/doc/objstor.cxx |6 ++ svx/source/src/errtxt.src |4 9 files changed, 44 insertions(+), 8 deletions(-) New commits: commit f709b3040759774af624aaae75a7408652d784f9 Author: Andras TimarDate: Thu Mar 8 16:07:11 2018 +0100 Let sysadmins disable individual file format filters It makes sense to disable a filter, as a temporary security measure, when there is a 0-day vulnerability in it. E.g., when 0-day found in AbiWord filter, this config snippet disables it: false Reviewed-on: https://gerrit.libreoffice.org/50961 Reviewed-by: Andras Timar Tested-by: Andras Timar (cherry picked from commit 4547fa2c1e205e1989611b1c4493cbbd12541372) Change-Id: I8b84250c7e4aac3555877d23f58ed13a2210ebfc Reviewed-on: https://gerrit.libreoffice.org/51057 Reviewed-by: Andras Timar Tested-by: Andras Timar diff --git a/filter/source/config/cache/constant.hxx b/filter/source/config/cache/constant.hxx index 7e8cc0218a9a..3207ad5ca8ad 100644 --- a/filter/source/config/cache/constant.hxx +++ b/filter/source/config/cache/constant.hxx @@ -60,6 +60,7 @@ #define PROPNAME_TEMPLATENAME "TemplateName" #define PROPNAME_FILEFORMATVERSION "FileFormatVersion" #define PROPNAME_EXPORTEXTENSION "ExportExtension" +#define PROPNAME_ENABLED "Enabled" /** @short used to identify a frame loader or detect service item property against the configuration API and can be used diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx index d1a56b7997a3..fd87c61161a4 100644 --- a/filter/source/config/cache/filtercache.cxx +++ b/filter/source/config/cache/filtercache.cxx @@ -63,10 +63,11 @@ FilterCache::FilterCache() , m_eFillState(E_CONTAINS_NOTHING ) { int i = 0; -OUString sStandardProps[9]; +OUString sStandardProps[10]; sStandardProps[i++] = PROPNAME_USERDATA; sStandardProps[i++] = PROPNAME_TEMPLATENAME; +sStandardProps[i++] = PROPNAME_ENABLED; // E_READ_UPDATE only above sStandardProps[i++] = PROPNAME_TYPE; sStandardProps[i++] = PROPNAME_FILEFORMATVERSION; @@ -79,9 +80,9 @@ FilterCache::FilterCache() // E_READ_NOTHING -> creative nothingness. m_aStandardProps[E_READ_STANDARD] = -css::uno::Sequence< OUString >(sStandardProps + 2, 7); +css::uno::Sequence< OUString >(sStandardProps + 3, 7); m_aStandardProps[E_READ_UPDATE] = -css::uno::Sequence< OUString >(sStandardProps, 2); +css::uno::Sequence< OUString >(sStandardProps, 3); m_aStandardProps[E_READ_ALL] = css::uno::Sequence< OUString >(sStandardProps, SAL_N_ELEMENTS(sStandardProps)); diff --git a/include/sfx2/docfilt.hxx b/include/sfx2/docfilt.hxx index 0a68d80e9243..6fd944f727b9 100644 --- a/include/sfx2/docfilt.hxx +++ b/include/sfx2/docfilt.hxx @@ -61,6 +61,7 @@ class SFX2_DLLPUBLIC SfxFilter sal_uIntPtr nVersion; SotClipboardFormatId lFormat; sal_uInt16 nDocIcon; +bool mbEnabled; public: SfxFilter( const OUString& rProvider, const OUString& rFilterName ); @@ -73,7 +74,8 @@ public: sal_uInt16 nDocIcon, const OUString , const OUString , - const OUString& rServiceName ); + const OUString& rServiceName, + bool bEnabled = true ); ~SfxFilter(); bool IsAllowedAsTemplate() const { return bool(nFormatType & SfxFilterFlags::TEMPLATE); } @@ -118,6 +120,7 @@ public: css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception ); + bool IsEnabled() const { return mbEnabled; } }; #endif diff --git a/include/tools/errcode.hxx b/include/tools/errcode.hxx index 5a8f57af462b..a177d176c79d 100644 --- a/include/tools/errcode.hxx +++ b/include/tools/errcode.hxx @@ -241,6 +241,8 @@ inline sal_uInt32 ERRCODE_TOERROR( ErrCode x )
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3-desktop' - filter/source include/filter
filter/source/msfilter/mscodec.cxx | 25 +++-- include/filter/msfilter/mscodec.hxx |8 ++-- 2 files changed, 25 insertions(+), 8 deletions(-) New commits: commit 0065a315a8e7b06ce9f1c661638caf75536f50ca Author: Caolán McNamaraDate: Fri Jan 26 10:47:24 2018 + Resolves: tdf#114221 generate both std97 and cryptoapi keys from password.. when we open a cryptoapi encrypted binary msoffice document. That way when we save as the same format, and try to reuse the generated keys for encryption, we have matching std97 encryption keys available because we always export using that scheme. Change-Id: I25f24a01d102242615768255ce888acb08ef6447 Reviewed-on: https://gerrit.libreoffice.org/48712 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit b5914ba44f2fff9f282b6a5cbe21cbebf19e45b2) Reviewed-on: https://gerrit.libreoffice.org/48914 (cherry picked from commit 82e74f704ce4fe3ffe7ab74c14fe83d2d44dd088) (cherry picked from commit 9b8198dacc2208a29044ddc25784e328ac4af1cf) diff --git a/filter/source/msfilter/mscodec.cxx b/filter/source/msfilter/mscodec.cxx index c57559bfdd28..f5e400ffefae 100644 --- a/filter/source/msfilter/mscodec.cxx +++ b/filter/source/msfilter/mscodec.cxx @@ -245,8 +245,9 @@ void MSCodec_Xor95::Skip( std::size_t nBytes ) mnOffset = (mnOffset + nBytes) & 0x0F; } -MSCodec97::MSCodec97(size_t nHashLen) -: m_nHashLen(nHashLen) +MSCodec97::MSCodec97(size_t nHashLen, const OUString& rEncKeyName) +: m_sEncKeyName(rEncKeyName) +, m_nHashLen(nHashLen) , m_hCipher(rtl_cipher_create(rtl_Cipher_AlgorithmARCFOUR, rtl_Cipher_ModeStream)) , m_aDocId(16, 0) , m_aDigestValue(nHashLen, 0) @@ -255,14 +256,14 @@ MSCodec97::MSCodec97(size_t nHashLen) } MSCodec_Std97::MSCodec_Std97() -: MSCodec97(RTL_DIGEST_LENGTH_MD5) +: MSCodec97(RTL_DIGEST_LENGTH_MD5, "STD97EncryptionKey") { m_hDigest = rtl_digest_create(rtl_Digest_AlgorithmMD5); assert(m_hDigest != nullptr); } MSCodec_CryptoAPI::MSCodec_CryptoAPI() -: MSCodec97(RTL_DIGEST_LENGTH_SHA1) +: MSCodec97(RTL_DIGEST_LENGTH_SHA1, "CryptoAPIEncryptionKey") { } @@ -300,7 +301,7 @@ bool MSCodec97::InitCodec( const uno::Sequence< beans::NamedValue >& aData ) bool bResult = false; ::comphelper::SequenceAsHashMap aHashData( aData ); -uno::Sequence< sal_Int8 > aKey = aHashData.getUnpackedValueOrDefault("STD97EncryptionKey", uno::Sequence< sal_Int8 >() ); +uno::Sequence aKey = aHashData.getUnpackedValueOrDefault(m_sEncKeyName, uno::Sequence()); const size_t nKeyLen = aKey.getLength(); if (nKeyLen == m_nHashLen) { @@ -328,7 +329,7 @@ uno::Sequence< beans::NamedValue > MSCodec97::GetEncryptionData() { ::comphelper::SequenceAsHashMap aHashData; assert(m_aDigestValue.size() == m_nHashLen); -aHashData[ OUString( "STD97EncryptionKey" ) ] <<= uno::Sequence< sal_Int8 >( reinterpret_cast (m_aDigestValue.data()), m_nHashLen ); +aHashData[m_sEncKeyName] <<= uno::Sequence(reinterpret_cast (m_aDigestValue.data()), m_nHashLen); aHashData[ OUString( "STD97UniqueID" ) ] <<= uno::Sequence< sal_Int8 >( reinterpret_cast (m_aDocId.data()), m_aDocId.size() ); return aHashData.getAsConstNamedValueList(); @@ -381,6 +382,9 @@ void MSCodec_CryptoAPI::InitKey ( (void)memcpy(m_aDocId.data(), pDocId, 16); lcl_PrintDigest(m_aDocId.data(), "DocId value"); + +//generate the old format key while we have the required data +m_aStd97Key = ::comphelper::DocPasswordHelper::GenerateStd97Key(pPassData, pDocId); } bool MSCodec97::VerifyKey(const sal_uInt8* pSaltData, const sal_uInt8* pSaltDigest) @@ -478,6 +482,15 @@ bool MSCodec_CryptoAPI::InitCipher(sal_uInt32 nCounter) return (result == rtl_Cipher_E_None); } +uno::Sequence MSCodec_CryptoAPI::GetEncryptionData() +{ +::comphelper::SequenceAsHashMap aHashData(MSCodec97::GetEncryptionData()); +//add in the old encryption key as well as our new key so saving using the +//old crypto scheme can be done without reprompt for the password +aHashData[OUString("STD97EncryptionKey")] <<= m_aStd97Key; +return aHashData.getAsConstNamedValueList(); +} + void MSCodec_Std97::CreateSaltDigest( const sal_uInt8 nSaltData[16], sal_uInt8 nSaltDigest[16] ) { #if DEBUG_MSO_ENCRYPTION_STD97 diff --git a/include/filter/msfilter/mscodec.hxx b/include/filter/msfilter/mscodec.hxx index b0ab818449ae..aa38f6e9fc00 100644 --- a/include/filter/msfilter/mscodec.hxx +++ b/include/filter/msfilter/mscodec.hxx @@ -178,7 +178,7 @@ public: class MSFILTER_DLLPUBLIC MSCodec97 { public: -MSCodec97(size_t nHashLen); +MSCodec97(size_t nHashLen, const OUString& rEncKeyName); virtual ~MSCodec97(); /** Initializes the algorithm with the encryption data. @@ -195,7 +195,7 @@