.gitignore | 1 configure.ac | 5 editeng/source/items/textitem.cxx | 12 + include/editeng/rsiditem.hxx | 5 instsetoo_native/util/openoffice.lst.in | 2 officecfg/registry/data/org/openoffice/Office/Accelerators.xcu | 24 +++ setup_native/source/packinfo/finals_instsetoo.txt.in | 1 solenv/bin/modules/installer/globals.pm | 2 solenv/bin/modules/installer/windows/msp.pm | 2 svl/source/passwordcontainer/passwordcontainer.cxx | 11 - svl/source/passwordcontainer/passwordcontainer.hxx | 2 sw/qa/extras/ooxmlexport/data/tdf116436_rowFill.odt |binary sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 9 + sw/qa/extras/ooxmlexport/ooxmlexport5.cxx | 7 sw/qa/extras/ww8export/data/tdf116436_tableBackground.odt |binary sw/qa/extras/ww8export/ww8export2.cxx | 13 + sw/source/filter/ww8/docxattributeoutput.cxx | 27 +++ sw/source/filter/ww8/docxexport.cxx | 4 sw/source/filter/ww8/docxexport.hxx | 2 sw/source/filter/ww8/rtfexport.cxx | 4 sw/source/filter/ww8/rtfexport.hxx | 2 sw/source/filter/ww8/wrtww8.cxx | 80 ++++++---- sw/source/filter/ww8/wrtww8.hxx | 6 23 files changed, 173 insertions(+), 48 deletions(-)
New commits: commit 75069eddea917213f57c9f01223f92cac6dccf4d Author: Andras Timar <andras.ti...@collabora.com> AuthorDate: Wed Aug 29 11:44:01 2018 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed Aug 29 11:44:01 2018 +0200 Bump version to 6.0-7 Change-Id: I2fa339d6b874d4338ea0be5582fe75cdbb1df1b9 diff --git a/configure.ac b/configure.ac index 2c552ee9636a..f521b9f272bd 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([Collabora Office],[6.0.10.6],[],[],[https://collaboraoffice.com/]) +AC_INIT([Collabora Office],[6.0.10.7],[],[],[https://collaboraoffice.com/]) AC_PREREQ([2.59]) commit 310620d3f80558b0daadd058670dae9ac5985e86 Author: Andras Timar <andras.ti...@collabora.com> AuthorDate: Wed Aug 29 11:39:22 2018 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed Aug 29 11:43:18 2018 +0200 [cp] Enable MSP patching Change-Id: Ib9059106e224622990823f2a3b790e5899256385 diff --git a/.gitignore b/.gitignore index ab3a638307b5..aad4142986f0 100644 --- a/.gitignore +++ b/.gitignore @@ -64,6 +64,7 @@ /README /AUTHORS /MAINTAINERS +/setup_native/source/packinfo/finals_instsetoo.txt # make id /ID diff --git a/configure.ac b/configure.ac index 9ed771bf868a..2c552ee9636a 100644 --- a/configure.ac +++ b/configure.ac @@ -3057,6 +3057,7 @@ if test "$_os" = "WINNT"; then BITNESS_OVERRIDE=64 fi fi +AC_SUBST(WINDOWS_SDK_ARCH) if test "$_os" = "iOS"; then cross_compiling="yes" fi @@ -4365,6 +4366,7 @@ if test "$cross_compiling" = "yes"; then bin/odfvalidator.sh.in \ bin/officeotron.sh.in \ instsetoo_native/util/openoffice.lst.in \ + setup_native/source/packinfo/finals_instsetoo.txt.in \ config_host/*.in \ sysui/desktop/macosx/Info.plist.in) \ | (cd CONF-FOR-BUILD && tar xf -) @@ -12538,6 +12540,7 @@ AC_CONFIG_FILES([config_host.mk bin/odfvalidator.sh bin/officeotron.sh instsetoo_native/util/openoffice.lst + setup_native/source/packinfo/finals_instsetoo.txt sysui/desktop/macosx/Info.plist]) AC_CONFIG_HEADERS([config_host/config_buildid.h]) AC_CONFIG_HEADERS([config_host/config_clang.h]) diff --git a/instsetoo_native/util/openoffice.lst.in b/instsetoo_native/util/openoffice.lst.in index 4d5a01bbf158..721e6788fd0d 100644 --- a/instsetoo_native/util/openoffice.lst.in +++ b/instsetoo_native/util/openoffice.lst.in @@ -27,7 +27,7 @@ Globals REGISTRYLAYERNAME Layers SERVICEPACK 1 UPDATE_DATABASE 1 - CREATE_MSP_INSTALLSET 0 + CREATE_MSP_INSTALLSET 1 UPDATE_DATABASE_LISTNAME finals_instsetoo.txt PACKAGEMAP package_names.txt,package_names_ext.txt WINDOWSPATCHLEVEL @LIBO_VERSION_PATCH@ diff --git a/setup_native/source/packinfo/finals_instsetoo.txt b/setup_native/source/packinfo/finals_instsetoo.txt.in similarity index 82% rename from setup_native/source/packinfo/finals_instsetoo.txt rename to setup_native/source/packinfo/finals_instsetoo.txt.in index d5a68d369f7b..07e1722f1b8a 100644 --- a/setup_native/source/packinfo/finals_instsetoo.txt +++ b/setup_native/source/packinfo/finals_instsetoo.txt.in @@ -30,3 +30,4 @@ # OpenOffice pro de \\<server>\<path>\msi\OOO300_m6_native_packed-1_de.9352\openofficeorg30.msi # OpenOfficeLanguagePack pro es \\<server>\<path>\msi\OOO300_m6_native_packed-1_es.9352\openofficeorg30.msi # URE pro en-US \\<server>\<path>\msi\OOO300_m6_native_packed-1_en-US.9352\ure14.msi +CollaboraOffice pro en-US,ar,as,ast,bg,bn-IN,br,ca,ca-valencia,cy,cs,da,de,el,en-GB,es,et,eu,fi,fr,ga,gd,gl,gu,he,hi,hr,hu,id,is,it,ja,km,kn,ko,lt,lv,ml,mr,nb,nl,nn,oc,or,pa-IN,pl,pt,pt-BR,ro,ru,sk,sl,sr,sr-Latn,sv,ta,te,tr,uk,vi,zh-CN,zh-TW c:\lo\src\cp-6.0-6-@WINDOWS_SDK_ARCH@\Collabora_Office_6.0-6_Win_@WINDOWS_SDK_ARCH@.msi diff --git a/solenv/bin/modules/installer/globals.pm b/solenv/bin/modules/installer/globals.pm index 2cd0cc21062c..324379896547 100644 --- a/solenv/bin/modules/installer/globals.pm +++ b/solenv/bin/modules/installer/globals.pm @@ -222,7 +222,7 @@ BEGIN $fix_number_of_cab_files = 1; $cabfilecompressionlevel = 21; # Using LZX compression, possible values are: 15 | 16 | ... | 21 (best compression) $number_of_cabfiles = 1; # only for $fix_number_of_cab_files = 1 - $include_cab_in_msi = 1; + $include_cab_in_msi = 0; $msidatabasename = ""; $prepare_winpatch = 0; $previous_idt_dir = ""; diff --git a/solenv/bin/modules/installer/windows/msp.pm b/solenv/bin/modules/installer/windows/msp.pm index 1e76947df7b0..e76d5da7ab7f 100644 --- a/solenv/bin/modules/installer/windows/msp.pm +++ b/solenv/bin/modules/installer/windows/msp.pm @@ -288,7 +288,7 @@ sub set_mspfilename { my ($allvariables, $mspdir, $languagesarrayref) = @_; - my $databasename = $allvariables->{'PRODUCTNAME'} . "-" . $allvariables->{'PRODUCTVERSION'} . "-" . $allvariables->{'WINDOWSPATCHLEVEL'} . ".msp"; + my $databasename = $allvariables->{'ONEWORDPRODUCTNAME'} . "-" . $allvariables->{'PRODUCTVERSION'} . "-" . $allvariables->{'WINDOWSPATCHLEVEL'} . ".msp"; my $fullmspname = $mspdir . $installer::globals::separator . $databasename; commit af5b15abe1e884e097aaab159eab3127f3481e33 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Aug 23 16:15:58 2018 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed Aug 29 11:37:19 2018 +0200 Resolves: tdf#112563 we don't want a human representation of SvxRsidItem Change-Id: I6a57440b08258ddcbfaa955a62c4963a83193115 Reviewed-on: https://gerrit.libreoffice.org/59516 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@cib.de> (cherry picked from commit bd64800ef579b5d4653ee3dfb90c45874a15a9fa) diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index e9ec28a812ec..84c86baa2989 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -3106,6 +3106,18 @@ SfxPoolItem* SvxRsidItem::Clone( SfxItemPool * ) const return new SvxRsidItem( *this ); } +bool SvxRsidItem::GetPresentation +( + SfxItemPresentation /*ePres*/, + MapUnit /*eCoreUnit*/, + MapUnit /*ePresUnit*/, + OUString& rText, const IntlWrapper& /*rIntl*/ +) const +{ + rText.clear(); + return false; +} + void SvxRsidItem::dumpAsXml(xmlTextWriterPtr pWriter) const { xmlTextWriterStartElement(pWriter, BAD_CAST("SvxRsidItem")); diff --git a/include/editeng/rsiditem.hxx b/include/editeng/rsiditem.hxx index ab1e23a6c618..4ace56e17e24 100644 --- a/include/editeng/rsiditem.hxx +++ b/include/editeng/rsiditem.hxx @@ -21,6 +21,11 @@ class EDITENG_DLLPUBLIC SvxRsidItem : public SfxUInt32Item public: SvxRsidItem( sal_uInt32 nRsid, sal_uInt16 nId ) : SfxUInt32Item( nId, nRsid ) {} + virtual bool GetPresentation( SfxItemPresentation ePres, + MapUnit eCoreMetric, + MapUnit ePresMetric, + OUString &rText, const IntlWrapper& ) const override; + virtual SfxPoolItem* Clone( SfxItemPool* pPool = nullptr ) const override; virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; commit 9fa350ea004753e76a60c88ed0a2174145468e35 Author: heiko tietze <tietze.he...@gmail.com> AuthorDate: Wed Aug 22 18:55:00 2018 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed Aug 29 11:35:29 2018 +0200 tdf#119425 - Use Ctrl+Tab to switch between sheets on macOS macOS used MOD3 now Reviewed-on: https://gerrit.libreoffice.org/59459 Tested-by: Jenkins Reviewed-by: Heiko Tietze <tietze.he...@gmail.com> (cherry picked from commit fcb8ee70824acace8fbe2357eaeba52ad9b7332f) Reviewed-on: https://gerrit.libreoffice.org/59537 (cherry picked from commit cb7b687a152d9ab71eaeb9efd5e936339bdf91e5) Change-Id: I6bec6a8311335ea0eb3decb0e0c2adc2fa9b03f7 diff --git a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu index 0958f744415a..fc5fb91cbf61 100644 --- a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu @@ -1336,6 +1336,30 @@ <value xml:lang="en-US">.uno:InsertAnnotation</value> </prop> </node> + <node oor:name="TAB_MOD1" oor:op="replace"> + <prop oor:name="Command"> + <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> + <value xml:lang="en-US" install:module="unxwnt">.uno:JumpToNextTable</value> + </prop> + </node> + <node oor:name="TAB_MOD3" oor:op="replace"> + <prop oor:name="Command"> + <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> + <value xml:lang="en-US" install:module="macosx">.uno:JumpToNextTable</value> + </prop> + </node> + <node oor:name="TAB_SHIFT_MOD1" oor:op="replace"> + <prop oor:name="Command"> + <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> + <value xml:lang="en-US" install:module="unxwnt">.uno:JumpToPrevTable</value> + </prop> + </node> + <node oor:name="TAB_SHIFT_MOD3" oor:op="replace"> + <prop oor:name="Command"> + <value xml:lang="x-no-translate">I10N SHORTCUTS - NO TRANSLATE</value> + <value xml:lang="en-US" install:module="macosx">.uno:JumpToPrevTable</value> + </prop> + </node> </node> <node oor:name="com.sun.star.chart2.ChartDocument" oor:op="replace"> <node oor:name="9_SHIFT_MOD1_MOD2" oor:op="replace"> commit 72d45497ea9625f192f0a6646577ddb0b3ceac88 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Thu Aug 23 18:10:01 2018 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed Aug 29 11:19:38 2018 +0200 Related rhbz#1618703: Properly handle failure encoding MS file ...when e.g. FIPS mode makes EncryptRC4 (in sw/source/filter/ww8/wrtww8.cxx) fail, but which hadn't been propagated out to SwWW8Writer::WriteStorage (in sw/source/filter/ww8/wrtww8.cxx) Reviewed-on: https://gerrit.libreoffice.org/59518 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> (cherry picked from commit 229340812f6e6cc8c868915055583f60c82a8cf3) Conflicts: sw/source/filter/ww8/docxexport.cxx ...plus cherry-pick of follow-up 8114f976b897c4717368146a49d5404ef970c77a "coverity#1438527 Nesting level does not match indentation" Reviewed-on: https://gerrit.libreoffice.org/59572 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> (cherry picked from commit 5be8cbdb874621111cb157a98013e254de3b269c) Change-Id: I1123136ce1a25e181a0a27486954621a2dd095ea diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index 17c77c4ae776..952561d31141 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -503,7 +503,7 @@ void DocxExport::OutputDML(uno::Reference<drawing::XShape> const & xShape) aExport.WriteShape(xShape); } -void DocxExport::ExportDocument_Impl() +ErrCode DocxExport::ExportDocument_Impl() { // Set the 'Track Revisions' flag in the settings structure m_aSettings.trackRevisions = bool( RedlineFlags::On & m_nOrigRedlineFlags ); @@ -543,6 +543,8 @@ void DocxExport::ExportDocument_Impl() m_pStyles = nullptr; delete m_pSections; m_pSections = nullptr; + + return ERRCODE_NONE; } void DocxExport::AppendSection( const SwPageDesc *pPageDesc, const SwSectionFormat* pFormat, sal_uLong nLnNum ) diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx index 65cf02fe2a1d..22b5dca7934e 100644 --- a/sw/source/filter/ww8/docxexport.hxx +++ b/sw/source/filter/ww8/docxexport.hxx @@ -191,7 +191,7 @@ public: protected: /// Format-dependent part of the actual export. - virtual void ExportDocument_Impl() override; + virtual ErrCode ExportDocument_Impl() override; /// Output SwEndNode virtual void OutputEndNode( const SwEndNode& ) override; diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 586dd01f23bd..679b96ac9a77 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -660,7 +660,7 @@ void RtfExport::WritePageDescTable() m_pTableInfo = std::make_shared<ww8::WW8TableInfo>(); } -void RtfExport::ExportDocument_Impl() +ErrCode RtfExport::ExportDocument_Impl() { // Make the header Strm() @@ -931,6 +931,8 @@ void RtfExport::ExportDocument_Impl() WriteMainText(); Strm().WriteChar('}'); + + return ERRCODE_NONE; } void RtfExport::PrepareNewPageDesc(const SfxItemSet* pSet, const SwNode& rNd, diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx index 869a888e9b25..b470ef593f30 100644 --- a/sw/source/filter/ww8/rtfexport.hxx +++ b/sw/source/filter/ww8/rtfexport.hxx @@ -117,7 +117,7 @@ public: protected: /// Format-dependent part of the actual export. - void ExportDocument_Impl() override; + ErrCode ExportDocument_Impl() override; void SectionBreaksAndFrames(const SwTextNode& /*rNode*/) override {} diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 916975ebdd91..afef206af619 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -3117,7 +3117,7 @@ namespace { const sal_uLong WW_BLOCKSIZE = 0x200; - void EncryptRC4(msfilter::MSCodec_Std97& rCtx, SvStream &rIn, SvStream &rOut) + ErrCode EncryptRC4(msfilter::MSCodec_Std97& rCtx, SvStream &rIn, SvStream &rOut) { rIn.Seek(STREAM_SEEK_TO_END); sal_uLong nLen = rIn.Tell(); @@ -3126,16 +3126,19 @@ namespace sal_uInt8 in[WW_BLOCKSIZE]; for (std::size_t nI = 0, nBlock = 0; nI < nLen; nI += WW_BLOCKSIZE, ++nBlock) { - std::size_t nBS = (nLen - nI > WW_BLOCKSIZE) ? WW_BLOCKSIZE : nLen - nI; + std::size_t nBS = std::min(nLen - nI, WW_BLOCKSIZE); nBS = rIn.ReadBytes(in, nBS); - rCtx.InitCipher(nBlock); + if (!rCtx.InitCipher(nBlock)) { + return ERRCODE_IO_NOTSUPPORTED; + } rCtx.Encode(in, nBS, in, nBS); rOut.WriteBytes(in, nBS); } + return ERRCODE_NONE; } } -void MSWordExportBase::ExportDocument( bool bWriteAll ) +ErrCode MSWordExportBase::ExportDocument( bool bWriteAll ) { m_nCharFormatStart = DEFAULT_STYLES_COUNT; m_nFormatCollStart = m_nCharFormatStart + m_pDoc->GetCharFormats()->size() - 1; @@ -3202,7 +3205,7 @@ void MSWordExportBase::ExportDocument( bool bWriteAll ) if ( m_pDoc->getIDocumentDrawModelAccess().GetDrawModel() ) m_pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage( 0 )->RecalcObjOrdNums(); - ExportDocument_Impl(); + ErrCode err = ExportDocument_Impl(); m_aFrames.clear(); @@ -3215,6 +3218,8 @@ void MSWordExportBase::ExportDocument( bool bWriteAll ) *m_pCurPam = *m_pOrigPam; m_pDoc->getIDocumentRedlineAccess().SetRedlineFlags(m_nOrigRedlineFlags); + + return err; } bool SwWW8Writer::InitStd97CodecUpdateMedium( ::msfilter::MSCodec_Std97& rCodec ) @@ -3269,7 +3274,7 @@ bool SwWW8Writer::InitStd97CodecUpdateMedium( ::msfilter::MSCodec_Std97& rCodec return ( aEncryptionData.getLength() != 0 ); } -void WW8Export::ExportDocument_Impl() +ErrCode WW8Export::ExportDocument_Impl() { PrepareStorage(); @@ -3367,6 +3372,7 @@ void WW8Export::ExportDocument_Impl() StoreDoc1(); + ErrCode err = ERRCODE_NONE; if ( bEncrypt ) { SvStream *pStrmTemp, *pTableStrmTemp, *pDataStrmTemp; @@ -3374,10 +3380,17 @@ void WW8Export::ExportDocument_Impl() pTableStrmTemp = xTableStrm.get(); pDataStrmTemp = xDataStrm.get(); - if ( pDataStrmTemp && pDataStrmTemp != pStrmTemp) - EncryptRC4(aCtx, *pDataStrm, *pDataStrmTemp); + if ( pDataStrmTemp && pDataStrmTemp != pStrmTemp) { + err = EncryptRC4(aCtx, *pDataStrm, *pDataStrmTemp); + if (err != ERRCODE_NONE) { + goto done; + } + } - EncryptRC4(aCtx, *pTableStrm, *pTableStrmTemp); + err = EncryptRC4(aCtx, *pTableStrm, *pTableStrmTemp); + if (err != ERRCODE_NONE) { + goto done; + } // Write Unencrypted Header 52 bytes to the start of the table stream // EncryptionVersionInfo (4 bytes): A Version structure where Version.vMajor MUST be 0x0001, and Version.vMinor MUST be 0x0001. @@ -3395,7 +3408,10 @@ void WW8Export::ExportDocument_Impl() pTableStrmTemp->WriteBytes(pSaltData, 16); pTableStrmTemp->WriteBytes(pSaltDigest, 16); - EncryptRC4(aCtx, GetWriter().Strm(), *pStrmTemp); + err = EncryptRC4(aCtx, GetWriter().Strm(), *pStrmTemp); + if (err != ERRCODE_NONE) { + goto done; + } // Write Unencrypted Fib 68 bytes to the start of the workdocument stream pFib->m_fEncrypted = true; // fEncrypted indicates the document is encrypted. @@ -3405,6 +3421,7 @@ void WW8Export::ExportDocument_Impl() pStrmTemp->Seek( 0 ); pFib->WriteHeader( *pStrmTemp ); + done:; } DELETEZ( m_pGrf ); @@ -3445,6 +3462,8 @@ void WW8Export::ExportDocument_Impl() pDataStrm = nullptr; GetWriter().GetStorage().Remove(SL::aData); } + + return err; } void WW8Export::PrepareStorage() @@ -3524,16 +3543,17 @@ ErrCode SwWW8Writer::WriteStorage() } // Do the actual export + ErrCode err = ERRCODE_NONE; { bool bDot = mpMedium->GetFilter()->GetName().endsWith("Vorlage"); WW8Export aExport(this, pDoc, pCurPam, pOrigPam, bDot); m_pExport = &aExport; - aExport.ExportDocument( bWriteAll ); + err = aExport.ExportDocument( bWriteAll ); m_pExport = nullptr; } ::EndProgress( pDoc->GetDocShell() ); - return ERRCODE_NONE; + return err; } ErrCode SwWW8Writer::WriteMedium( SfxMedium& ) diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index c4587e2552aa..ae8d71bd5231 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -574,7 +574,7 @@ public: public: /// The main function to export the document. - void ExportDocument( bool bWriteAll ); + ErrCode ExportDocument( bool bWriteAll ); /// Iterate through the nodes and call the appropriate OutputNode() on them. void WriteText(); @@ -788,7 +788,7 @@ public: protected: /// Format-dependent part of the actual export. - virtual void ExportDocument_Impl() = 0; + virtual ErrCode ExportDocument_Impl() = 0; /// Get the next position in the text node to output sal_Int32 GetNextPos( SwWW8AttrIter const * pAttrIter, const SwTextNode& rNode, sal_Int32 nAktPos ); @@ -989,7 +989,7 @@ public: virtual bool AddSectionBreaksForTOX() const override { return false; } private: /// Format-dependent part of the actual export. - virtual void ExportDocument_Impl() override; + virtual ErrCode ExportDocument_Impl() override; void PrepareStorage(); void WriteFkpPlcUsw(); commit 4bb9287c25cb2fbe183f874bd62c44a553490756 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Thu Aug 23 16:45:34 2018 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed Aug 29 11:16:41 2018 +0200 Related rhbz#1618703: Properly handle failure decoding master password ...when e.g. FIPS mode makes PasswordContainer::DecodePasswords fail by throwing an exception which needs to be caught in PasswordContainerHelper::addRecord (in uui/source/passwordcontainer.cxx, but which only catches NoMasterException, not generic RuntimeException) Change-Id: I877bb5126e79ac2c90b11ef6d31bf81a2927f409 Reviewed-on: https://gerrit.libreoffice.org/59511 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> (cherry picked from commit e17987f4bd54fec7e0d94bdefdb94809255b3436) Reviewed-on: https://gerrit.libreoffice.org/59568 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> (cherry picked from commit 24b3d08018b6350d5e60615eb375b337ab1b4f75) diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx index c2e8b7100028..6d4bb02427ac 100644 --- a/svl/source/passwordcontainer/passwordcontainer.cxx +++ b/svl/source/passwordcontainer/passwordcontainer.cxx @@ -417,7 +417,7 @@ void SAL_CALL PasswordContainer::disposing( const EventObject& ) } } -std::vector< OUString > PasswordContainer::DecodePasswords( const OUString& aLine, const OUString& aMasterPasswd ) +std::vector< OUString > PasswordContainer::DecodePasswords( const OUString& aLine, const OUString& aMasterPasswd, css::task::PasswordRequestMode mode ) { if( !aMasterPasswd.isEmpty() ) { @@ -463,7 +463,8 @@ std::vector< OUString > PasswordContainer::DecodePasswords( const OUString& aLin // problems with decoding OSL_FAIL( "Problem with decoding" ); - throw RuntimeException("Can't decode!" ); + throw css::task::NoMasterException( + "Can't decode!", css::uno::Reference<css::uno::XInterface>(), mode); } OUString PasswordContainer::EncodePasswords(const std::vector< OUString >& lines, const OUString& aMasterPasswd ) @@ -586,7 +587,7 @@ UserRecord PasswordContainer::CopyToUserRecord( const NamePassRecord& aRecord, b { try { - ::std::vector< OUString > aDecodedPasswords = DecodePasswords( aRecord.GetPersPasswords(), GetMasterPassword( aHandler ) ); + ::std::vector< OUString > aDecodedPasswords = DecodePasswords( aRecord.GetPersPasswords(), GetMasterPassword( aHandler ), css::task::PasswordRequestMode_PASSWORD_ENTER ); aPasswords.insert( aPasswords.end(), aDecodedPasswords.begin(), aDecodedPasswords.end() ); } catch( NoMasterException& ) @@ -848,7 +849,7 @@ OUString const & PasswordContainer::GetMasterPassword( const Reference< XInterac } else { - std::vector< OUString > aRM( DecodePasswords( aEncodedMP, aPass ) ); + std::vector< OUString > aRM( DecodePasswords( aEncodedMP, aPass, aRMode ) ); if( aRM.empty() || aPass != aRM[0] ) { bAskAgain = true; @@ -1005,7 +1006,7 @@ Sequence< UrlRecord > SAL_CALL PasswordContainer::getAllPersistent( const Refere { sal_Int32 oldLen = aUsers.getLength(); aUsers.realloc( oldLen + 1 ); - aUsers[ oldLen ] = UserRecord( aNP.GetUserName(), comphelper::containerToSequence( DecodePasswords( aNP.GetPersPasswords(), GetMasterPassword( xHandler ) ) ) ); + aUsers[ oldLen ] = UserRecord( aNP.GetUserName(), comphelper::containerToSequence( DecodePasswords( aNP.GetPersPasswords(), GetMasterPassword( xHandler ), css::task::PasswordRequestMode_PASSWORD_ENTER ) ) ); } if( aUsers.getLength() ) diff --git a/svl/source/passwordcontainer/passwordcontainer.hxx b/svl/source/passwordcontainer/passwordcontainer.hxx index 67ad63e72722..a1190549eb77 100644 --- a/svl/source/passwordcontainer/passwordcontainer.hxx +++ b/svl/source/passwordcontainer/passwordcontainer.hxx @@ -268,7 +268,7 @@ css::task::UrlRecord find( const css::uno::Reference< css::task::XInteractionHandler >& Handler ); /// @throws css::uno::RuntimeException - static ::std::vector< OUString > DecodePasswords( const OUString& aLine, const OUString& aMasterPassword ); + static ::std::vector< OUString > DecodePasswords( const OUString& aLine, const OUString& aMasterPassword, css::task::PasswordRequestMode mode ); /// @throws css::uno::RuntimeException static OUString EncodePasswords(const std::vector< OUString >& lines, const OUString& aMasterPassword ); commit 9c016e2aed1ceb3a1248a9887c41ab48c6b47c51 Author: Justin Luth <justin_l...@sil.org> AuthorDate: Fri Aug 17 14:35:51 2018 +0300 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed Aug 29 11:15:23 2018 +0200 tdf#116436 docx export: add missing table background fill MS formats only have support for Table and Cell fill. Interestingly, MS Word doesn't let the cells inherit from the Table fill setting (even though LO docx import currently does), so that value also needs to be written out into every cell. Change-Id: Ib49fddf52758ff641428de747ea290d1fcb894f3 Reviewed-on: https://gerrit.libreoffice.org/59260 Reviewed-by: Justin Luth <justin_l...@sil.org> Tested-by: Justin Luth <justin_l...@sil.org> (cherry picked from commit 8cc753d54ad1834709c5802115580adf65def89e) Reviewed-on: https://gerrit.libreoffice.org/59286 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> (cherry picked from commit e7d3e0b101ff25bb7edd49df61e330ccb4b75a24) diff --git a/sw/qa/extras/ooxmlexport/data/tdf116436_rowFill.odt b/sw/qa/extras/ooxmlexport/data/tdf116436_rowFill.odt new file mode 100644 index 000000000000..45f4a1c54b02 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf116436_rowFill.odt differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index 131953eb9723..f60a3167efbd 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -48,6 +48,15 @@ DECLARE_OOXMLEXPORT_TEST(testTdf92524_autoColor, "tdf92524_autoColor.doc") CPPUNIT_ASSERT_EQUAL(COL_AUTO, getProperty<sal_uInt32>(getParagraph(1), "ParaBackColor")); } +DECLARE_OOXMLEXPORT_TEST(testTdf116436_rowFill, "tdf116436_rowFill.odt") +{ + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<table::XCell> xCell = xTable->getCellByName("A1"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xF8DF7C), getProperty<sal_Int32>(xCell, "BackColor")); +} + DECLARE_OOXMLEXPORT_TEST(testTdf46938_clearTabStop, "tdf46938_clearTabStop.docx") { // Number of tabstops should be zero, overriding the one in the style diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx index 9823f4e13de0..22ab51aff521 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx @@ -999,6 +999,13 @@ DECLARE_OOXMLEXPORT_TEST(testOO47778_2, "ooo47778-4.odt") { if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) assertXPathContent(pXmlDoc, "(//w:t)[4]", "c"); + + // tdf116436: The problem was that the table background was undefined, not white. + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<table::XCell> xCell = xTable->getCellByName("A1"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xffffff), getProperty<sal_Int32>(xCell, "BackColor")); } DECLARE_OOXMLEXPORT_TEST(testOO67471, "ooo67471-2.odt") diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index d196c2661fad..8f69ab6b2e27 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -3730,6 +3730,18 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t FSNS( XML_w, XML_val ), pJcVal, FSEND ); + // Output the table background color (although cell value still needs to be specified) + const SvxBrushItem *pColorProp = pTableFormat->GetAttrSet().GetItem<SvxBrushItem>(RES_BACKGROUND); + Color aColor = pColorProp ? pColorProp->GetColor() : COL_AUTO; + if ( aColor != COL_AUTO ) + { + OString sColor = msfilter::util::ConvertColor( aColor ); + m_pSerializer->singleElementNS( XML_w, XML_shd, + FSNS( XML_w, XML_fill ), sColor.getStr( ), + FSNS( XML_w, XML_val ), "clear", + FSEND ); + } + // Output the table borders TableDefaultBorders( pTableTextNodeInfoInner ); @@ -3792,12 +3804,25 @@ void DocxAttributeOutput::TableDefaultCellMargins( ww8::WW8TableNodeInfoInner::P void DocxAttributeOutput::TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) { + const SwTable *pTable = pTableTextNodeInfoInner->getTable(); const SwTableBox *pTableBox = pTableTextNodeInfoInner->getTableBox( ); + const SwTableLine *pTableRow = pTableBox->GetUpper(); const SwFrameFormat *pFormat = pTableBox->GetFrameFormat( ); const SvxBrushItem *pColorProp = pFormat->GetAttrSet().GetItem<SvxBrushItem>(RES_BACKGROUND); Color aColor = pColorProp ? pColorProp->GetColor() : COL_AUTO; - OString sColor = msfilter::util::ConvertColor( aColor ); + + const SwFrameFormat *pRowFormat = pTableRow->GetFrameFormat( ); + const SvxBrushItem *pRowColorProp = pRowFormat->GetAttrSet().GetItem<SvxBrushItem>(RES_BACKGROUND); + if ( pRowColorProp && aColor == COL_AUTO) + aColor = pRowColorProp->GetColor(); + + const SwFrameFormat *pTableFormat = pTable->GetFrameFormat( ); + const SvxBrushItem *pTableColorProp = pTableFormat->GetAttrSet().GetItem<SvxBrushItem>(RES_BACKGROUND); + if ( pTableColorProp && aColor == COL_AUTO ) + aColor = pTableColorProp->GetColor(); + + const OString sColor = msfilter::util::ConvertColor( aColor ); std::map<OUString, css::uno::Any> aGrabBag = pFormat->GetAttrSet().GetItem<SfxGrabBagItem>(RES_FRMATR_GRABBAG)->GetGrabBag(); commit a5599938fedc8525e1142b76a386dc2675fc3250 Author: Justin Luth <justin_l...@sil.org> AuthorDate: Fri Aug 17 18:38:57 2018 +0300 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Wed Aug 29 11:15:08 2018 +0200 tdf#116436 doc export: add missing table background fill MS formats only have support for Table and Cell fill. Interestingly, MS Word doesn't let the cells inherit from the Table fill setting, so that value also needs to be written out into every cell. Since Word apparently ignores the table color, I didn't bother trying to search out how to export that in DOC format. (I did add it to DOCX since it was so easy to find.) Change-Id: I8946f07b45f72fed5959369182882a7bf013b1d0 Reviewed-on: https://gerrit.libreoffice.org/59281 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_l...@sil.org> (cherry picked from commit b576ab5073a8cdf5ca2db04838d255e142f5a896) Reviewed-on: https://gerrit.libreoffice.org/59287 Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> (cherry picked from commit 029951e6d3636d99b370568313b8b5c2da8b452d) diff --git a/sw/qa/extras/ww8export/data/tdf116436_tableBackground.odt b/sw/qa/extras/ww8export/data/tdf116436_tableBackground.odt new file mode 100644 index 000000000000..1ae65f788d4b Binary files /dev/null and b/sw/qa/extras/ww8export/data/tdf116436_tableBackground.odt differ diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx index 5f683d6a65f2..a076e1d4d3dc 100644 --- a/sw/qa/extras/ww8export/ww8export2.cxx +++ b/sw/qa/extras/ww8export/ww8export2.cxx @@ -66,6 +66,19 @@ DECLARE_WW8EXPORT_TEST(testTdf55528_relativeTableWidth, "tdf55528_relativeTableW CPPUNIT_ASSERT_EQUAL_MESSAGE("Table relative width percent", sal_Int16(98), getProperty<sal_Int16>(xTable, "RelativeWidth")); } +DECLARE_WW8EXPORT_TEST(testTdf116436_tableBackground, "tdf116436_tableBackground.odt") +{ + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<table::XCell> xCell = xTable->getCellByName("A1"); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xF8DF7C), getProperty<sal_Int32>(xCell, "BackColor")); + xCell.set(xTable->getCellByName("A6")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x81D41A), getProperty<sal_Int32>(xCell, "BackColor")); + xCell.set(xTable->getCellByName("B6")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFFFBCC), getProperty<sal_Int32>(xCell, "BackColor")); +} + DECLARE_WW8EXPORT_TEST(testTdf37153, "tdf37153_considerWrapOnObjPos.doc") { CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_THROUGH, getProperty<text::WrapTextMode>(getShape(1), "Surround")); diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index c9dceec902ff..916975ebdd91 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -2579,6 +2579,7 @@ void WW8AttributeOutput::TableCellBorders( void WW8AttributeOutput::TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) { + const SwTable * pTab = pTableTextNodeInfoInner->getTable(); const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox(); const SwTableLine * pTabLine = pTabBox->GetUpper(); const SwTableBoxes & rTabBoxes = pTabLine->GetTabBoxes(); @@ -2587,19 +2588,24 @@ void WW8AttributeOutput::TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t m_rWW8Export.InsUInt16( NS_sprm::sprmTDefTableShd80 ); m_rWW8Export.pO->push_back( (sal_uInt8)(nBoxes * 2) ); // Len + Color aRowColor = COL_AUTO; + const SvxBrushItem *pTableColorProp = pTab->GetFrameFormat()->GetAttrSet().GetItem<SvxBrushItem>(RES_BACKGROUND); + if ( pTableColorProp ) + aRowColor = pTableColorProp->GetColor(); + + const SvxBrushItem *pRowColorProp = pTabLine->GetFrameFormat()->GetAttrSet().GetItem<SvxBrushItem>(RES_BACKGROUND); + if ( pRowColorProp && pRowColorProp->GetColor() != COL_AUTO ) + aRowColor = pRowColorProp->GetColor(); + for ( sal_uInt8 n = 0; n < nBoxes; n++ ) { const SwTableBox * pBox1 = rTabBoxes[n]; const SwFrameFormat * pFrameFormat = pBox1->GetFrameFormat(); - const SfxPoolItem * pI = nullptr; - Color aColor; + Color aColor = aRowColor; - if ( SfxItemState::SET == pFrameFormat->GetAttrSet().GetItemState( RES_BACKGROUND, false, &pI ) ) - { - aColor = dynamic_cast<const SvxBrushItem *>(pI)->GetColor(); - } - else - aColor = COL_AUTO; + const SvxBrushItem *pCellColorProp = pFrameFormat->GetAttrSet().GetItem<SvxBrushItem>(RES_BACKGROUND); + if ( pCellColorProp && pCellColorProp->GetColor() != COL_AUTO ) + aColor = pCellColorProp->GetColor(); WW8_SHD aShd; WW8Export::TransBrush( aColor, aShd ); @@ -2621,17 +2627,11 @@ void WW8AttributeOutput::TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t { const SwTableBox * pBox1 = rTabBoxes[n]; const SwFrameFormat * pFrameFormat = pBox1->GetFrameFormat(); - const SfxPoolItem * pI = nullptr; - Color aColor; + Color aColor = aRowColor; - if ( SfxItemState::SET == - pFrameFormat->GetAttrSet(). - GetItemState( RES_BACKGROUND, false, &pI ) ) - { - aColor = dynamic_cast<const SvxBrushItem *>(pI)->GetColor(); - } - else - aColor = COL_AUTO; + const SvxBrushItem *pCellColorProp = pFrameFormat->GetAttrSet().GetItem<SvxBrushItem>(RES_BACKGROUND); + if ( pCellColorProp && pCellColorProp->GetColor() != COL_AUTO ) + aColor = pCellColorProp->GetColor(); WW8SHDLong aSHD; aSHD.setCvFore( 0xFF000000 ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits