diff --git a/Use-varying-aElement-name.patch b/Use-varying-aElement-name.patch new file mode 100644 index 0000000..37644b3 --- /dev/null +++ b/Use-varying-aElement-name.patch @@ -0,0 +1,26 @@ +From eeac58b5261e80ded0381e2be7f1fa3e6f0e9bb4 Mon Sep 17 00:00:00 2001 +From: Stephan Bergmann +Date: Tue, 20 May 2014 14:55:40 +0200 +Subject: [PATCH] Use varying aElement name + +Change-Id: Idc135ef5031a01961cc18d897a734b598bc833f4 +--- + sfx2/source/doc/docmacromode.cxx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx +index 39d2b6d..8f87197 100644 +--- a/sfx2/source/doc/docmacromode.cxx ++++ b/sfx2/source/doc/docmacromode.cxx +@@ -343,7 +343,7 @@ namespace sfx2 + if( aElement == aStdLibName || aElement == aVBAProject ) + { + Reference < XNameAccess > xLib; +- Any aAny = xContainer->getByName( aStdLibName ); ++ Any aAny = xContainer->getByName( aElement ); + aAny >>= xLib; + if ( xLib.is() && xLib->hasElements() ) + return sal_True; +-- +1.8.4.5 + diff --git a/WW8-import-fix-upper-margin-of-multi-page.patch b/WW8-import-fix-upper-margin-of-multi-page.patch new file mode 100644 index 0000000..a2d464f --- /dev/null +++ b/WW8-import-fix-upper-margin-of-multi-page.patch @@ -0,0 +1,171 @@ +From 9d981abc3f310adf9af3454dd515ea356b31d3c1 Mon Sep 17 00:00:00 2001 +From: Miklos Vajna +Date: Mon, 26 May 2014 12:04:39 +0200 +Subject: [PATCH] bnc#863018 WW8 import: fix upper margin of multi-page + floating table + +A vert orient position was already handled in case a floating table was +imported as a TextFrame, but in case we didn't do that, the vert orient +position was simply lost. + +Fix this by importing it as the upper margin of the table (assuming that +the position is relative from the anchor position). + +(cherry picked from commit 3755c87d0426a499d4755e82d8fbc77caa240764) + +Change-Id: I3e96f3068605fd6313dfb3e55483e1bce6c063a5 +Reviewed-on: https://gerrit.libreoffice.org/9487 +Reviewed-by: Andras Timar +Tested-by: Andras Timar +--- + +diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx +index 213e996..0725a9a 100644 +--- a/sw/source/filter/ww8/ww8par.cxx ++++ b/sw/source/filter/ww8/ww8par.cxx +@@ -2726,9 +2726,13 @@ bool SwWW8ImplReader::ProcessSpecial(bool &rbReSync, WW8_CP nStartCp) + maApos[nInTable] = false; + } + ++ // So that SwWW8ImplReader::StartApo() can write into this, and ++ // WW8TabDesc::CreateSwTable() can read it, if necessary. ++ SvxULSpaceItem aULSpaceItem(RES_UL_SPACE); ++ + if (aApo.mbStartApo) + { +- maApos[nInTable] = StartApo(aApo, pTabPos); ++ maApos[nInTable] = StartApo(aApo, pTabPos, &aULSpaceItem); + // We need an ReSync after StartApo + // (actually only if the Apo extends past a FKP border) + rbReSync = true; +@@ -2744,7 +2748,7 @@ bool SwWW8ImplReader::ProcessSpecial(bool &rbReSync, WW8_CP nStartCp) + + if(nInTable < nCellLevel) + { +- if (StartTable(nStartCp)) ++ if (StartTable(nStartCp, &aULSpaceItem)) + ++nInTable; + else + break; +diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx +index 28dca2e..772da4c 100644 +--- a/sw/source/filter/ww8/ww8par.hxx ++++ b/sw/source/filter/ww8/ww8par.hxx +@@ -1473,7 +1473,7 @@ private: + + WW8FlyPara *ConstructApo(const ApoTestResults &rApo, + const WW8_TablePos *pTabPos); +- bool StartApo(const ApoTestResults &rApo, const WW8_TablePos *pTabPos); ++ bool StartApo(const ApoTestResults &rApo, const WW8_TablePos *pTabPos, SvxULSpaceItem* pULSpaceItem = 0); + void StopApo(); + bool TestSameApo(const ApoTestResults &rApo, const WW8_TablePos *pTabPos); + ApoTestResults TestApo(int nCellLevel, bool bTableRowEnd, +@@ -1523,7 +1523,7 @@ private: + + void ReadDocVars(); + +- bool StartTable(WW8_CP nStartCp); ++ bool StartTable(WW8_CP nStartCp, SvxULSpaceItem* pULSpaceItem = 0); + bool InEqualApo(int nLvl) const; + bool InLocalApo() const { return InEqualApo(nInTable); } + bool InEqualOrHigherApo(int nLvl) const; +diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx +index f94e055..fcb5b50 100644 +--- a/sw/source/filter/ww8/ww8par2.cxx ++++ b/sw/source/filter/ww8/ww8par2.cxx +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -178,7 +179,7 @@ public: + + WW8TabDesc( SwWW8ImplReader* pIoClass, WW8_CP nStartCp ); + bool Ok() const { return bOk; } +- void CreateSwTable(); ++ void CreateSwTable(SvxULSpaceItem* pULSpaceItem = 0); + void UseSwTable(); + void SetSizePosition(SwFrmFmt* pFrmFmt); + void TableCellEnd(); +@@ -2324,7 +2325,7 @@ void wwSectionManager::PrependedInlineNode(const SwPosition &rPos, + maSegments.back().maStart = SwNodeIndex(rNode); + } + +-void WW8TabDesc::CreateSwTable() ++void WW8TabDesc::CreateSwTable(SvxULSpaceItem* pULSpaceItem) + { + ::SetProgressState(pIo->nProgress, pIo->mpDocShell); // Update + +@@ -2380,6 +2381,9 @@ void WW8TabDesc::CreateSwTable() + if (!pTable || !pTable->GetFrmFmt()) + return; + ++ if (pULSpaceItem && pULSpaceItem->GetUpper() != 0) ++ aItemSet.Put(*pULSpaceItem); ++ + SwTableNode* pTableNode = pTable->GetTableNode(); + OSL_ENSURE(pTableNode, "no table node!"); + if (pTableNode) +@@ -3319,7 +3323,7 @@ void WW8TabDesc::SetNumRuleName( const OUString& rName ) + aNumRuleNames[nCol] = rName; + } + +-bool SwWW8ImplReader::StartTable(WW8_CP nStartCp) ++bool SwWW8ImplReader::StartTable(WW8_CP nStartCp, SvxULSpaceItem* pULSpaceItem) + { + // Entering a table so make sure the FirstPara flag gets set + bFirstPara = true; +@@ -3395,7 +3399,7 @@ bool SwWW8ImplReader::StartTable(WW8_CP nStartCp) + "Not the anchor type requested!" ); + MoveInsideFly(pTableDesc->pFlyFmt); + } +- pTableDesc->CreateSwTable(); ++ pTableDesc->CreateSwTable(pULSpaceItem); + if (pTableDesc->pFlyFmt) + { + pTableDesc->SetSizePosition(pTableDesc->pFlyFmt); +diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx +index 43c93cd..066b8db 100644 +--- a/sw/source/filter/ww8/ww8par6.cxx ++++ b/sw/source/filter/ww8/ww8par6.cxx +@@ -2286,7 +2286,8 @@ bool SwWW8ImplReader::IsDropCap() + } + + bool SwWW8ImplReader::StartApo(const ApoTestResults &rApo, +- const WW8_TablePos *pTabPos) ++ const WW8_TablePos *pTabPos, ++ SvxULSpaceItem* pULSpaceItem) + { + if (0 == (pWFlyPara = ConstructApo(rApo, pTabPos))) + return false; +@@ -2321,7 +2322,24 @@ bool SwWW8ImplReader::StartApo(const ApoTestResults &rApo, + WW8FlySet aFlySet(*this, pWFlyPara, pSFlyPara, false); + + if (pTabPos && pTabPos->bNoFly) ++ { + pSFlyPara->pFlyFmt = 0; ++ if (pULSpaceItem) ++ { ++ // Word positioned tables can have a position (like a ++ // fly-frame), but they also support flowing accross multiple ++ // pages. If we decide to import this as a normal table (so it ++ // can flow accross multiple pages), then turn the vertical ++ // orientation position of the fly into a table upper margin. ++ const SfxPoolItem* pItem = 0; ++ if (aFlySet.HasItem(RES_VERT_ORIENT, &pItem)) ++ { ++ const SwFmtVertOrient* pOrient = static_cast(pItem); ++ if (pOrient->GetPos() != 0) ++ pULSpaceItem->SetUpper(pOrient->GetPos()); ++ } ++ } ++ } + else + { + pSFlyPara->pFlyFmt = rDoc.MakeFlySection( pSFlyPara->eAnchor, +-- +1.8.4.5 + diff --git a/direct-format-numbering.patch b/direct-format-numbering.patch new file mode 100644 index 0000000..dbadc96 --- /dev/null +++ b/direct-format-numbering.patch @@ -0,0 +1,232 @@ +From 2d89b1a029514935b60fbd3f7f7c5341a329bfc8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= +Date: Thu, 29 May 2014 14:31:20 +0200 +Subject: [PATCH] handle direct formatting for numbering in .docx (bnc#875717) + +Change-Id: I3ed0f926e79f3878c5702c2becae97d99d00e201 +(cherry picked from commit c2ac2ced0d51200a62f7436144f0d89cfcd15eed) +Signed-off-by: Andras Timar +--- + sw/inc/IDocumentSettingAccess.hxx | 3 ++- + sw/inc/doc.hxx | 1 + + sw/source/core/doc/doc.cxx | 4 ++++ + sw/source/core/doc/docnew.cxx | 1 + + sw/source/core/text/txtfld.cxx | 31 ++++++++++++++++++++++++++++ + sw/source/ui/uno/SwXDocumentSettings.cxx | 16 +++++++++++++- + writerfilter/source/dmapper/DomainMapper.cxx | 3 +++ + writerfilter/source/dmapper/PropertyIds.cxx | 1 + + writerfilter/source/dmapper/PropertyIds.hxx | 1 + + 9 files changed, 59 insertions(+), 2 deletions(-) + +diff --git a/sw/inc/IDocumentSettingAccess.hxx b/sw/inc/IDocumentSettingAccess.hxx +index 6e66fd0..4e94a1e 100644 +--- a/sw/inc/IDocumentSettingAccess.hxx ++++ b/sw/inc/IDocumentSettingAccess.hxx +@@ -92,7 +92,8 @@ namespace com { namespace sun { namespace star { namespace i18n { struct Forbidd + STYLES_NODEFAULT, + FLOATTABLE_NOMARGINS, + EMBED_FONTS, +- EMBED_SYSTEM_FONTS ++ EMBED_SYSTEM_FONTS, ++ APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING + }; + + public: +diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx +index 987d0ab..b872119 100644 +--- a/sw/inc/doc.hxx ++++ b/sw/inc/doc.hxx +@@ -581,6 +581,7 @@ private: + bool mbBackgroundParaOverDrawings; + bool mbTabOverMargin; + bool mbSurroundTextWrapSmall; ++ bool mApplyParagraphMarkFormatToNumbering; + + bool mbLastBrowseMode : 1; + +diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx +index e1d84f3..d3c74e9 100644 +--- a/sw/source/core/doc/doc.cxx ++++ b/sw/source/core/doc/doc.cxx +@@ -206,6 +206,7 @@ bool SwDoc::get(/*[in]*/ DocumentSettingId id) const + case FLOATTABLE_NOMARGINS: return mbFloattableNomargins; + case EMBED_FONTS: return mEmbedFonts; + case EMBED_SYSTEM_FONTS: return mEmbedSystemFonts; ++ case APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING: return mApplyParagraphMarkFormatToNumbering; + default: + OSL_FAIL("Invalid setting id"); + } +@@ -400,6 +401,9 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value) + case EMBED_SYSTEM_FONTS: + mEmbedSystemFonts = value; + break; ++ case APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING: ++ mApplyParagraphMarkFormatToNumbering = value; ++ break; + default: + OSL_FAIL("Invalid setting id"); + } +diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx +index 5385509..a97e616 100644 +--- a/sw/source/core/doc/docnew.cxx ++++ b/sw/source/core/doc/docnew.cxx +@@ -313,6 +313,7 @@ SwDoc::SwDoc() + mbBackgroundParaOverDrawings(false), + mbTabOverMargin(false), + mbSurroundTextWrapSmall(false), ++ mApplyParagraphMarkFormatToNumbering(false), + mbLastBrowseMode( false ), + mn32DummyCompatabilityOptions1(0), + mn32DummyCompatabilityOptions2(0), +diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx +index 22058c3..35471f41 100644 +--- a/sw/source/core/text/txtfld.cxx ++++ b/sw/source/core/text/txtfld.cxx +@@ -48,6 +48,7 @@ + #include "pagedesc.hxx" + #include + #include "fmtmeta.hxx" ++#include "fmtautofmt.hxx" + + + /************************************************************************* +@@ -382,6 +383,32 @@ SwLinePortion *SwTxtFormatter::NewExtraPortion( SwTxtFormatInfo &rInf ) + *************************************************************************/ + + ++// OOXML spec says that w:rPr inside w:pPr specifies formatting for the paragraph mark symbol (i.e. the control ++// character than can be configured to be shown). However, in practice MSO also uses it as direct formatting ++// for numbering in that paragraph. I don't know if the problem is in the spec or in MSWord. ++static void checkApplyParagraphMarkFormatToNumbering( SwFont* pNumFnt, SwTxtFormatInfo& rInf, const IDocumentSettingAccess* pIDSA ) ++{ ++ SwTxtNode* node = rInf.GetTxtFrm()->GetTxtNode(); ++ if( !pIDSA->get(IDocumentSettingAccess::APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING )) ++ return; ++ if( SwpHints* hints = node->GetpSwpHints()) ++ { ++ for( int i = 0; i < hints->Count(); ++i ) ++ { ++ SwTxtAttr* hint = hints->GetTextHint( i ); ++ // Formatting for the paragraph mark is set to apply only to the (non-existent) extra character ++ // the at end of the txt node. ++ if( hint->Which() == RES_TXTATR_AUTOFMT && hint->GetStart() != NULL && hint->GetEnd() != NULL ++ && *hint->GetStart() == *hint->GetEnd() && *hint->GetStart() == node->Len()) ++ { ++ boost::shared_ptr pSet(hint->GetAutoFmt().GetStyleHandle()); ++ pNumFnt->SetDiffFnt( pSet.get(), pIDSA ); ++ } ++ } ++ } ++} ++ ++ + SwNumberPortion *SwTxtFormatter::NewNumberPortion( SwTxtFormatInfo &rInf ) const + { + if( rInf.IsNumDone() || rInf.GetTxtStart() != nStart +@@ -470,6 +497,8 @@ SwNumberPortion *SwTxtFormatter::NewNumberPortion( SwTxtFormatInfo &rInf ) const + if( pFmt ) + pNumFnt->SetDiffFnt( pFmt, pIDSA ); + ++ checkApplyParagraphMarkFormatToNumbering( pNumFnt, rInf, pIDSA ); ++ + if ( pFmtFnt ) + { + const sal_uInt8 nAct = pNumFnt->GetActual(); +@@ -529,6 +558,8 @@ SwNumberPortion *SwTxtFormatter::NewNumberPortion( SwTxtFormatInfo &rInf ) const + if( pFmt ) + pNumFnt->SetDiffFnt( pFmt, pIDSA ); + ++ checkApplyParagraphMarkFormatToNumbering( pNumFnt, rInf, pIDSA ); ++ + // we do not allow a vertical font + pNumFnt->SetVertical( pNumFnt->GetOrientation(), pFrm->IsVertical() ); + +diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx +index c10ddfd..8a218a1 100644 +--- a/sw/source/ui/uno/SwXDocumentSettings.cxx ++++ b/sw/source/ui/uno/SwXDocumentSettings.cxx +@@ -123,7 +123,8 @@ enum SwDocumentSettingsPropertyHandles + HANDLE_EMBED_FONTS, + HANDLE_EMBED_SYSTEM_FONTS, + HANDLE_TAB_OVER_MARGIN, +- HANDLE_SURROUND_TEXT_WRAP_SMALL ++ HANDLE_SURROUND_TEXT_WRAP_SMALL, ++ HANDLE_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING + }; + + static MasterPropertySetInfo * lcl_createSettingsInfo() +@@ -194,6 +195,7 @@ static MasterPropertySetInfo * lcl_createSettingsInfo() + { RTL_CONSTASCII_STRINGPARAM("EmbedSystemFonts"), HANDLE_EMBED_SYSTEM_FONTS, CPPUTYPE_BOOLEAN, 0, 0}, + { RTL_CONSTASCII_STRINGPARAM("TabOverMargin"), HANDLE_TAB_OVER_MARGIN, CPPUTYPE_BOOLEAN, 0, 0}, + { RTL_CONSTASCII_STRINGPARAM("SurroundTextWrapSmall"), HANDLE_SURROUND_TEXT_WRAP_SMALL, CPPUTYPE_BOOLEAN, 0, 0}, ++ { RTL_CONSTASCII_STRINGPARAM("ApplyParagraphMarkFormatToNumbering"), HANDLE_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING, CPPUTYPE_BOOLEAN, 0, 0}, + /* + * As OS said, we don't have a view when we need to set this, so I have to + * find another solution before adding them to this property set - MTG +@@ -797,6 +799,12 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf + mpDoc->set(IDocumentSettingAccess::SURROUND_TEXT_WRAP_SMALL, bTmp); + } + break; ++ case HANDLE_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING: ++ { ++ bool bTmp = *(sal_Bool*)rValue.getValue(); ++ mpDoc->set(IDocumentSettingAccess::APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING, bTmp); ++ } ++ break; + default: + throw UnknownPropertyException(); + } +@@ -1217,6 +1225,12 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf + rValue.setValue( &bTmp, ::getBooleanCppuType() ); + } + break; ++ case HANDLE_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING: ++ { ++ sal_Bool bTmp = mpDoc->get( IDocumentSettingAccess::APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING ); ++ rValue.setValue( &bTmp, ::getBooleanCppuType() ); ++ } ++ break; + default: + throw UnknownPropertyException(); + } +diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx +index 4a520c8..98b6f9e 100644 +--- a/writerfilter/source/dmapper/DomainMapper.cxx ++++ b/writerfilter/source/dmapper/DomainMapper.cxx +@@ -106,6 +106,9 @@ LoggedStream(dmapper_logger, "DomainMapper"), + m_pImpl->SetDocumentSettingsProperty( + PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_SURROUND_TEXT_WRAP_SMALL ), + uno::makeAny( true ) ); ++ m_pImpl->SetDocumentSettingsProperty( ++ PropertyNameSupplier::GetPropertyNameSupplier().GetName( PROP_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING ), ++ uno::makeAny( true ) ); + + //import document properties + try +diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx +index 12f28aa..bacbcd3 100644 +--- a/writerfilter/source/dmapper/PropertyIds.cxx ++++ b/writerfilter/source/dmapper/PropertyIds.cxx +@@ -345,6 +345,7 @@ const OUString& PropertyNameSupplier::GetName( PropertyIds eId ) const + case PROP_PARA_SHADOW_FORMAT: sName = "ParaShadowFormat"; break; + case PROP_FOOTNOTE_LINE_RELATIVE_WIDTH: sName = "FootnoteLineRelativeWidth"; break; + case PROP_HORIZONTAL_MERGE: sName = "HorizontalMerge"; break; ++ case PROP_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING : sName = "ApplyParagraphMarkFormatToNumbering"; break; + } + ::std::pair aInsertIt = + m_pImpl->aNameMap.insert( PropertyNameMap_t::value_type( eId, sName )); +diff --git a/writerfilter/source/dmapper/PropertyIds.hxx b/writerfilter/source/dmapper/PropertyIds.hxx +index 9cdc085..a4e3621 100644 +--- a/writerfilter/source/dmapper/PropertyIds.hxx ++++ b/writerfilter/source/dmapper/PropertyIds.hxx +@@ -316,6 +316,7 @@ enum PropertyIds + ,PROP_PARA_TOP_MARGIN_BEFORE_AUTO_SPACING + ,PROP_PARA_BOTTOM_MARGIN_AFTER_AUTO_SPACING + ,PROP_HORIZONTAL_MERGE ++ ,PROP_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING + }; + struct PropertyNameSupplier_Impl; + class PropertyNameSupplier +-- +1.8.4.5 + diff --git a/discard-more-header-footer-stuff.patch b/discard-more-header-footer-stuff.patch new file mode 100644 index 0000000..625593e --- /dev/null +++ b/discard-more-header-footer-stuff.patch @@ -0,0 +1,80 @@ +From b6e5b90899f9adb62556538583763871999aa544 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= +Date: Sat, 24 May 2014 00:36:06 +0200 +Subject: [PATCH] discard more header/footer stuff when discarding + headers/footers (bnc#875718) + +782adba4d436c65cdf85d48f28486321873b15ed discards unneeded headers/footers, +but only the text, not e.g. frames or fields. The test document therefore +ends up with a frame with a page number inside the body text, because the text +in the footer it should be anchored to was discarded. This commit fixes +this by discarding more (although probably the whole header/footer +shouldn't even be parsed to begin with). + +The test from b349d2483e1fe64316d87b55d0b3b4c8f2293e2e actually checked +for this incorrect frame, so change that (the whole test is suspicious, as +the end result is quite far away from what the original doc looks like). + +(cherry picked from commit 5510f563502168defa4ccfc54214d781a7c92868) +Signed-off-by: Andras Timar + +Change-Id: I2e7192e00237db1f030d0524c5667fe92c9e496b +--- + +diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx +index 7f61328..2e6538a 100644 +--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx ++++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx +@@ -2293,6 +2293,8 @@ uno::Reference< beans::XPropertySet > DomainMapper_Impl::FindOrCreateFieldMaster + -----------------------------------------------------------------------*/ + void DomainMapper_Impl::PushFieldContext() + { ++ if(m_bDiscardHeaderFooter) ++ return; + #ifdef DEBUG_DOMAINMAPPER + dmapper_logger->element("pushFieldContext"); + #endif +@@ -2980,6 +2982,8 @@ void DomainMapper_Impl::handleToc + -----------------------------------------------------------------------*/ + void DomainMapper_Impl::CloseFieldCommand() + { ++ if(m_bDiscardHeaderFooter) ++ return; + #ifdef DEBUG_DOMAINMAPPER + dmapper_logger->element("closeFieldCommand"); + #endif +@@ -3660,6 +3664,8 @@ void DomainMapper_Impl::SetFieldFFData(FFDataHandler::Pointer_t pFFDataHandler) + -----------------------------------------------------------------------*/ + void DomainMapper_Impl::PopFieldContext() + { ++ if(m_bDiscardHeaderFooter) ++ return; + #ifdef DEBUG_DOMAINMAPPER + dmapper_logger->element("popFieldContext"); + #endif +@@ -3955,7 +3961,7 @@ void DomainMapper_Impl::RegisterFrameConversion( + bool DomainMapper_Impl::ExecuteFrameConversion() + { + bool bRet = false; +- if( m_xFrameStartRange.is() && m_xFrameEndRange.is() ) ++ if( m_xFrameStartRange.is() && m_xFrameEndRange.is() && !m_bDiscardHeaderFooter ) + { + bRet = true; + try +@@ -3971,10 +3977,10 @@ bool DomainMapper_Impl::ExecuteFrameConversion() + SAL_WARN( "writerfilter", "Exception caught when converting to frame: " + rEx.Message ); + bRet = false; + } +- m_xFrameStartRange = 0; +- m_xFrameEndRange = 0; +- m_aFrameProperties.realloc( 0 ); + } ++ m_xFrameStartRange = 0; ++ m_xFrameEndRange = 0; ++ m_aFrameProperties.realloc( 0 ); + return bRet; + } + +-- +1.8.4.5 + diff --git a/impress-table-performance.patch b/impress-table-performance.patch new file mode 100644 index 0000000..53b09d4 --- /dev/null +++ b/impress-table-performance.patch @@ -0,0 +1,134 @@ +From 894594c1ff0323f537270d1ca2dec33cdbb9b19c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Mat=C3=BA=C5=A1=20Kukan?= +Date: Tue, 27 May 2014 10:39:45 +0200 +Subject: [PATCH] Related bnc#822625: Cache minimum height for table cells. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Change-Id: I35e295347a046376289f5d4fd5468860d0b8f0ae +(cherry picked from commit 5792e76cb5beb630c135f57b74f57d74dd2dc2b0) +Reviewed-on: https://gerrit.libreoffice.org/9519 +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +--- + svx/source/table/cell.cxx | 14 +++++++++----- + svx/source/table/cell.hxx | 1 + + 2 files changed, 10 insertions(+), 5 deletions(-) + +diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx +index d4f199b..7e04db7 100644 +--- a/svx/source/table/cell.cxx ++++ b/svx/source/table/cell.cxx +@@ -358,6 +358,7 @@ Cell::Cell( SdrTableObj& rTableObj, OutlinerParaObject* pOutlinerParaObject ) th + , mbMerged( sal_False ) + , mnRowSpan( 1 ) + , mnColSpan( 1 ) ++, mnCachedMinHeight( -1 ) + , mxTable( rTableObj.getTable() ) + { + if( rTableObj.GetModel() ) +@@ -524,6 +525,7 @@ void Cell::setMerged() + + void Cell::notifyModified() + { ++ mnCachedMinHeight = -1; + if( mxTable.is() ) + mxTable->setModified( sal_True ); + } +@@ -680,8 +682,10 @@ sal_Int32 Cell::getMinimumHeight() + if( !mpProperties ) + return 0; + ++ if( mnCachedMinHeight != -1 ) ++ return mnCachedMinHeight; ++ + SdrTableObj& rTableObj = dynamic_cast< SdrTableObj& >( GetObject() ); +- sal_Int32 nMinimumHeight = 0; + + Rectangle aTextRect; + TakeTextAnchorRect( aTextRect ); +@@ -692,7 +696,7 @@ sal_Int32 Cell::getMinimumHeight() + if(pEditOutliner) + { + pEditOutliner->SetMaxAutoPaperSize(aSize); +- nMinimumHeight = pEditOutliner->GetTextHeight()+1; ++ mnCachedMinHeight = pEditOutliner->GetTextHeight()+1; + } + else /*if ( hasText() )*/ + { +@@ -705,12 +709,12 @@ sal_Int32 Cell::getMinimumHeight() + { + rOutliner.SetText(*GetOutlinerParaObject()); + } +- nMinimumHeight=rOutliner.GetTextHeight()+1; ++ mnCachedMinHeight=rOutliner.GetTextHeight()+1; + rOutliner.Clear(); + } + +- nMinimumHeight += GetTextUpperDistance() + GetTextLowerDistance(); +- return nMinimumHeight; ++ mnCachedMinHeight += GetTextUpperDistance() + GetTextLowerDistance(); ++ return mnCachedMinHeight; + } + + // ----------------------------------------------------------------------------- +diff --git a/svx/source/table/cell.hxx b/svx/source/table/cell.hxx +index 1b26b1c..ba2c6f6 100644 +--- a/svx/source/table/cell.hxx ++++ b/svx/source/table/cell.hxx +@@ -222,6 +222,7 @@ private: + ::sal_Bool mbMerged; + ::sal_Int32 mnRowSpan; + ::sal_Int32 mnColSpan; ++ ::sal_Int32 mnCachedMinHeight; + + Rectangle maCellRect; + +-- +1.8.4.5 + +From 20fc8dfadada521bed3cb9db672edcdf35db3c39 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Mat=C3=BA=C5=A1=20Kukan?= +Date: Tue, 27 May 2014 16:37:30 +0200 +Subject: [PATCH] Related bnc#822625: Cache FontEntry with the original + FontSelectPattern. + +Otherwise we do not hit cache directly, only after expensive call to +ImplFindByFont. + +(cherry picked from commits a6b00d16eb27a5e7e31c721671001a909ecef960 +and 16a62079018aea0e72636bdb00576487b4e830b9) + +Change-Id: If15b368feeba94c8fff8ee7cbe049fc4a2069768 +--- + vcl/source/gdi/outdev3.cxx | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx +index 537f8aa..a36fc85 100644 +--- a/vcl/source/gdi/outdev3.cxx ++++ b/vcl/source/gdi/outdev3.cxx +@@ -2214,6 +2214,7 @@ ImplFontEntry* ImplFontCache::GetFontEntry( ImplDevFontList* pFontList, + ImplFontEntry* ImplFontCache::GetFontEntry( ImplDevFontList* pFontList, + FontSelectPattern& aFontSelData, ImplDirectFontSubstitution* pDevSpecific ) + { ++ FontSelectPattern aFontSelDataOrig(aFontSelData); + // check if a directly matching logical font instance is already cached, + // the most recently used font usually has a hit rate of >50% + ImplFontEntry *pEntry = NULL; +@@ -2300,8 +2301,9 @@ ImplFontEntry* ImplFontCache::GetFontEntry( ImplDevFontList* pFontList, + } + #endif + +- // add the new entry to the cache +- maFontInstanceList[ aFontSelData ] = pEntry; ++ // Add the new entry to the cache with the original FontSelectPattern, ++ // so that we can find it next time as a direct cache hit. ++ maFontInstanceList[ aFontSelDataOrig ] = pEntry; + } + + mpFirstEntry = pEntry; +-- +1.8.4.5 + diff --git a/libreoffice.changes b/libreoffice.changes index 7bbce2c..dd8febe 100644 --- a/libreoffice.changes +++ b/libreoffice.changes @@ -1,3 +1,33 @@ +------------------------------------------------------------------- +Fri May 30 09:55:57 UTC 2014 - andras.timar@collabora.com + +- bnc#822625 - LO-L3: Table editing is a pain in Impress (performace issues) + * impress-table-performance.patch + +------------------------------------------------------------------- +Fri May 30 09:30:28 UTC 2014 - andras.timar@collabora.com + +- bnc#863018 - LO-L3: Missing text in imported .doc file + * WW8-import-fix-upper-margin-of-multi-page.patch + +------------------------------------------------------------------- +Fri May 30 09:25:45 UTC 2014 - andras.timar@collabora.com + +- bnc#875717 - LO-L3: DOCX import: font size of numbering is bigger + * direct-format-numbering.patch + +------------------------------------------------------------------- +Fri May 30 09:21:31 UTC 2014 - andras.timar@collabora.com + +- bnc#875718 - LO-L3: DOCX import: extra page numbers + * discard-more-header-footer-stuff.patch + +------------------------------------------------------------------- +Fri May 30 07:33:54 UTC 2014 - andras.timar@collabora.com + +- Security update CVE-2014-0247 + * Use-varying-aElement-name.patch + ------------------------------------------------------------------- Fri May 23 18:49:38 UTC 2014 - andras.timar@collabora.com diff --git a/libreoffice.spec b/libreoffice.spec index 76cd01c..30db29f 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -108,6 +108,16 @@ Patch26: docx-brightness-contrast-1.diff Patch27: docx-brightness-contrast-2.diff # bnc#467278: Introduce a warning that changes to VBA macros cannot be saved. Patch28: VBA-macro-modification-warning.diff +# CVE-2014-0247 +Patch29: Use-varying-aElement-name.patch +# bnc#875718 - LO-L3: DOCX import: extra page numbers +Patch30: discard-more-header-footer-stuff.patch +# bnc#875717 - LO-L3: DOCX import: font size of numbering is bigger +Patch31: direct-format-numbering.patch +# bnc#863018 - LO-L3: Missing text in imported .doc file +Patch32: WW8-import-fix-upper-margin-of-multi-page.patch +# bnc#822625 - LO-L3: Table editing is a pain in Impress (performace issues) +Patch33: impress-table-performance.patch # try to save space by using hardlinks Patch990: install-with-hardlinks.diff BuildRequires: ImageMagick @@ -879,6 +889,11 @@ Provides additional %{langname} translations and resources for %{project}. \ %patch26 -p1 %patch27 -p1 %patch28 -p1 +%patch29 -p1 +%patch30 -p1 +%patch31 -p1 +%patch32 -p1 +%patch33 -p1 %patch990 -p1 # 256x256 icons tar -xjf %{SOURCE20}