From f0633dd7d6b0029fb6a224ef7d14e9b88eb18692 Mon Sep 17 00:00:00 2001 From: CentOS Buildsys Date: Jan 26 2014 13:06:54 +0000 Subject: import libreoffice-4.1.4.2-3.el7.src.rpm --- diff --git a/.libreoffice.metadata b/.libreoffice.metadata index 9ed7464..797f6d9 100644 --- a/.libreoffice.metadata +++ b/.libreoffice.metadata @@ -1,10 +1,10 @@ -0855ebef85ecad5f28c7b9d6f872d7c1d40e50be SOURCES/libreoffice-4.1.3.2.tar.xz 1acea86fd399ed7817879d36370d3d1f8b109050 SOURCES/35c94d2df8893241173de1d16b6034c0-swingExSrc.zip +9204484e084f9dde2db105ed09a40c0d2773b7eb SOURCES/libreoffice-translations-4.1.4.2.tar.xz 7168b0f40aa5c72267899601c116d2348d2f56ec SOURCES/17410483b5b5f267aa18b7e00b65e6e0-hsqldb_1_8_0.zip 452eba922e4f41603539c9dc39947d2271e47093 SOURCES/0168229624cfac409e766913506961a8-ucpp-1.3.2.tar.gz -f5ed5424a50bc24761e7255b73079ad134eb164e SOURCES/libreoffice-translations-4.1.3.2.tar.xz +c268cebd2666f27dc96eed369f80b2497b4d98d5 SOURCES/libreoffice-help-4.1.4.2.tar.xz 8a90669029e107b61953b90ba11545fef586c2ca SOURCES/798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip 2d49e11b0b711970f494294dc3698f05eb294853 SOURCES/a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip 8f949ae74a6d66278a595bd063f13e0ad196d14a SOURCES/1f24ab1d39f4a51faf22244c94a6203f-xmlsec1-1.2.14.tar.gz -2873a84f858743f4a1ce753a6bbcf80a8d4c4a03 SOURCES/libreoffice-help-4.1.3.2.tar.xz 0619ed3a89644bef318df67db12045b2b590585b SOURCES/185d60944ea767075d27247c3162b3bc-unowinreg.dll +cf6da298d213796310cecbb2d4b991b139f86ffd SOURCES/libreoffice-4.1.4.2.tar.xz diff --git a/SOURCES/0001-Related-rhbz-1020712-wrong-default-font-shown-in-edi.patch b/SOURCES/0001-Related-rhbz-1020712-wrong-default-font-shown-in-edi.patch deleted file mode 100644 index fc4ae38..0000000 --- a/SOURCES/0001-Related-rhbz-1020712-wrong-default-font-shown-in-edi.patch +++ /dev/null @@ -1,134 +0,0 @@ -From e3bde35198d8a5420b7106c983766b88ccfba51a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Fri, 18 Oct 2013 15:36:28 +0100 -Subject: [PATCH] Related: rhbz#1020712 wrong default font shown in editengine - -Only in editengine could we have this fiasco. - -There are two ImpEditEngine::GetScriptType's - -a) sal_uInt16 ImpEditEngine::GetScriptType(const EditPaM& rPaM, sal_uInt16* pEndPos) const -this one returns i18n::ScriptType - -b) sal_uInt16 ImpEditEngine::GetScriptType(const EditSelection& rSel) const -this one returns SCRIPTTYPE - -Could there be a better way to ensure that mistakes will be made. - -Anyway, within variant b, with an empty edit engine -ImpEditEngine::GetScriptType calls GetI18NScriptTypeOfLanguage but *that* -returns i18n::ScriptType's not SCRIPTTYPEs but when there is content then a -SCRIPTTYPE is truly returned. - -Change-Id: I3a4a7c8746728e0fdfb25d961004c8339a24c93d -(cherry picked from commit e63a0d5657c7b9c7431525ba669b3edab0e56af3) - -Related: rhbz#1020712 more i18n::ScriptType being compared against SCRIPTTYPE - -Change-Id: I5da9114a3fd8330df2b63dc9187323765d305791 -(cherry picked from commit b57ffef61afd61b57087150b1a9245e21079e15b) - -Resolves: rhbz#1020712 return all the selected scripts - -What we want here is *all* the scripts in the range, that's the whole point of -using SCRIPTTYPE. We use this to determine the font to show in the fontbox. If -it's an exclusive script then we can show the font that that script, and if -there are multiple scripts we know to set it empty. - -With the other intermediate bugs out of the way, this now appears to work -correctly. - -(cherry picked from commit f1a8aefec91f51a15c951f53f283a38a2edcd141) - -Conflicts: - editeng/source/editeng/impedit2.cxx - -Change-Id: I58426123602d70c151bd878e96fa5cbab7d3fd3e ---- - editeng/source/editeng/impedit2.cxx | 39 ++++++++++++++++++++----------------- - editeng/source/editeng/impedit4.cxx | 4 ++-- - 2 files changed, 23 insertions(+), 20 deletions(-) - -diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx -index 4bc6d70..21d0d32 100644 ---- a/editeng/source/editeng/impedit2.cxx -+++ b/editeng/source/editeng/impedit2.cxx -@@ -1788,32 +1788,35 @@ sal_uInt16 ImpEditEngine::GetScriptType( const EditSelection& rSel ) const - - const ScriptTypePosInfos& rTypes = pParaPortion->aScriptInfos; - -- // find the first(!) script type position that holds the -- // complete selection. Thus it will work for selections as -- // well as with just moving the cursor from char to char. -+ // find all the scripts of this range - sal_uInt16 nS = ( nPara == nStartPara ) ? aSel.Min().GetIndex() : 0; - sal_uInt16 nE = ( nPara == nEndPara ) ? aSel.Max().GetIndex() : pParaPortion->GetNode()->Len(); -- for ( size_t n = 0; n < rTypes.size(); n++ ) -+ -+ //no selection, just bare cursor -+ if (nStartPara == nEndPara && nS == nE) - { -- if (rTypes[n].nStartPos <= nS && nE <= rTypes[n].nEndPos) -- { -+ //If we are not at the start of the paragraph we want the properties of the -+ //preceding character. Otherwise get the properties of the next (or what the -+ //next would have if it existed) -+ if (nS != 0) -+ --nS; -+ else -+ ++nE; -+ } -+ -+ for (size_t n = 0; n < rTypes.size(); ++n) -+ { -+ bool bStartInRange = rTypes[n].nStartPos <= nS && nS < rTypes[n].nEndPos; -+ bool bEndInRange = rTypes[n].nStartPos < nE && nE <= rTypes[n].nEndPos; -+ -+ if (bStartInRange || bEndInRange) -+ { - if ( rTypes[n].nScriptType != i18n::ScriptType::WEAK ) -- { - nScriptType |= GetItemScriptType ( rTypes[n].nScriptType ); -- } -- else -- { -- if ( !nScriptType && n ) -- { -- // #93548# When starting with WEAK, use prev ScriptType... -- nScriptType = rTypes[n-1].nScriptType; -- } -- } -- break; - } - } - } -- return nScriptType ? nScriptType : GetI18NScriptTypeOfLanguage( GetDefaultLanguage() ); -+ return nScriptType ? nScriptType : SvtLanguageOptions::GetScriptTypeOfLanguage( GetDefaultLanguage() ); - } - - sal_Bool ImpEditEngine::IsScriptChange( const EditPaM& rPaM ) const -diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx -index 39e8156..5e0fa09 100644 ---- a/editeng/source/editeng/impedit4.cxx -+++ b/editeng/source/editeng/impedit4.cxx -@@ -2124,7 +2124,7 @@ void ImpEditEngine::ApplyChangedSentence(EditView& rEditView, - rEditView.pImpEditView->SetEditSelection( aCurrentOldPosition->Max() ); - } - -- sal_uInt16 nScriptType = GetI18NScriptTypeOfLanguage( aCurrentNewPortion->eLanguage ); -+ sal_uInt16 nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage( aCurrentNewPortion->eLanguage ); - sal_uInt16 nLangWhichId = EE_CHAR_LANGUAGE; - switch(nScriptType) - { -@@ -2171,7 +2171,7 @@ void ImpEditEngine::ApplyChangedSentence(EditView& rEditView, - LanguageType eCurLanguage = GetLanguage( aCurrentPaM ); - if(eCurLanguage != aCurrentNewPortion->eLanguage) - { -- sal_uInt16 nScriptType = GetI18NScriptTypeOfLanguage( aCurrentNewPortion->eLanguage ); -+ sal_uInt16 nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage( aCurrentNewPortion->eLanguage ); - sal_uInt16 nLangWhichId = EE_CHAR_LANGUAGE; - switch(nScriptType) - { --- -1.8.3.1 - diff --git a/SOURCES/0001-Related-rhbz-968892-discard-impossible-languages-for.patch b/SOURCES/0001-Related-rhbz-968892-discard-impossible-languages-for.patch deleted file mode 100644 index 8bfe9a0..0000000 --- a/SOURCES/0001-Related-rhbz-968892-discard-impossible-languages-for.patch +++ /dev/null @@ -1,68 +0,0 @@ -From b5bd2d1d8d09a44af354584ff187d9e935ffd973 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Tue, 4 Jun 2013 17:13:13 +0100 -Subject: [PATCH] Related: rhbz#968892 discard impossible languages for glyph - fallback - -Change-Id: I14f1bab09eb0be9c2c896a1dde45913b99aab6df ---- - vcl/generic/fontmanager/fontconfig.cxx | 39 ++++++++++++++++++++++++++++++++++ - 1 file changed, 39 insertions(+) - -diff --git a/vcl/generic/fontmanager/fontconfig.cxx b/vcl/generic/fontmanager/fontconfig.cxx -index 1b36980..ff471fa 100644 ---- a/vcl/generic/fontmanager/fontconfig.cxx -+++ b/vcl/generic/fontmanager/fontconfig.cxx -@@ -847,6 +847,41 @@ - #endif - } - -+ //returns true if the given code-point couldn't possibly be in rLangTag. -+ bool isImpossibleCodePointForLang(const LanguageTag &rLangTag, sal_uInt32 currentChar) -+ { -+ //a non-default script is set, lets believe it -+ if (rLangTag.hasScript()) -+ return false; -+ -+ int32_t script = u_getIntPropertyValue(currentChar, UCHAR_SCRIPT); -+ UScriptCode eScript = static_cast(script); -+ bool bIsImpossible = false; -+ OUString sLang = rLangTag.getLanguage(); -+ switch (eScript) -+ { -+ case USCRIPT_TELUGU: -+ bIsImpossible = sLang != "te"; -+ break; -+ case USCRIPT_BENGALI: -+ bIsImpossible = sLang != "bn" && -+ sLang != "as" && sLang != "mkb" && -+ sLang != "kfv" && sLang != "ccp" && -+ sLang != "tnv" && sLang != "ctg" && -+ sLang != "haj" && sLang != "ksy" && -+ sLang != "rkt" && sLang != "rjs" && -+ sLang != "rhg" && sLang != "syl" && -+ sLang != "kyv" && sLang != "zrg" && -+ sLang != "nhh"; -+ break; -+ default: -+ break; -+ } -+ SAL_WARN_IF(bIsImpossible, "vcl", "Throwing away user set language of " -+ << sLang << " for finding a font for glyph fallback and autodetecting instead"); -+ return bIsImpossible; -+ } -+ - LanguageTag getExemplerLangTagForCodePoint(sal_uInt32 currentChar) - { - int32_t script = u_getIntPropertyValue(currentChar, UCHAR_SCRIPT); -@@ -954,6 +989,10 @@ - // also handle unicode surrogates - const sal_uInt32 nCode = rMissingCodes.iterateCodePoints( &nStrIndex ); - FcCharSetAddChar( unicodes, nCode ); -+ //if the codepoint is impossible for this lang tag, then clear it -+ //and autodetect something useful -+ if (!aLangAttrib.isEmpty() && isImpossibleCodePointForLang(aLangTag, nCode)) -+ aLangAttrib = OString(); - //#i105784#/rhbz#527719 improve selection of fallback font - if (aLangAttrib.isEmpty()) - { diff --git a/SOURCES/0001-Resolves-rhbz-968892-force-render-full-grapheme-with.patch b/SOURCES/0001-Resolves-rhbz-968892-force-render-full-grapheme-with.patch deleted file mode 100644 index 6f6f7da..0000000 --- a/SOURCES/0001-Resolves-rhbz-968892-force-render-full-grapheme-with.patch +++ /dev/null @@ -1,138 +0,0 @@ -From 78f93c2ef1acd324c289286fe3c13a429340839b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Tue, 4 Jun 2013 15:48:23 +0100 -Subject: [PATCH] Resolves: rhbz#968892 force render full grapheme with - fallback font - -Change-Id: I5bb98c61d047e69d74666261b2c489d80f344502 ---- - vcl/generic/glyphs/gcach_layout.cxx | 61 ++++++++++++++++++++++--------------- - vcl/inc/generic/glyphcache.hxx | 5 +++ - 2 files changed, 42 insertions(+), 24 deletions(-) - -diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx -index 4fd4cf4..3c3c6de 100644 ---- a/vcl/generic/glyphs/gcach_layout.cxx -+++ b/vcl/generic/glyphs/gcach_layout.cxx -@@ -41,6 +41,10 @@ - #include - #include - -+#include -+#include -+#include -+ - // ======================================================================= - // layout implementation for ServerFont - // ======================================================================= -@@ -90,23 +94,42 @@ void ServerFontLayout::AdjustLayout( ImplLayoutArgs& rArgs ) - } - } - --// ======================================================================= -- --static bool lcl_CharIsJoiner(sal_Unicode cChar) -+void ServerFontLayout::setNeedFallback(ImplLayoutArgs& rArgs, sal_Int32 nCharPos, -+ bool bRightToLeft) - { -- return ((cChar == 0x200C) || (cChar == 0x200D)); --} -+ if (nCharPos < 0) -+ return; - --static bool needPreviousCode(sal_Unicode cChar) --{ -- return lcl_CharIsJoiner(cChar) || U16_IS_LEAD(cChar); --} -+ using namespace ::com::sun::star; - --static bool needNextCode(sal_Unicode cChar) --{ -- return lcl_CharIsJoiner(cChar) || U16_IS_TRAIL(cChar); -+ if (!mxBreak.is()) -+ { -+ uno::Reference< lang::XMultiServiceFactory > xFactory = -+ comphelper::getProcessServiceFactory(); -+ mxBreak = uno::Reference< i18n::XBreakIterator >(xFactory->createInstance( -+ "com.sun.star.i18n.BreakIterator"), uno::UNO_QUERY); -+ } -+ -+ LanguageTag aLangTag(rArgs.meLanguage); -+ lang::Locale aLocale(aLangTag.getLocale()); -+ -+ //if position nCharPos is missing in the font, grab the entire grapheme and -+ //mark all glyphs as missing so the whole thing is rendered with the same -+ //font -+ OUString aRun(rArgs.mpStr); -+ sal_Int32 nDone; -+ sal_Int32 nGraphemeStartPos = -+ mxBreak->previousCharacters(aRun, nCharPos+1, aLocale, -+ i18n::CharacterIteratorMode::SKIPCELL, 1, nDone); -+ sal_Int32 nGraphemeEndPos = -+ mxBreak->nextCharacters(aRun, nCharPos, aLocale, -+ i18n::CharacterIteratorMode::SKIPCELL, 1, nDone); -+ -+ rArgs.NeedFallback(nGraphemeStartPos, nGraphemeEndPos, bRightToLeft); - } - -+// ======================================================================= -+ - std::ostream &operator <<(std::ostream& s, ServerFont* pFont) - { - #ifndef SAL_LOG_INFO -@@ -401,9 +424,7 @@ bool HbLayoutEngine::layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs) - // if needed request glyph fallback by updating LayoutArgs - if (!nGlyphIndex) - { -- if (nCharPos >= 0) -- rArgs.NeedFallback(nCharPos, bRightToLeft); -- -+ rLayout.setNeedFallback(rArgs, nCharPos, bRightToLeft); - if (SAL_LAYOUT_FOR_FALLBACK & rArgs.mnFlags) - continue; - } -@@ -1006,15 +1027,7 @@ bool IcuLayoutEngine::layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs) - // if needed request glyph fallback by updating LayoutArgs - if( !nGlyphIndex ) - { -- if( nCharPos >= 0 ) -- { -- rArgs.NeedFallback( nCharPos, bRightToLeft ); -- if ( (nCharPos > 0) && needPreviousCode(rArgs.mpStr[nCharPos-1]) ) -- rArgs.NeedFallback( nCharPos-1, bRightToLeft ); -- else if ( (nCharPos + 1 < nEndRunPos) && needNextCode(rArgs.mpStr[nCharPos+1]) ) -- rArgs.NeedFallback( nCharPos+1, bRightToLeft ); -- } -- -+ rLayout.setNeedFallback(rArgs, nCharPos, bRightToLeft); - if( SAL_LAYOUT_FOR_FALLBACK & rArgs.mnFlags ) - continue; - } -diff --git a/vcl/inc/generic/glyphcache.hxx b/vcl/inc/generic/glyphcache.hxx -index a7363f9..d6cdee1 100644 ---- a/vcl/inc/generic/glyphcache.hxx -+++ b/vcl/inc/generic/glyphcache.hxx -@@ -37,6 +37,7 @@ - #include - #include - #include -+#include - - namespace basegfx { class B2DPolyPolygon; } - -@@ -311,6 +312,7 @@ - { - private: - ServerFont& mrServerFont; -+ com::sun::star::uno::Reference mxBreak; - - // enforce proper copy semantic - SAL_DLLPRIVATE ServerFontLayout( const ServerFontLayout& ); -@@ -324,5 +326,7 @@ - virtual void AdjustLayout( ImplLayoutArgs& ); - virtual void DrawText( SalGraphics& ) const; -+ void setNeedFallback(ImplLayoutArgs& rArgs, sal_Int32 nIndex, -+ bool bRightToLeft); - ServerFont& GetServerFont() const { return mrServerFont; } - }; - diff --git a/SOURCES/0001-Resolves-rhbz-996162-apparent-NULL-bullet-font.patch b/SOURCES/0001-Resolves-rhbz-996162-apparent-NULL-bullet-font.patch deleted file mode 100644 index bc27af2..0000000 --- a/SOURCES/0001-Resolves-rhbz-996162-apparent-NULL-bullet-font.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 166510ed48bf49b75a031ce973f41d08fb4e4518 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Thu, 22 Aug 2013 15:29:10 +0100 -Subject: [PATCH] Resolves: rhbz#996162 apparent NULL bullet font - -Change-Id: I2f50ef1dabe2f152f2e18025edc88734158dbea2 ---- - editeng/source/outliner/outliner.cxx | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx -index cb27c69..49465fb 100644 ---- a/editeng/source/outliner/outliner.cxx -+++ b/editeng/source/outliner/outliner.cxx -@@ -897,9 +897,15 @@ Font Outliner::ImpCalcBulletFont( sal_Int32 nPara ) const - } - - Font aBulletFont; -+ const Font *pSourceFont = 0; - if ( pFmt->GetNumberingType() == SVX_NUM_CHAR_SPECIAL ) - { -- aBulletFont = *pFmt->GetBulletFont(); -+ pSourceFont = pFmt->GetBulletFont(); -+ } -+ -+ if (pSourceFont) -+ { -+ aBulletFont = *pSourceFont; - } - else - { --- -1.8.3.1 - diff --git a/SOURCES/0001-WaE-Wstrict-overflow-assuming-signed-overflow-does-n.patch b/SOURCES/0001-WaE-Wstrict-overflow-assuming-signed-overflow-does-n.patch deleted file mode 100644 index 4c416c7..0000000 --- a/SOURCES/0001-WaE-Wstrict-overflow-assuming-signed-overflow-does-n.patch +++ /dev/null @@ -1,33 +0,0 @@ -From ca576e0804324bbb36b697543cbe992e34d4b951 Mon Sep 17 00:00:00 2001 -From: Eike Rathke -Date: Mon, 7 Oct 2013 21:51:26 +0200 -Subject: [PATCH] WaE [-Wstrict-overflow] assuming signed overflow does not - occur - -... when assuming that (X - c) <= X is always true -... or that (X + c) < X is always false - -Change-Id: Ib2313827cd6358ced0141b41cba753896b676e28 ---- - svtools/source/contnr/imivctl1.cxx | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx -index 1cd006b..0685bc3 100644 ---- a/svtools/source/contnr/imivctl1.cxx -+++ b/svtools/source/contnr/imivctl1.cxx -@@ -2710,9 +2710,9 @@ Rectangle SvxIconChoiceCtrl_Impl::CalcFocusRect( SvxIconChoiceCtrlEntry* pEntry - Rectangle aFocusRect( aBoundRect.Left(), aBmpRect.Top() - 1, - aBoundRect.Right() - 4, aTextRect.Bottom() + 1 ); - // the focus rectangle should not touch the text -- if( aFocusRect.Left() - 1 >= pEntry->aRect.Left() ) -+ if( aFocusRect.Left() > ::std::numeric_limits::min() && aFocusRect.Left() - 1 >= pEntry->aRect.Left() ) - aFocusRect.Left()--; -- if( aFocusRect.Right() + 1 <= pEntry->aRect.Right() ) -+ if( aFocusRect.Right() < ::std::numeric_limits::max() && aFocusRect.Right() + 1 <= pEntry->aRect.Right() ) - aFocusRect.Right()++; - - return aFocusRect; --- -1.8.3.1 - diff --git a/SOURCES/0001-fdo-67725-unoidl-AggregatingCursor-must-wrap-modules.patch b/SOURCES/0001-fdo-67725-unoidl-AggregatingCursor-must-wrap-modules.patch deleted file mode 100644 index 8a840ea..0000000 --- a/SOURCES/0001-fdo-67725-unoidl-AggregatingCursor-must-wrap-modules.patch +++ /dev/null @@ -1,172 +0,0 @@ -From f450c132e6a65e1d11f20595bb0bfbf786e1dc2d Mon Sep 17 00:00:00 2001 -From: Stephan Bergmann -Date: Thu, 24 Oct 2013 09:48:13 +0200 -Subject: [PATCH] fdo#67725 unoidl::AggregatingCursor must wrap modules for - aggregation, too - -Otherwise cppuhelper::TypeManager::createTypeDescriptionEnumeration, sitting on -top such an AggregatingCursor, will miss any entities from provider P' in module -M if any previous provider P contains the same module M. - -That happened when climaker generates cli_oootypes.dll, where the enumeration -missed everything from offapi in top-level module "com" because it had already -seen udkapi's "com", and only reported the handful of entities under offapi's -other top-level module "org" (which does not appear in udkapi). - -Change-Id: If538391bde22bcc346417b5988cf12023f0d4172 -(cherry picked from commit bdd55e28fc7788c2968daaf87b782f8e6189ee2d) ---- - unoidl/source/unoidl.cxx | 112 +++++++++++++++++++++++++++++++++-------------- - 1 file changed, 78 insertions(+), 34 deletions(-) - -diff --git a/unoidl/source/unoidl.cxx b/unoidl/source/unoidl.cxx -index a9939e4..c55e02b 100644 ---- a/unoidl/source/unoidl.cxx -+++ b/unoidl/source/unoidl.cxx -@@ -23,41 +23,101 @@ namespace unoidl { - - namespace { - -+class AggregatingModule: public ModuleEntity { -+public: -+ AggregatingModule( -+ std::vector< rtl::Reference< Provider > > const & providers, -+ OUString const & name): -+ providers_(providers), name_(name) -+ {} -+ -+private: -+ virtual ~AggregatingModule() throw () {} -+ -+ virtual std::vector< OUString > getMemberNames() const; -+ -+ virtual rtl::Reference< MapCursor > createCursor() const; -+ -+ std::vector< rtl::Reference< Provider > > providers_; -+ OUString name_; -+}; -+ -+std::vector< OUString > AggregatingModule::getMemberNames() const { -+ std::set< OUString > names; -+ for (std::vector< rtl::Reference< Provider > >::const_iterator i( -+ providers_.begin()); -+ i != providers_.end(); ++i) -+ { -+ rtl::Reference< Entity > ent((*i)->findEntity(name_)); -+ if (ent.is() && ent->getSort() == Entity::SORT_MODULE) { -+ std::vector< OUString > ns( -+ static_cast< ModuleEntity * >(ent.get())->getMemberNames()); -+ names.insert(ns.begin(), ns.end()); -+ } -+ } -+ return std::vector< OUString >(names.begin(), names.end()); -+} -+ - class AggregatingCursor: public MapCursor { - public: - AggregatingCursor( -- std::vector< rtl::Reference< MapCursor > > const & cursors): -- cursors_(cursors), iterator_(cursors_.begin()) -- {} -+ std::vector< rtl::Reference< Provider > > const & providers, -+ OUString const & name): -+ providers_(providers), name_(name), iterator_(providers_.begin()) -+ { findCursor(); } - - private: - virtual ~AggregatingCursor() throw () {} - -- virtual rtl::Reference< Entity > getNext(rtl::OUString * name); -+ virtual rtl::Reference< Entity > getNext(OUString * name); - -- std::vector< rtl::Reference< MapCursor > > cursors_; -- std::vector< rtl::Reference< MapCursor > >::iterator iterator_; -- std::set< rtl::OUString > seenMembers; -+ void findCursor(); -+ -+ std::vector< rtl::Reference< Provider > > providers_; -+ OUString name_; -+ std::vector< rtl::Reference< Provider > >::iterator iterator_; -+ rtl::Reference< MapCursor > cursor_; -+ std::set< OUString > seen_; - }; - --rtl::Reference< Entity > AggregatingCursor::getNext(rtl::OUString * name) { -- for (;;) { -- if (iterator_ == cursors_.end()) { -- return rtl::Reference< Entity >(); -- } -- rtl::OUString n; -- rtl::Reference< Entity > ent((*iterator_)->getNext(&n)); -+rtl::Reference< Entity > AggregatingCursor::getNext(OUString * name) { -+ while (cursor_.is()) { -+ OUString n; -+ rtl::Reference< Entity > ent(cursor_->getNext(&n)); - if (ent.is()) { -- if (seenMembers.insert(n).second) { -+ if (seen_.insert(n).second) { - if (name != 0) { - *name = n; - } -- return ent; -+ return ent->getSort() == Entity::SORT_MODULE -+ ? new AggregatingModule( -+ providers_, (name_.isEmpty() ? name_ : name_ + ".") + n) -+ : ent; - } - } else { -- ++iterator_; -+ cursor_.clear(); -+ findCursor(); - } - } -+ return rtl::Reference< Entity >(); -+} -+ -+void AggregatingCursor::findCursor() { -+ for (; !cursor_.is() && iterator_ != providers_.end(); ++iterator_) { -+ if (name_.isEmpty()) { -+ cursor_ = (*iterator_)->createRootCursor(); -+ } else { -+ rtl::Reference< Entity > ent((*iterator_)->findEntity(name_)); -+ if (ent.is() && ent->getSort() == Entity::SORT_MODULE) { -+ cursor_ = static_cast< ModuleEntity * >(ent.get())-> -+ createCursor(); -+ } -+ } -+ } -+} -+ -+rtl::Reference< MapCursor > AggregatingModule::createCursor() const { -+ return new AggregatingCursor(providers_, name_); - } - - } -@@ -139,23 +199,7 @@ rtl::Reference< Entity > Manager::findEntity(rtl::OUString const & name) const { - rtl::Reference< MapCursor > Manager::createCursor(rtl::OUString const & name) - const - { -- std::vector< rtl::Reference< MapCursor > > curs; -- for (std::vector< rtl::Reference< Provider > >::const_iterator i( -- providers_.begin()); -- i != providers_.end(); ++i) -- { -- if (name.isEmpty()) { -- curs.push_back((*i)->createRootCursor()); -- } else { -- rtl::Reference< Entity > ent((*i)->findEntity(name)); -- if (ent.is() && ent->getSort() == Entity::SORT_MODULE) { -- curs.push_back( -- static_cast< ModuleEntity * >(ent.get())->createCursor()); -- } -- } -- } -- return curs.empty() -- ? rtl::Reference< MapCursor >() : new AggregatingCursor(curs); -+ return new AggregatingCursor(providers_, name); - } - - Manager::~Manager() throw () {} --- -1.8.3.1 - diff --git a/SOURCES/0001-fdo-70201-sw-eliminate-no-extent-RSID-only-AUTOFMT-h.patch b/SOURCES/0001-fdo-70201-sw-eliminate-no-extent-RSID-only-AUTOFMT-h.patch deleted file mode 100644 index 1bf72b4..0000000 --- a/SOURCES/0001-fdo-70201-sw-eliminate-no-extent-RSID-only-AUTOFMT-h.patch +++ /dev/null @@ -1,45 +0,0 @@ -From a79a7f315a0a3bc8148a88bb1d3c6f83a4552094 Mon Sep 17 00:00:00 2001 -From: Michael Stahl -Date: Tue, 8 Oct 2013 18:37:35 +0200 -Subject: [PATCH] fdo#70201: sw: eliminate no-extent RSID-only AUTOFMT hints - -These are already filtered out in SwpHints::TryInsertHint(), but they -can be produced by a SwTxtNode::Update() following some deletion like in -SwTxtNode::ReplaceText() (or maybe CutImpl() and RstAttr() too?). - -So in order to prevent SwHistorySetTxt being created for these, -filter them out in SwpHints::MergePortions(), which has the advantage -that it's one location to change; probably filtering in Update() and -RstAttr() both would work too. - -(regression from 6db39dbd7378351f6476f6db25eb7110c9cfb291) - -Change-Id: I597a9ab290dcc3fb1b624dd2dca241c462acf256 -(cherry picked from commit 91159b1c31a7fd474ba0b97828f593604790ce3c) ---- - sw/source/core/txtnode/thints.cxx | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx -index 0893dac..34dac0a 100644 ---- a/sw/source/core/txtnode/thints.cxx -+++ b/sw/source/core/txtnode/thints.cxx -@@ -2528,6 +2528,15 @@ bool SwpHints::MergePortions( SwTxtNode& rNode ) - pHt->GetAutoFmt().GetStyleHandle()); - if ((pSet->Count() == 1) && pSet->GetItem(RES_CHRATR_RSID, false)) - { -+ // fdo#70201: eliminate no-extent RSID-only AUTOFMT -+ // could be produced by ReplaceText or (maybe?) RstAttr -+ if (*pHt->GetStart() == *pHt->GetEnd()) -+ { -+ SwpHintsArray::DeleteAtPos(i); // kill it without History! -+ SwTxtAttr::Destroy(pHt, rNode.GetDoc()->GetAttrPool()); -+ --i; -+ continue; -+ } - // fdo#52028: this one has _only_ RSID => ignore it completely - if (!pHt->IsFormatIgnoreStart() || !pHt->IsFormatIgnoreEnd()) - { --- -1.8.3.1 - diff --git a/SOURCES/0001-fdo-70968-Incorrect-rendering-of-Devanagari-short-i-.patch b/SOURCES/0001-fdo-70968-Incorrect-rendering-of-Devanagari-short-i-.patch deleted file mode 100644 index 391227f..0000000 --- a/SOURCES/0001-fdo-70968-Incorrect-rendering-of-Devanagari-short-i-.patch +++ /dev/null @@ -1,98 +0,0 @@ -From 71077148d442b3bbfeefd9a572942946c6a95823 Mon Sep 17 00:00:00 2001 -From: Khaled Hosny -Date: Wed, 30 Oct 2013 09:34:38 +0200 -Subject: [PATCH] fdo#70968: Incorrect rendering of Devanagari short 'i' vowel - -It seems that some Indic fonts assign 'mark' glyph class to combining -spacing marks (spacing not non spacing) so my reliance on the glyph -class to set the IS_DIACRITIC flags broke those fonts. This is a bandaid -to get around the issue, plus some long rant! (at this rate, I'll be -writing "The VCL haters handbook" pretty soon). - -Change-Id: I3ff892acf746d50182573f94e7e8c3c6f9464ae0 ---- - vcl/generic/glyphs/gcach_layout.cxx | 26 +++++++++++++++++++++----- - vcl/source/gdi/sallayout.cxx | 21 +++++++++++++++++++++ - 2 files changed, 42 insertions(+), 5 deletions(-) - -diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx -index 4673931..7a8bfc9 100644 ---- a/vcl/generic/glyphs/gcach_layout.cxx -+++ b/vcl/generic/glyphs/gcach_layout.cxx -@@ -456,20 +456,36 @@ bool HbLayoutEngine::layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs) - if (bInCluster) - nGlyphFlags |= GlyphItem::IS_IN_CLUSTER; - -+ // The whole IS_DIACRITIC concept is a stupid hack that was -+ // introduced ages ago to work around the utter brokenness of the -+ // way justification adjustments are applied (the DXArray fiasco). -+ // Since it is such a stupid hack, there is no sane way to directly -+ // map to concepts of the "outside" world, so we do some rather -+ // ugly hacks: -+ // * If the font has a GDEF table, we check for glyphs with mark -+ // glyph class which is sensible, except that some fonts -+ // (fdo#70968) assign mark class to spacing marks (which is wrong -+ // but usually harmless), so we try to sniff what HarfBuzz thinks -+ // about this glyph by checking if it gives it a zero advance -+ // width. -+ // * If the font has no GDEF table, we just check if the glyph has -+ // zero advance width, but this is stupid and can be wrong. A -+ // better way would to check the character's Unicode combining -+ // class, but unfortunately glyph gives combining marks the -+ // cluster value of its base character, so nCharPos will be -+ // pointing to the wrong character (but HarfBuzz might change -+ // this in the future). - bool bDiacritic = false; - if (hb_ot_layout_has_glyph_classes(mpHbFace)) - { - // the font has GDEF table -- if (hb_ot_layout_get_glyph_class(mpHbFace, nGlyphIndex) == HB_OT_LAYOUT_GLYPH_CLASS_MARK) -+ bool bMark = hb_ot_layout_get_glyph_class(mpHbFace, nGlyphIndex) == HB_OT_LAYOUT_GLYPH_CLASS_MARK; -+ if (bMark && pHbPositions[i].x_advance == 0) - bDiacritic = true; - } - else - { - // the font lacks GDEF table -- // HACK: if the resolved glyph advance is zero assume it is a -- // combining mark. The whole IS_DIACRITIC concept is a hack to -- // fix the other hacks we use to second-guess glyph advances in -- // ApplyDXArray and the likes and it needs to die - if (pHbPositions[i].x_advance == 0) - bDiacritic = true; - } -diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx -index f395936..450ec232 100644 ---- a/vcl/source/gdi/sallayout.cxx -+++ b/vcl/source/gdi/sallayout.cxx -@@ -1018,6 +1018,27 @@ void GenericSalLayout::AdjustLayout( ImplLayoutArgs& rArgs ) - - // ----------------------------------------------------------------------- - -+// This DXArray thing is one of the stupidest ideas I have ever seen (I've been -+// told that it probably a one-to-one mapping of some Windows 3.1 API, which is -+// telling). To justify a text string, Writer calls OutputDevice::GetTextArray() -+// to get an array that maps input characters (not glyphs) to their absolute -+// position, GetTextArray() in turn calls SalLayout::FillDXArray() to get an -+// array of character widths that it converts to absolute positions. -+// -+// Writer would then apply justification adjustments to that array of absolute -+// character positions and return to OutputDevice, which eventually calls -+// ApplyDXArray(), which needs to extract the individual adjustments for each -+// character to apply it to corresponding glyphs, and since that information is -+// already lost it tries to do some heuristics to guess it again. Those -+// heuristics often fail, and have always been a source of all sorts of weird -+// text layout bugs, and instead of fixing the broken design a hack after hack -+// have been applied on top of it, making it a complete mess that nobody -+// understands. -+// -+// As you can see by now, this is utterly stupid, why Writer does not just send -+// us directly the advance width transformations it wants to apply to each -+// character instead of this whole mess? -+ - void GenericSalLayout::ApplyDXArray( ImplLayoutArgs& rArgs ) - { - if( m_GlyphItems.empty()) --- -1.8.3.1 - diff --git a/SOURCES/0001-n-839727-rhbz-1038176-Crash-fix.patch b/SOURCES/0001-n-839727-rhbz-1038176-Crash-fix.patch new file mode 100644 index 0000000..d6745df --- /dev/null +++ b/SOURCES/0001-n-839727-rhbz-1038176-Crash-fix.patch @@ -0,0 +1,32 @@ +From e8ac85752a2e07ceacb3b2f3e4eab3bc35a45c3d Mon Sep 17 00:00:00 2001 +From: Muthu Subramanian +Date: Tue, 22 Oct 2013 15:13:41 +0530 +Subject: [PATCH 1/9] n#839727 / rhbz#1038176 Crash fix + +(cherry picked from commit e5f24e0c7c8f4799223c19359f4228f0b1a71461) + +Change-Id: I8d733afbbc05900c68217ead44de798c1263ca84 +Reviewed-on: https://gerrit.libreoffice.org/7309 +Reviewed-by: Andras Timar +Tested-by: Andras Timar +--- + oox/source/drawingml/chart/seriesconverter.cxx | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx +index 9ef1f3f..020b141 100644 +--- a/oox/source/drawingml/chart/seriesconverter.cxx ++++ b/oox/source/drawingml/chart/seriesconverter.cxx +@@ -632,7 +632,8 @@ Reference< XDataSeries > SeriesConverter::createDataSeries( const TypeGroupConve + { + // Use number format code from Value series + DataSourceModel* pValues = mrModel.maSources.get( SeriesModel::VALUES ).get(); +- xLabels->maNumberFormat.maFormatCode = pValues->mxDataSeq->maFormatCode; ++ if( pValues ) ++ xLabels->maNumberFormat.maFormatCode = pValues->mxDataSeq->maFormatCode; + } + DataLabelsConverter aLabelsConv( *this, *xLabels ); + aLabelsConv.convertFromModel( xDataSeries, rTypeGroup ); +-- +1.8.4.2 + diff --git a/SOURCES/0001-resolved-fdo-56209-reviving-FilterFormulaParser.patch b/SOURCES/0001-resolved-fdo-56209-reviving-FilterFormulaParser.patch deleted file mode 100644 index 9427f62..0000000 --- a/SOURCES/0001-resolved-fdo-56209-reviving-FilterFormulaParser.patch +++ /dev/null @@ -1,405 +0,0 @@ -From 4a7096b9c8c0e6451fa0ced06143cb8a65ec10fc Mon Sep 17 00:00:00 2001 -From: Eike Rathke -Date: Mon, 28 Oct 2013 22:46:01 +0100 -Subject: [PATCH] resolved fdo#56209 reviving FilterFormulaParser - -First it was moved from oox to sc without carrying over the component -factory bits, then subsequent commits removed the remaining bits in -steps as it appeared to be unused: - -8ada1cd2846e5e60ad63250c68ddea3a9356546f -887d7945addeb823e0d3f783609c4e79d92ad4a7 -effda59a12cedd3cf200d2e9f5186a623b0855bb -f2fd2a66ee827024b31a310d67804cb7cb18d2da - -(cherry picked from commit 20e0afa76087e20f95247406d265a122263a8c6f) - -Backported. - -Change-Id: I445b11c95daff6f30b3654936d0f22a113158f97 -Reviewed-on: https://gerrit.libreoffice.org/6469 -Reviewed-by: David Tardon -Tested-by: David Tardon ---- - sc/Library_scfilt.mk | 1 + - sc/source/filter/excel/xestream.cxx | 10 ++ - sc/source/filter/inc/ooxformulaparser.hxx | 110 +++++++++++++++++ - sc/source/filter/oox/ooxformulaparser.cxx | 196 ++++++++++++++++++++++++++++++ - sc/util/scfilt.component | 3 + - 5 files changed, 320 insertions(+) - create mode 100644 sc/source/filter/inc/ooxformulaparser.hxx - create mode 100644 sc/source/filter/oox/ooxformulaparser.cxx - -diff --git a/sc/Library_scfilt.mk b/sc/Library_scfilt.mk -index 5b383c4..3cc4b1a 100644 ---- a/sc/Library_scfilt.mk -+++ b/sc/Library_scfilt.mk -@@ -188,6 +188,7 @@ $(eval $(call gb_Library_add_exception_objects,scfilt,\ - sc/source/filter/oox/formulabuffer \ - sc/source/filter/oox/formulaparser \ - sc/source/filter/oox/numberformatsbuffer \ -+ sc/source/filter/oox/ooxformulaparser \ - sc/source/filter/oox/pagesettings \ - sc/source/filter/oox/pivotcachebuffer \ - sc/source/filter/oox/pivotcachefragment \ -diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx -index bf9c1d8..8421006 100644 ---- a/sc/source/filter/excel/xestream.cxx -+++ b/sc/source/filter/excel/xestream.cxx -@@ -1179,6 +1179,11 @@ namespace oox { namespace xls { - Sequence< OUString > SAL_CALL ExcelFilter_getSupportedServiceNames() throw(); - Reference< XInterface > SAL_CALL ExcelFilter_createInstance( - const Reference< XComponentContext >& rxContext ) throw( Exception ); -+ -+ OUString SAL_CALL OOXMLFormulaParser_getImplementationName() throw(); -+ Sequence< OUString > SAL_CALL OOXMLFormulaParser_getSupportedServiceNames() throw(); -+ Reference< XInterface > SAL_CALL OOXMLFormulaParser_create( -+ const Reference< XComponentContext >& rxContext ) throw(); - } } - - #ifdef __cplusplus -@@ -1201,6 +1206,11 @@ extern "C" - oox::xls::ExcelFilter_getSupportedServiceNames, ::cppu::createSingleComponentFactory, - 0, 0 - }, -+ { -+ oox::xls::OOXMLFormulaParser_create, oox::xls::OOXMLFormulaParser_getImplementationName, -+ oox::xls::OOXMLFormulaParser_getSupportedServiceNames, ::cppu::createSingleComponentFactory, -+ 0, 0 -+ }, - { 0, 0, 0, 0, 0, 0 } - }; - -diff --git a/sc/source/filter/inc/ooxformulaparser.hxx b/sc/source/filter/inc/ooxformulaparser.hxx -new file mode 100644 -index 0000000..e6c5797 ---- /dev/null -+++ b/sc/source/filter/inc/ooxformulaparser.hxx -@@ -0,0 +1,110 @@ -+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -+/* -+ * This file is part of the LibreOffice project. -+ * -+ * This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. -+ * -+ * This file incorporates work covered by the following license notice: -+ * -+ * Licensed to the Apache Software Foundation (ASF) under one or more -+ * contributor license agreements. See the NOTICE file distributed -+ * with this work for additional information regarding copyright -+ * ownership. The ASF licenses this file to you under the Apache -+ * License, Version 2.0 (the "License"); you may not use this file -+ * except in compliance with the License. You may obtain a copy of -+ * the License at http://www.apache.org/licenses/LICENSE-2.0 . -+ */ -+ -+#ifndef OOX_XLS_OOXFORMULAPARSER_HXX -+#define OOX_XLS_OOXFORMULAPARSER_HXX -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+namespace oox { -+namespace xls { -+ -+class OOXMLFormulaParserImpl; -+ -+// ============================================================================ -+ -+typedef ::cppu::WeakImplHelper3< -+ ::com::sun::star::lang::XServiceInfo, -+ ::com::sun::star::lang::XInitialization, -+ ::com::sun::star::sheet::XFilterFormulaParser > OOXMLFormulaParser_BASE; -+ -+/** OOXML formula parser/compiler service for usage in ODF filters. */ -+class OOXMLFormulaParser : public OOXMLFormulaParser_BASE -+{ -+public: -+ explicit OOXMLFormulaParser(); -+ virtual ~OOXMLFormulaParser(); -+ -+ // com.sun.star.lang.XServiceInfo interface ------------------------------- -+ -+ virtual ::rtl::OUString SAL_CALL -+ getImplementationName() throw( ::com::sun::star::uno::RuntimeException ); -+ -+ virtual sal_Bool SAL_CALL -+ supportsService( const ::rtl::OUString& rService ) -+ throw( ::com::sun::star::uno::RuntimeException ); -+ -+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL -+ getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ); -+ -+ // com.sun.star.lang.XInitialization interface ---------------------------- -+ -+ virtual void SAL_CALL initialize( -+ const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rArgs ) -+ throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException ); -+ -+ // com.sun.star.sheet.XFilterFormulaParser interface ---------------------- -+ -+ virtual ::rtl::OUString SAL_CALL -+ getSupportedNamespace() -+ throw( ::com::sun::star::uno::RuntimeException ); -+ -+ // com.sun.star.sheet.XFormulaParser interface ---------------------------- -+ -+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken > SAL_CALL -+ parseFormula( -+ const ::rtl::OUString& rFormula, -+ const ::com::sun::star::table::CellAddress& rReferencePos ) -+ throw( ::com::sun::star::uno::RuntimeException ); -+ -+ virtual ::rtl::OUString SAL_CALL -+ printFormula( -+ const ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken >& rTokens, -+ const ::com::sun::star::table::CellAddress& rReferencePos ) -+ throw( ::com::sun::star::uno::RuntimeException ); -+ -+private: -+ typedef ::boost::shared_ptr< OOXMLFormulaParserImpl > ParserImplRef; -+ -+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > -+ mxComponent; -+ ParserImplRef mxParserImpl; /// Implementation of import parser. -+}; -+ -+css::uno::Reference< css::uno::XInterface > SAL_CALL OOXMLFormulaParser_create( -+ css::uno::Reference< css::uno::XComponentContext > const & context); -+ -+OUString SAL_CALL OOXMLFormulaParser_getImplementationName(); -+ -+css::uno::Sequence< OUString > SAL_CALL OOXMLFormulaParser_getSupportedServiceNames(); -+ -+// ============================================================================ -+ -+} // namespace xls -+} // namespace oox -+ -+#endif -+ -+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -diff --git a/sc/source/filter/oox/ooxformulaparser.cxx b/sc/source/filter/oox/ooxformulaparser.cxx -new file mode 100644 -index 0000000..9b91c79 ---- /dev/null -+++ b/sc/source/filter/oox/ooxformulaparser.cxx -@@ -0,0 +1,196 @@ -+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -+/* -+ * This file is part of the LibreOffice project. -+ * -+ * This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. -+ * -+ * This file incorporates work covered by the following license notice: -+ * -+ * Licensed to the Apache Software Foundation (ASF) under one or more -+ * contributor license agreements. See the NOTICE file distributed -+ * with this work for additional information regarding copyright -+ * ownership. The ASF licenses this file to you under the Apache -+ * License, Version 2.0 (the "License"); you may not use this file -+ * except in compliance with the License. You may obtain a copy of -+ * the License at http://www.apache.org/licenses/LICENSE-2.0 . -+ */ -+ -+#include "ooxformulaparser.hxx" -+ -+#include -+#include "formulaparser.hxx" -+ -+namespace oox { -+namespace xls { -+ -+// ============================================================================ -+ -+using namespace ::com::sun::star::lang; -+using namespace ::com::sun::star::sheet; -+using namespace ::com::sun::star::table; -+using namespace ::com::sun::star::uno; -+ -+using ::rtl::OUString; -+ -+// ============================================================================ -+ -+class OOXMLFormulaParserImpl : private FormulaFinalizer -+{ -+public: -+ explicit OOXMLFormulaParserImpl( const Reference< XMultiServiceFactory >& rxModelFactory ); -+ -+ Sequence< FormulaToken > parseFormula( const OUString& rFormula, const CellAddress& rReferencePos ); -+ -+protected: -+ virtual const FunctionInfo* resolveBadFuncName( const OUString& rTokenData ) const; -+ -+private: -+ ApiParserWrapper maApiParser; -+}; -+ -+// ---------------------------------------------------------------------------- -+ -+OOXMLFormulaParserImpl::OOXMLFormulaParserImpl( const Reference< XMultiServiceFactory >& rxModelFactory ) : -+ FormulaFinalizer( OpCodeProvider( rxModelFactory, FILTER_OOXML, BIFF_UNKNOWN, true ) ), -+ maApiParser( rxModelFactory, *this ) -+{ -+} -+ -+Sequence< FormulaToken > OOXMLFormulaParserImpl::parseFormula( const OUString& rFormula, const CellAddress& rReferencePos ) -+{ -+ return finalizeTokenArray( maApiParser.parseFormula( rFormula, rReferencePos ) ); -+} -+ -+const FunctionInfo* OOXMLFormulaParserImpl::resolveBadFuncName( const OUString& rTokenData ) const -+{ -+ /* Try to parse calls to library functions. The format of such a function -+ call is assumed to be -+ "'\Library\'!". */ -+ -+ // the string has to start with an apostroph (followed by the library URL) -+ if( (rTokenData.getLength() >= 6) && (rTokenData[ 0 ] == '\'') ) -+ { -+ // library URL and function name are separated by an exclamation mark -+ sal_Int32 nExclamPos = rTokenData.lastIndexOf( '!' ); -+ if( (1 < nExclamPos) && (nExclamPos + 1 < rTokenData.getLength()) && (rTokenData[ nExclamPos - 1 ] == '\'') ) -+ { -+ // find the last backslash that separates library path and name -+ sal_Int32 nFileSep = rTokenData.lastIndexOf( '\\', nExclamPos - 2 ); -+ if( nFileSep > 1 ) -+ { -+ // find preceding backslash that separates the last directory name -+ sal_Int32 nDirSep = rTokenData.lastIndexOf( '\\', nFileSep - 1 ); -+ // function library is located in a directory called 'library' -+ if( (nDirSep > 0) && rTokenData.matchIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM( "\\LIBRARY\\" ), nDirSep ) ) -+ { -+ // try to find a function info for the function name -+ OUString aFuncName = rTokenData.copy( nExclamPos + 1 ).toAsciiUpperCase(); -+ const FunctionInfo* pFuncInfo = getFuncInfoFromOoxFuncName( aFuncName ); -+ if( pFuncInfo && (pFuncInfo->meFuncLibType != FUNCLIB_UNKNOWN) ) -+ { -+ // check that the name of the library matches -+ OUString aLibName = rTokenData.copy( nFileSep + 1, nExclamPos - nFileSep - 2 ); -+ if( pFuncInfo->meFuncLibType == getFuncLibTypeFromLibraryName( aLibName ) ) -+ return pFuncInfo; -+ } -+ } -+ } -+ } -+ } -+ return 0; -+} -+ -+// ============================================================================ -+ -+Sequence< OUString > OOXMLFormulaParser_getSupportedServiceNames() -+{ -+ Sequence< OUString > aServiceNames( 1 ); -+ aServiceNames[ 0 ] = "com.sun.star.sheet.FilterFormulaParser"; -+ return aServiceNames; -+} -+ -+OUString OOXMLFormulaParser_getImplementationName() -+{ -+ return OUString( "com.sun.star.comp.oox.xls.FormulaParser"); -+} -+ -+Reference< XInterface > OOXMLFormulaParser_create( const Reference< XComponentContext >& ) -+{ -+ return static_cast< ::cppu::OWeakObject* >( new OOXMLFormulaParser ); -+} -+ -+// ============================================================================ -+ -+OOXMLFormulaParser::OOXMLFormulaParser() -+{ -+} -+ -+OOXMLFormulaParser::~OOXMLFormulaParser() -+{ -+} -+ -+// com.sun.star.lang.XServiceInfo interface ----------------------------------- -+ -+OUString SAL_CALL OOXMLFormulaParser::getImplementationName() throw( RuntimeException ) -+{ -+ return OOXMLFormulaParser_getImplementationName(); -+} -+ -+sal_Bool SAL_CALL OOXMLFormulaParser::supportsService( const OUString& rService ) throw( RuntimeException ) -+{ -+ const Sequence< OUString > aServices( OOXMLFormulaParser_getSupportedServiceNames() ); -+ const OUString* pArray = aServices.getConstArray(); -+ const OUString* pArrayEnd = pArray + aServices.getLength(); -+ return ::std::find( pArray, pArrayEnd, rService ) != pArrayEnd; -+} -+ -+Sequence< OUString > SAL_CALL OOXMLFormulaParser::getSupportedServiceNames() throw( RuntimeException ) -+{ -+ return OOXMLFormulaParser_getSupportedServiceNames(); -+} -+ -+// com.sun.star.lang.XInitialization interface -------------------------------- -+ -+void SAL_CALL OOXMLFormulaParser::initialize( const Sequence< Any >& rArgs ) throw( Exception, RuntimeException ) -+{ -+ OSL_ENSURE( rArgs.hasElements(), "OOXMLFormulaParser::initialize - missing arguments" ); -+ if( !rArgs.hasElements() ) -+ throw RuntimeException(); -+ mxComponent.set( rArgs[ 0 ], UNO_QUERY_THROW ); -+} -+ -+// com.sun.star.sheet.XFilterFormulaParser interface -------------------------- -+ -+OUString SAL_CALL OOXMLFormulaParser::getSupportedNamespace() throw( RuntimeException ) -+{ -+ return OUString( "http://schemas.microsoft.com/office/excel/formula"); -+} -+ -+// com.sun.star.sheet.XFormulaParser interface -------------------------------- -+ -+Sequence< FormulaToken > SAL_CALL OOXMLFormulaParser::parseFormula( -+ const OUString& rFormula, const CellAddress& rReferencePos ) throw( RuntimeException ) -+{ -+ if( !mxParserImpl ) -+ { -+ Reference< XMultiServiceFactory > xModelFactory( mxComponent, UNO_QUERY_THROW ); -+ mxParserImpl.reset( new OOXMLFormulaParserImpl( xModelFactory ) ); -+ } -+ return mxParserImpl->parseFormula( rFormula, rReferencePos ); -+} -+ -+OUString SAL_CALL OOXMLFormulaParser::printFormula( -+ const Sequence< FormulaToken >& /*rTokens*/, const CellAddress& /*rReferencePos*/ ) throw( RuntimeException ) -+{ -+ // not implemented -+ throw RuntimeException(); -+} -+ -+// ============================================================================ -+ -+} // namespace xls -+} // namespace oox -+ -+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -diff --git a/sc/util/scfilt.component b/sc/util/scfilt.component -index 13b884b..292fbd4 100644 ---- a/sc/util/scfilt.component -+++ b/sc/util/scfilt.component -@@ -26,4 +26,7 @@ - - - -+ -+ -+ - --- -1.8.3.1 - diff --git a/SOURCES/0002-EMF-Stroke-size-is-always-supposed-to-be-absolute.patch b/SOURCES/0002-EMF-Stroke-size-is-always-supposed-to-be-absolute.patch new file mode 100644 index 0000000..2ebe3ef --- /dev/null +++ b/SOURCES/0002-EMF-Stroke-size-is-always-supposed-to-be-absolute.patch @@ -0,0 +1,29 @@ +From d32eea1634cff144a45c3ee6b0bb54e1cc7663c5 Mon Sep 17 00:00:00 2001 +From: Jan Holesovsky +Date: Tue, 19 Nov 2013 10:02:12 +0100 +Subject: [PATCH 002/109] EMF+: Stroke size is always supposed to be absolute. + +Change-Id: I7221311e5dee6384dc2d1c071bf6f1c61811895a +Reviewed-on: https://gerrit.libreoffice.org/6827 +Reviewed-by: Andras Timar +Tested-by: Andras Timar +--- + cppcanvas/source/mtfrenderer/emfplus.cxx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx +index 9d9c311..daed614 100644 +--- a/cppcanvas/source/mtfrenderer/emfplus.cxx ++++ b/cppcanvas/source/mtfrenderer/emfplus.cxx +@@ -613,7 +613,7 @@ namespace cppcanvas + SAL_INFO ("cppcanvas.emf", "TODO: pen with zero width - using minimal which might not be correct\n"); + } + #endif +- rStrokeAttributes.StrokeWidth = (rState.mapModeTransform * rR.MapSize (width == 0.0 ? 0.05 : width, 0)).getX (); ++ rStrokeAttributes.StrokeWidth = fabs((rState.mapModeTransform * rR.MapSize (width == 0.0 ? 0.05 : width, 0)).getX()); + } + + void Read (SvStream& s, ImplRenderer& rR, sal_Int32, sal_Int32 ) +-- +1.8.4.2 + diff --git a/SOURCES/0002-Related-rhbz-968892-discard-impossible-languages-for.patch b/SOURCES/0002-Related-rhbz-968892-discard-impossible-languages-for.patch deleted file mode 100644 index 36eadbe..0000000 --- a/SOURCES/0002-Related-rhbz-968892-discard-impossible-languages-for.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 0e89a49f67f58e0942ed4aea393ac37e22d9e12d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Wed, 5 Jun 2013 15:59:50 +0100 -Subject: [PATCH] Related: rhbz#968892 discard impossible languages for oriya - script fallback - -Change-Id: I2fa1a127fbd2f905a89f0c30898ad56099fa8df1 ---- - vcl/generic/fontmanager/fontconfig.cxx | 28 ++++++++++++++++++---------- - 1 file changed, 18 insertions(+), 10 deletions(-) - -diff --git a/vcl/generic/fontmanager/fontconfig.cxx b/vcl/generic/fontmanager/fontconfig.cxx -index ff471fa..a305095 100644 ---- a/vcl/generic/fontmanager/fontconfig.cxx -+++ b/vcl/generic/fontmanager/fontconfig.cxx -@@ -860,19 +860,27 @@ namespace - OUString sLang = rLangTag.getLanguage(); - switch (eScript) - { -+ //http://en.wiktionary.org/wiki/Category:Oriya_script_languages -+ case USCRIPT_ORIYA: -+ bIsImpossible = -+ sLang != "or" && -+ sLang != "kxv"; -+ break; -+ //http://en.wiktionary.org/wiki/Category:Telugu_script_languages - case USCRIPT_TELUGU: -- bIsImpossible = sLang != "te"; -+ bIsImpossible = -+ sLang != "te" && -+ sLang != "gon" && -+ sLang != "kfc"; - break; -+ //http://en.wiktionary.org/wiki/Category:Bengali_script_languages - case USCRIPT_BENGALI: -- bIsImpossible = sLang != "bn" && -- sLang != "as" && sLang != "mkb" && -- sLang != "kfv" && sLang != "ccp" && -- sLang != "tnv" && sLang != "ctg" && -- sLang != "haj" && sLang != "ksy" && -- sLang != "rkt" && sLang != "rjs" && -- sLang != "rhg" && sLang != "syl" && -- sLang != "kyv" && sLang != "zrg" && -- sLang != "nhh"; -+ bIsImpossible = -+ sLang != "bn" && -+ sLang != "as" && -+ sLang != "bpy" && -+ sLang != "ctg" && -+ sLang != "sa"; - break; - default: - break; --- -1.8.1.4 - diff --git a/SOURCES/0002-fdo-72645-Allow-GETPIVOTDATA-to-get-result-from-leaf.patch b/SOURCES/0002-fdo-72645-Allow-GETPIVOTDATA-to-get-result-from-leaf.patch new file mode 100644 index 0000000..9027911 --- /dev/null +++ b/SOURCES/0002-fdo-72645-Allow-GETPIVOTDATA-to-get-result-from-leaf.patch @@ -0,0 +1,213 @@ +From 83eb0b64980b405bc94ed19f3bcb60860f86e7d4 Mon Sep 17 00:00:00 2001 +From: Kohei Yoshida +Date: Mon, 6 Jan 2014 23:45:46 -0500 +Subject: [PATCH 2/9] fdo#72645: Allow GETPIVOTDATA to get result from leaf + node of result tree. + +Change-Id: I0fc1fd069440ed6fee378fc2dfd2ed761afbdeab +Reviewed-on: https://gerrit.libreoffice.org/7284 +Reviewed-by: Eike Rathke +Tested-by: Eike Rathke +--- + sc/inc/dpresfilter.hxx | 12 ++++++++++ + sc/source/core/data/dpobject.cxx | 4 ++-- + sc/source/core/data/dpresfilter.cxx | 44 +++++++++++++++++++++++++++++++++++++ + sc/source/core/data/dptabsrc.cxx | 28 +++++++++++++++++------ + 4 files changed, 79 insertions(+), 9 deletions(-) + +diff --git a/sc/inc/dpresfilter.hxx b/sc/inc/dpresfilter.hxx +index be84b8c..bc7ffc1 100644 +--- a/sc/inc/dpresfilter.hxx ++++ b/sc/inc/dpresfilter.hxx +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + + + namespace com { namespace sun { namespace star { namespace sheet { +@@ -85,6 +86,15 @@ private: + #endif + }; + ++ typedef std::pair NamePairType; ++ ++ struct NamePairHash ++ { ++ size_t operator() (const NamePairType& rPair) const; ++ }; ++ typedef boost::unordered_map LeafValuesType; ++ LeafValuesType maLeafValues; ++ + OUString maPrimaryDimName; + MemberNode* mpRoot; + +@@ -115,6 +125,8 @@ public: + const com::sun::star::uno::Sequence< + com::sun::star::sheet::DataPilotFieldFilter>& rFilters) const; + ++ double getLeafResult(const com::sun::star::sheet::DataPilotFieldFilter& rFilter) const; ++ + #if DEBUG_PIVOT_TABLE + void dump() const; + #endif +diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx +index 653bc0c..3d9f5af 100644 +--- a/sc/source/core/data/dpobject.cxx ++++ b/sc/source/core/data/dpobject.cxx +@@ -1328,8 +1328,8 @@ public: + { + // Layout name takes precedence. + const OUString* pLayoutName = pDim->GetLayoutName(); +- if (pLayoutName) +- return *pLayoutName == maName; ++ if (pLayoutName && *pLayoutName == maName) ++ return true; + + sheet::GeneralFunction eGenFunc = static_cast(pDim->GetFunction()); + ScSubTotalFunc eFunc = ScDPUtil::toSubTotalFunc(eGenFunc); +diff --git a/sc/source/core/data/dpresfilter.cxx b/sc/source/core/data/dpresfilter.cxx +index 968be6b..41b2d7e 100644 +--- a/sc/source/core/data/dpresfilter.cxx ++++ b/sc/source/core/data/dpresfilter.cxx +@@ -10,6 +10,8 @@ + #include "dpresfilter.hxx" + #include "global.hxx" + ++#include ++ + #include + + using namespace com::sun::star; +@@ -21,6 +23,12 @@ ScDPResultFilter::ScDPResultFilter(const OUString& rDimName, bool bDataLayout) : + ScDPResultFilterContext::ScDPResultFilterContext() : + mnCol(0), mnRow(0) {} + ++size_t ScDPResultTree::NamePairHash::operator() (const NamePairType& rPair) const ++{ ++ OUStringHash aHash; ++ return aHash(rPair.first) + aHash(rPair.second); ++} ++ + ScDPResultTree::DimensionNode::DimensionNode(const MemberNode* pParent) : + mpParent(pParent) {} + +@@ -89,6 +97,8 @@ void ScDPResultTree::add( + { + // TODO: I'll work on the col / row to value node mapping later. + ++ const OUString* pDimName = NULL; ++ const OUString* pMemName = NULL; + MemberNode* pMemNode = mpRoot; + + std::vector::const_iterator itFilter = rFilters.begin(), itFilterEnd = rFilters.end(); +@@ -117,6 +127,8 @@ void ScDPResultTree::add( + itDim = r.first; + } + ++ pDimName = &itDim->first; ++ + // Now, see if this dimension member exists. + DimensionNode* pDim = itDim->second; + MembersType& rMembers = pDim->maChildMembers; +@@ -135,9 +147,26 @@ void ScDPResultTree::add( + itMem = r.first; + } + ++ pMemName = &itMem->first; + pMemNode = itMem->second; + } + ++ if (pDimName && pMemName) ++ { ++ NamePairType aNames(*pDimName, *pMemName); ++ LeafValuesType::iterator it = maLeafValues.find(aNames); ++ if (it == maLeafValues.end()) ++ { ++ // This name pair doesn't exist. Associate a new value for it. ++ maLeafValues.insert(LeafValuesType::value_type(aNames, fVal)); ++ } ++ else ++ { ++ // This name pair already exists. Set the value to NaN. ++ rtl::math::setNan(&it->second); ++ } ++ } ++ + pMemNode->maValues.push_back(fVal); + } + +@@ -145,6 +174,7 @@ void ScDPResultTree::swap(ScDPResultTree& rOther) + { + std::swap(maPrimaryDimName, rOther.maPrimaryDimName); + std::swap(mpRoot, rOther.mpRoot); ++ maLeafValues.swap(rOther.maLeafValues); + } + + bool ScDPResultTree::empty() const +@@ -184,6 +214,20 @@ const ScDPResultTree::ValuesType* ScDPResultTree::getResults( + return &pMember->maValues; + } + ++double ScDPResultTree::getLeafResult(const com::sun::star::sheet::DataPilotFieldFilter& rFilter) const ++{ ++ NamePairType aPair(rFilter.FieldName, rFilter.MatchValue); ++ LeafValuesType::const_iterator it = maLeafValues.find(aPair); ++ if (it != maLeafValues.end()) ++ // Found! ++ return it->second; ++ ++ // Not found. Return an NaN. ++ double fNan; ++ rtl::math::setNan(&fNan); ++ return fNan; ++} ++ + #if DEBUG_PIVOT_TABLE + void ScDPResultTree::dump() const + { +diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx +index 96fe330..08df85d 100644 +--- a/sc/source/core/data/dptabsrc.cxx ++++ b/sc/source/core/data/dptabsrc.cxx +@@ -423,15 +423,29 @@ uno::Sequence ScDPSource::getFilteredResults( + + // Get result values from the tree. + const ScDPResultTree::ValuesType* pVals = maResFilterSet.getResults(aFilters); +- if (!pVals) +- return uno::Sequence(); ++ if (pVals) ++ { ++ size_t n = pVals->size(); ++ uno::Sequence aRet(n); ++ for (size_t i = 0; i < n; ++i) ++ aRet[i] = (*pVals)[i]; + +- size_t n = pVals->size(); +- uno::Sequence aRet(n); +- for (size_t i = 0; i < n; ++i) +- aRet[i] = (*pVals)[i]; ++ return aRet; ++ } + +- return aRet; ++ if (aFilters.getLength() == 1) ++ { ++ // Try to get result from the leaf nodes. ++ double fVal = maResFilterSet.getLeafResult(aFilters[0]); ++ if (!rtl::math::isNan(fVal)) ++ { ++ uno::Sequence aRet(1); ++ aRet[0] = fVal; ++ return aRet; ++ } ++ } ++ ++ return uno::Sequence(); + } + + void SAL_CALL ScDPSource::refresh() throw(uno::RuntimeException) +-- +1.8.4.2 + diff --git a/SOURCES/0003-fdo-61272-Do-the-mapping-correctly-both-for-WMF-and-.patch b/SOURCES/0003-fdo-61272-Do-the-mapping-correctly-both-for-WMF-and-.patch new file mode 100644 index 0000000..b7f5a41 --- /dev/null +++ b/SOURCES/0003-fdo-61272-Do-the-mapping-correctly-both-for-WMF-and-.patch @@ -0,0 +1,125 @@ +From 22f63e3e7be99f13fd719ffc03aa78e34bd545af Mon Sep 17 00:00:00 2001 +From: Jan Holesovsky +Date: Wed, 27 Nov 2013 12:12:42 +0100 +Subject: [PATCH 003/109] fdo#61272: Do the mapping correctly both for WMF and + EMF. + +Turns out that for the WMF, we already had everything set up correctly, we +were just overwriting the right settings with default data again :-) - fix +that. + +Includes the following commits: + +* Revert "wmf-mm-text-1.diff: Fix WMF rendering, n#417818" +* Revert "wmf-mm-text.diff: Fix WMF rendering, n#417818" +* fdo#56886 EMF: Fixes some scaling problems of clipped regions, Twips + +Change-Id: I7ff859246dbaea3868438d3632f9adc60fc4ee37 +Reviewed-on: https://gerrit.libreoffice.org/6829 +Reviewed-by: Andras Timar +Tested-by: Andras Timar +--- + vcl/source/filter/wmf/winmtf.cxx | 33 +-------------------------------- + vcl/source/filter/wmf/winmtf.hxx | 1 - + vcl/source/filter/wmf/winwmf.cxx | 1 - + 3 files changed, 1 insertion(+), 34 deletions(-) + +diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx +index c8c6652..6d44084 100644 +--- a/vcl/source/filter/wmf/winmtf.cxx ++++ b/vcl/source/filter/wmf/winmtf.cxx +@@ -374,19 +374,6 @@ Point WinMtfOutput::ImplMap( const Point& rPt ) + { + switch( mnMapMode ) + { +- case MM_TEXT: +- fX2 -= mnWinOrgX; +- fY2 -= mnWinOrgY; +- if( mnDevWidth != 1 || mnDevHeight != 1 ) { +- fX2 *= HUNDREDTH_MILLIMETERS_PER_MILLIINCH*1000/mnUnitsPerInch; +- fY2 *= HUNDREDTH_MILLIMETERS_PER_MILLIINCH*1000/mnUnitsPerInch; +- } +- fX2 += mnDevOrgX; +- fY2 += mnDevOrgY; +- fX2 *= (double)mnMillX * 100.0 / (double)mnPixX; +- fY2 *= (double)mnMillY * 100.0 / (double)mnPixY; +- +- break; + case MM_LOENGLISH : + { + fX2 -= mnWinOrgX; +@@ -471,15 +458,6 @@ Size WinMtfOutput::ImplMap( const Size& rSz ) + { + switch( mnMapMode ) + { +- case MM_TEXT: +- if( mnDevWidth != 1 && mnDevHeight != 1 ) { +- fWidth *= HUNDREDTH_MILLIMETERS_PER_MILLIINCH*1000/mnUnitsPerInch; +- fHeight*= HUNDREDTH_MILLIMETERS_PER_MILLIINCH*1000/mnUnitsPerInch; +- } else { +- fWidth *= (double)mnMillX * 100 / (double)mnPixX; +- fHeight *= (double)mnMillY * 100 / (double)mnPixY; +- } +- break; + case MM_LOENGLISH : + { + fWidth *= HUNDREDTH_MILLIMETERS_PER_MILLIINCH*10; +@@ -916,7 +894,6 @@ WinMtfOutput::WinMtfOutput( GDIMetaFile& rGDIMetaFile ) : + mbComplexClip ( false ), + mnGfxMode ( GM_COMPATIBLE ), + mnMapMode ( MM_TEXT ), +- mnUnitsPerInch ( 96 ), + mnDevOrgX ( 0 ), + mnDevOrgY ( 0 ), + mnDevWidth ( 1 ), +@@ -2025,7 +2002,7 @@ void WinMtfOutput::SetRefMill( const Size& rSize ) + void WinMtfOutput::SetMapMode( sal_uInt32 nMapMode ) + { + mnMapMode = nMapMode; +- if ( nMapMode == MM_TEXT ) ++ if ( nMapMode == MM_TEXT && !mbIsMapWinSet ) + { + mnWinExtX = mnDevWidth; + mnWinExtY = mnDevHeight; +@@ -2039,14 +2016,6 @@ void WinMtfOutput::SetMapMode( sal_uInt32 nMapMode ) + + + +-void WinMtfOutput::SetUnitsPerInch( sal_uInt16 nUnitsPerInch ) +-{ +- if( nUnitsPerInch != 0 ) +- mnUnitsPerInch = nUnitsPerInch; +-} +- +- +- + void WinMtfOutput::SetWorldTransform( const XForm& rXForm ) + { + maXForm.eM11 = rXForm.eM11; +diff --git a/vcl/source/filter/wmf/winmtf.hxx b/vcl/source/filter/wmf/winmtf.hxx +index bec5d8a..8e18f7e 100644 +--- a/vcl/source/filter/wmf/winmtf.hxx ++++ b/vcl/source/filter/wmf/winmtf.hxx +@@ -679,7 +679,6 @@ public: + + sal_uInt32 GetMapMode() const { return mnMapMode; }; + void SetMapMode( sal_uInt32 mnMapMode ); +- void SetUnitsPerInch( sal_uInt16 nUnitsPerInch ); + void SetWorldTransform( const XForm& rXForm ); + void ModifyWorldTransform( const XForm& rXForm, sal_uInt32 nMode ); + +diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx +index 84b1a78..3777c3b 100644 +--- a/vcl/source/filter/wmf/winwmf.cxx ++++ b/vcl/source/filter/wmf/winwmf.cxx +@@ -1108,7 +1108,6 @@ sal_Bool WMFReader::ReadHeader() + } + } + +- pOut->SetUnitsPerInch( nUnitsPerInch ); + pOut->SetWinOrg( aPlaceableBound.TopLeft() ); + Size aWMFSize( labs( aPlaceableBound.GetWidth() ), labs( aPlaceableBound.GetHeight() ) ); + pOut->SetWinExt( aWMFSize ); +-- +1.8.4.2 + diff --git a/SOURCES/0003-fdo-72645-Case-insensitive-string-comparison-in-GETP.patch b/SOURCES/0003-fdo-72645-Case-insensitive-string-comparison-in-GETP.patch new file mode 100644 index 0000000..42101db --- /dev/null +++ b/SOURCES/0003-fdo-72645-Case-insensitive-string-comparison-in-GETP.patch @@ -0,0 +1,151 @@ +From 7c4a58833df3931c168c57be3239e904e3a3baba Mon Sep 17 00:00:00 2001 +From: Kohei Yoshida +Date: Tue, 7 Jan 2014 00:48:10 -0500 +Subject: [PATCH 3/9] fdo#72645: Case-insensitive string comparison in + GETPIVOTDATA. + +Change-Id: Ibdb2b7ab2bae03875a3462816e860f58d9076457 +Reviewed-on: https://gerrit.libreoffice.org/7285 +Reviewed-by: Eike Rathke +Tested-by: Eike Rathke +--- + sc/source/core/data/dpobject.cxx | 12 +++++++----- + sc/source/core/data/dpresfilter.cxx | 29 +++++++++++++++++++++-------- + 2 files changed, 28 insertions(+), 13 deletions(-) + +diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx +index 3d9f5af..f9344aa 100644 +--- a/sc/source/core/data/dpobject.cxx ++++ b/sc/source/core/data/dpobject.cxx +@@ -1321,24 +1321,24 @@ namespace { + + class FindByName : std::unary_function + { +- OUString maName; ++ OUString maName; // must be all uppercase. + public: + FindByName(const OUString& rName) : maName(rName) {} + bool operator() (const ScDPSaveDimension* pDim) const + { + // Layout name takes precedence. + const OUString* pLayoutName = pDim->GetLayoutName(); +- if (pLayoutName && *pLayoutName == maName) ++ if (pLayoutName && ScGlobal::pCharClass->uppercase(*pLayoutName) == maName) + return true; + + sheet::GeneralFunction eGenFunc = static_cast(pDim->GetFunction()); + ScSubTotalFunc eFunc = ScDPUtil::toSubTotalFunc(eGenFunc); + OUString aSrcName = ScDPUtil::getSourceDimensionName(pDim->GetName()); + OUString aFuncName = ScDPUtil::getDisplayedMeasureName(aSrcName, eFunc); +- if (maName == aFuncName) ++ if (maName == ScGlobal::pCharClass->uppercase(aFuncName)) + return true; + +- return maName == aSrcName; ++ return maName == ScGlobal::pCharClass->uppercase(aSrcName); + } + }; + +@@ -1382,7 +1382,9 @@ double ScDPObject::GetPivotData(const OUString& rDataFieldName, std::vector::iterator it = std::find_if( +- aDataDims.begin(), aDataDims.end(), FindByName(rDataFieldName)); ++ aDataDims.begin(), aDataDims.end(), ++ FindByName(ScGlobal::pCharClass->uppercase(rDataFieldName))); ++ + if (it == aDataDims.end()) + return fRet; + +diff --git a/sc/source/core/data/dpresfilter.cxx b/sc/source/core/data/dpresfilter.cxx +index 41b2d7e..d4895b8 100644 +--- a/sc/source/core/data/dpresfilter.cxx ++++ b/sc/source/core/data/dpresfilter.cxx +@@ -10,6 +10,7 @@ + #include "dpresfilter.hxx" + #include "global.hxx" + ++#include + #include + + #include +@@ -113,12 +114,13 @@ void ScDPResultTree::add( + + // See if this dimension exists. + DimensionsType& rDims = pMemNode->maChildDimensions; +- DimensionsType::iterator itDim = rDims.find(filter.maDimName); ++ OUString aUpperName = ScGlobal::pCharClass->uppercase(filter.maDimName); ++ DimensionsType::iterator itDim = rDims.find(aUpperName); + if (itDim == rDims.end()) + { + // New dimenison. Insert it. + std::pair r = +- rDims.insert(DimensionsType::value_type(filter.maDimName, new DimensionNode(pMemNode))); ++ rDims.insert(DimensionsType::value_type(aUpperName, new DimensionNode(pMemNode))); + + if (!r.second) + // Insertion failed! +@@ -132,13 +134,14 @@ void ScDPResultTree::add( + // Now, see if this dimension member exists. + DimensionNode* pDim = itDim->second; + MembersType& rMembers = pDim->maChildMembers; +- MembersType::iterator itMem = rMembers.find(filter.maValue); ++ aUpperName = ScGlobal::pCharClass->uppercase(filter.maValue); ++ MembersType::iterator itMem = rMembers.find(aUpperName); + if (itMem == rMembers.end()) + { + // New member. Insert it. + std::pair r = + rMembers.insert( +- MembersType::value_type(filter.maValue, new MemberNode(pDim))); ++ MembersType::value_type(aUpperName, new MemberNode(pDim))); + + if (!r.second) + // Insertion failed! +@@ -153,7 +156,10 @@ void ScDPResultTree::add( + + if (pDimName && pMemName) + { +- NamePairType aNames(*pDimName, *pMemName); ++ NamePairType aNames( ++ ScGlobal::pCharClass->uppercase(*pDimName), ++ ScGlobal::pCharClass->uppercase(*pMemName)); ++ + LeafValuesType::iterator it = maLeafValues.find(aNames); + if (it == maLeafValues.end()) + { +@@ -197,13 +203,17 @@ const ScDPResultTree::ValuesType* ScDPResultTree::getResults( + const MemberNode* pMember = mpRoot; + for (; p != pEnd; ++p) + { +- DimensionsType::const_iterator itDim = pMember->maChildDimensions.find(p->FieldName); ++ DimensionsType::const_iterator itDim = pMember->maChildDimensions.find( ++ ScGlobal::pCharClass->uppercase(p->FieldName)); ++ + if (itDim == pMember->maChildDimensions.end()) + // Specified dimension not found. + return NULL; + + const DimensionNode* pDim = itDim->second; +- MembersType::const_iterator itMem = pDim->maChildMembers.find(p->MatchValue); ++ MembersType::const_iterator itMem = pDim->maChildMembers.find( ++ ScGlobal::pCharClass->uppercase(p->MatchValue)); ++ + if (itMem == pDim->maChildMembers.end()) + // Specified member not found. + return NULL; +@@ -216,7 +226,10 @@ const ScDPResultTree::ValuesType* ScDPResultTree::getResults( + + double ScDPResultTree::getLeafResult(const com::sun::star::sheet::DataPilotFieldFilter& rFilter) const + { +- NamePairType aPair(rFilter.FieldName, rFilter.MatchValue); ++ NamePairType aPair( ++ ScGlobal::pCharClass->uppercase(rFilter.FieldName), ++ ScGlobal::pCharClass->uppercase(rFilter.MatchValue)); ++ + LeafValuesType::const_iterator it = maLeafValues.find(aPair); + if (it != maLeafValues.end()) + // Found! +-- +1.8.4.2 + diff --git a/SOURCES/0004-EMF-Implement-line-dashing.patch b/SOURCES/0004-EMF-Implement-line-dashing.patch new file mode 100644 index 0000000..6f71b50 --- /dev/null +++ b/SOURCES/0004-EMF-Implement-line-dashing.patch @@ -0,0 +1,106 @@ +From 34de60961b098416b38af8e8595e2579b2b6bc66 Mon Sep 17 00:00:00 2001 +From: Jan Holesovsky +Date: Fri, 22 Nov 2013 12:01:15 +0100 +Subject: [PATCH 004/109] EMF+: Implement line dashing. + +Change-Id: I9eb21c0a8b5baa5b0080845f61b12fc65034d959 +Reviewed-on: https://gerrit.libreoffice.org/6830 +Reviewed-by: Andras Timar +Tested-by: Andras Timar +--- + cppcanvas/source/mtfrenderer/emfplus.cxx | 51 ++++++++++++++++++++++++++++++-- + 1 file changed, 49 insertions(+), 2 deletions(-) + +diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx +index daed614..a1b6ebd 100644 +--- a/cppcanvas/source/mtfrenderer/emfplus.cxx ++++ b/cppcanvas/source/mtfrenderer/emfplus.cxx +@@ -89,6 +89,13 @@ + + #define EmfPlusRegionInitialStateInfinite 0x10000003 + ++const sal_Int32 EmfPlusLineStyleSolid = 0x00000000; ++const sal_Int32 EmfPlusLineStyleDash = 0x00000001; ++const sal_Int32 EmfPlusLineStyleDot = 0x00000002; ++const sal_Int32 EmfPlusLineStyleDashDot = 0x00000003; ++const sal_Int32 EmfPlusLineStyleDashDotDot = 0x00000004; ++const sal_Int32 EmfPlusLineStyleCustom = 0x00000005; ++ + using namespace ::com::sun::star; + using namespace ::basegfx; + +@@ -614,6 +621,34 @@ namespace cppcanvas + } + #endif + rStrokeAttributes.StrokeWidth = fabs((rState.mapModeTransform * rR.MapSize (width == 0.0 ? 0.05 : width, 0)).getX()); ++ ++ // set dashing ++ if (dashStyle != EmfPlusLineStyleSolid) ++ { ++ const float dash[] = {3, 3}; ++ const float dot[] = {1, 3}; ++ const float dashdot[] = {3, 3, 1, 3}; ++ const float dashdotdot[] = {3, 3, 1, 3, 1, 3}; ++ ++ sal_Int32 nLen = 0; ++ const float *pPattern; ++ switch (dashStyle) ++ { ++ case EmfPlusLineStyleDash: nLen = SAL_N_ELEMENTS(dash); pPattern = dash; break; ++ case EmfPlusLineStyleDot: nLen = SAL_N_ELEMENTS(dot); pPattern = dot; break; ++ case EmfPlusLineStyleDashDot: nLen = SAL_N_ELEMENTS(dashdot); pPattern = dashdot; break; ++ case EmfPlusLineStyleDashDotDot: nLen = SAL_N_ELEMENTS(dashdotdot); pPattern = dashdotdot; break; ++ case EmfPlusLineStyleCustom: nLen = dashPatternLen; pPattern = dashPattern; break; ++ } ++ if (nLen > 0) ++ { ++ uno::Sequence aDashArray(nLen); ++ for (int i = 0; i < nLen; ++i) ++ aDashArray[i] = pPattern[i]; ++ ++ rStrokeAttributes.DashArray = aDashArray; ++ } ++ } + } + + void Read (SvStream& s, ImplRenderer& rR, sal_Int32, sal_Int32 ) +@@ -651,7 +686,10 @@ namespace cppcanvas + mitterLimit = 0; + + if (penFlags & 32) ++ { + s >> dashStyle; ++ SAL_INFO("cppcanvas.emf", "EMF+\t\tdashStyle: 0x" << std::hex << dashStyle); ++ } + else + dashStyle = 0; + +@@ -665,14 +703,23 @@ namespace cppcanvas + else + dashOffset = 0; + +- if (penFlags & 256) { ++ if (penFlags & 256) ++ { ++ dashStyle = EmfPlusLineStyleCustom; ++ + s >> dashPatternLen; ++ SAL_INFO("cppcanvas.emf", "EMF+\t\tdashPatternLen: " << dashPatternLen); ++ + if( dashPatternLen<0 || sal_uInt32(dashPatternLen)>SAL_MAX_INT32/sizeof(float) ) + dashPatternLen = SAL_MAX_INT32/sizeof(float); + dashPattern = new float [dashPatternLen]; + for (i = 0; i < dashPatternLen; i++) ++ { + s >> dashPattern [i]; +- } else ++ SAL_INFO("cppcanvas.emf", "EMF+\t\t\tdashPattern[" << i << "]: " << dashPattern[i]); ++ } ++ } ++ else + dashPatternLen = 0; + + if (penFlags & 512) +-- +1.8.4.2 + diff --git a/SOURCES/0004-fdo-72774-Ensure-that-all-the-group-fields-are-in-ca.patch b/SOURCES/0004-fdo-72774-Ensure-that-all-the-group-fields-are-in-ca.patch new file mode 100644 index 0000000..4e4a7ab --- /dev/null +++ b/SOURCES/0004-fdo-72774-Ensure-that-all-the-group-fields-are-in-ca.patch @@ -0,0 +1,34 @@ +From d391dd145631ffdbc6e506ba59db7d1977331aff Mon Sep 17 00:00:00 2001 +From: Kohei Yoshida +Date: Tue, 7 Jan 2014 16:36:55 -0500 +Subject: [PATCH 4/9] fdo#72774: Ensure that all the group fields are in cache + upon file load. + +This resolves the originally reported issue in that bug (in Comment 1). + +Change-Id: I6fb85cff1eafb78d784605aa08e7d992a1ac36e0 +(cherry picked from commit 256e4ccba8a331f2d30c6b5da9dca70206deadae) +Reviewed-on: https://gerrit.libreoffice.org/7302 +Reviewed-by: Eike Rathke +Tested-by: Eike Rathke +--- + sc/source/core/data/dpobject.cxx | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx +index f9344aa..3ade4cf 100644 +--- a/sc/source/core/data/dpobject.cxx ++++ b/sc/source/core/data/dpobject.cxx +@@ -2858,6 +2858,9 @@ const ScDPCache* ScDPCollection::SheetCaches::getCache(const ScRange& rRange, co + return NULL; + } + ++ if (pDimData) ++ pDimData->WriteToCache(*itCache->second); ++ + return itCache->second; + } + +-- +1.8.4.2 + diff --git a/SOURCES/0005-EMF-Parse-and-render-custom-line-cap-data.patch b/SOURCES/0005-EMF-Parse-and-render-custom-line-cap-data.patch new file mode 100644 index 0000000..1f449aa --- /dev/null +++ b/SOURCES/0005-EMF-Parse-and-render-custom-line-cap-data.patch @@ -0,0 +1,465 @@ +From 51a8b809a999b390b26287c9f3d4d45fc8ecd8f9 Mon Sep 17 00:00:00 2001 +From: Jan Holesovsky +Date: Fri, 22 Nov 2013 17:06:10 +0100 +Subject: [PATCH 005/109] EMF+: Parse and render custom line cap data. + +Contains the following commits: + +* EMF+: Small cleanup & more logging in preparation for line starts & ends. +* EMF+: Parse custom line cap data for start and end line caps. +* EMF+: Render custom line cap data. +* EMF+: Set the stroke attributes on the custom line caps. + +Change-Id: Ibdf69c7944e4d027d9dc6974bd740f9b70fb5079 +Reviewed-on: https://gerrit.libreoffice.org/6831 +Reviewed-by: Andras Timar +Tested-by: Andras Timar +--- + cppcanvas/source/inc/implrenderer.hxx | 9 +- + cppcanvas/source/mtfrenderer/emfplus.cxx | 314 +++++++++++++++++++++++++++---- + 2 files changed, 290 insertions(+), 33 deletions(-) + +diff --git a/cppcanvas/source/inc/implrenderer.hxx b/cppcanvas/source/inc/implrenderer.hxx +index 79a2967..270c0de 100644 +--- a/cppcanvas/source/inc/implrenderer.hxx ++++ b/cppcanvas/source/inc/implrenderer.hxx +@@ -280,7 +280,14 @@ static float GetSwapFloat( SvStream& rSt ) + /* EMF+ */ + void processEMFPlus( MetaCommentAction* pAct, const ActionFactoryParameters& rFactoryParms, OutDevState& rState, const CanvasSharedPtr& rCanvas ); + double setFont( sal_uInt8 objectId, const ActionFactoryParameters& rParms, OutDevState& rState ); +- void EMFPPlusDrawPolygon (::basegfx::B2DPolyPolygon& polygon, const ActionFactoryParameters& rParms, OutDevState& rState, const CanvasSharedPtr& rCanvas, sal_uInt32 penIndex); ++ ++ /// Render LineCap, like the start or end arrow of a polygon. ++ void EMFPPlusDrawLineCap(const ::basegfx::B2DPolygon& rPolygon, double fPolyLength, ++ const ::basegfx::B2DPolyPolygon& rLineCap, bool bStart, ++ const com::sun::star::rendering::StrokeAttributes& rAttributes, ++ const ActionFactoryParameters& rParms, OutDevState& rState); ++ ++ void EMFPPlusDrawPolygon (const ::basegfx::B2DPolyPolygon& polygon, const ActionFactoryParameters& rParms, OutDevState& rState, const CanvasSharedPtr& rCanvas, sal_uInt32 penIndex); + void EMFPPlusFillPolygon (::basegfx::B2DPolyPolygon& polygon, const ActionFactoryParameters& rParms, OutDevState& rState, const CanvasSharedPtr& rCanvas, bool isColor, sal_uInt32 brushIndexOrColor); + + ActionVector maActions; +diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx +index a1b6ebd..1d752e7 100644 +--- a/cppcanvas/source/mtfrenderer/emfplus.cxx ++++ b/cppcanvas/source/mtfrenderer/emfplus.cxx +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -36,8 +37,10 @@ + #include + #include + +-#include ++#include ++#include + #include ++#include + + #include + #include +@@ -96,6 +99,22 @@ const sal_Int32 EmfPlusLineStyleDashDot = 0x00000003; + const sal_Int32 EmfPlusLineStyleDashDotDot = 0x00000004; + const sal_Int32 EmfPlusLineStyleCustom = 0x00000005; + ++const sal_uInt32 EmfPlusCustomLineCapDataTypeDefault = 0x00000000; ++const sal_uInt32 EmfPlusCustomLineCapDataTypeAdjustableArrow = 0x00000001; ++ ++const sal_uInt32 EmfPlusCustomLineCapDataFillPath = 0x00000001; ++const sal_uInt32 EmfPlusCustomLineCapDataLinePath = 0x00000002; ++ ++const sal_uInt32 EmfPlusLineCapTypeFlat = 0x00000000; ++const sal_uInt32 EmfPlusLineCapTypeSquare = 0x00000001; ++const sal_uInt32 EmfPlusLineCapTypeRound = 0x00000002; ++const sal_uInt32 EmfPlusLineCapTypeTriangle = 0x00000003; ++ ++const sal_uInt32 EmfPlusLineJoinTypeMiter = 0x00000000; ++const sal_uInt32 EmfPlusLineJoinTypeBevel = 0x00000001; ++const sal_uInt32 EmfPlusLineJoinTypeRound = 0x00000002; ++const sal_uInt32 EmfPlusLineJoinTypeMiterClipped = 0x00000003; ++ + using namespace ::com::sun::star; + using namespace ::basegfx; + +@@ -587,6 +606,137 @@ namespace cppcanvas + } + }; + ++ /// Convert stroke caps between EMF+ and rendering API ++ sal_Int8 lcl_convertStrokeCap(sal_uInt32 nEmfStroke) ++ { ++ switch (nEmfStroke) ++ { ++ case EmfPlusLineCapTypeSquare: return rendering::PathCapType::SQUARE; ++ case EmfPlusLineCapTypeRound: return rendering::PathCapType::ROUND; ++ } ++ ++ // we have no mapping for EmfPlusLineCapTypeTriangle, so return ++ // BUTT always ++ return rendering::PathCapType::BUTT; ++ } ++ ++ struct EMFPCustomLineCap : public EMFPObject ++ { ++ sal_uInt32 type; ++ sal_uInt32 strokeStartCap, strokeEndCap, strokeJoin; ++ float miterLimit; ++ basegfx::B2DPolyPolygon polygon; ++ ++ public: ++ EMFPCustomLineCap() : EMFPObject() ++ { ++ } ++ ++ ~EMFPCustomLineCap() ++ { ++ } ++ ++ void SetAttributes(rendering::StrokeAttributes& aAttributes) ++ { ++ aAttributes.StartCapType = lcl_convertStrokeCap(strokeStartCap); ++ aAttributes.EndCapType = lcl_convertStrokeCap(strokeEndCap); ++ ++ switch (strokeJoin) ++ { ++ case EmfPlusLineJoinTypeMiter: // fall-through ++ case EmfPlusLineJoinTypeMiterClipped: aAttributes.JoinType = rendering::PathJoinType::MITER; break; ++ case EmfPlusLineJoinTypeBevel: aAttributes.JoinType = rendering::PathJoinType::BEVEL; break; ++ case EmfPlusLineJoinTypeRound: aAttributes.JoinType = rendering::PathJoinType::ROUND; break; ++ } ++ ++ aAttributes.MiterLimit = miterLimit; ++ } ++ ++ void ReadPath(SvStream& s, ImplRenderer& rR, bool bClosed) ++ { ++ sal_Int32 pathLength; ++ s >> pathLength; ++ SAL_INFO("cppcanvas.emf", "EMF+\t\tpath length: " << pathLength); ++ ++ sal_uInt32 pathHeader; ++ sal_Int32 pathPoints, pathFlags; ++ s >> pathHeader >> pathPoints >> pathFlags; ++ ++ SAL_INFO("cppcanvas.emf", "EMF+\t\tpath (custom cap line path)"); ++ SAL_INFO("cppcanvas.emf", "EMF+\t\theader: 0x" << std::hex << pathHeader << " points: " << std::dec << pathPoints << " additional flags: 0x" << std::hex << pathFlags << std::dec ); ++ ++ EMFPPath path(pathPoints); ++ path.Read(s, pathFlags, rR); ++ ++ polygon = path.GetPolygon(rR, false); ++ polygon.setClosed(bClosed); ++ ++ // transformation to convert the path to what LibreOffice ++ // expects ++ B2DHomMatrix aMatrix; ++ aMatrix.scale(1.0, -1.0); ++ ++ polygon.transform(aMatrix); ++ }; ++ ++ void Read (SvStream& s, ImplRenderer& rR) ++ { ++ sal_uInt32 header; ++ ++ s >> header >> type; ++ ++ SAL_INFO("cppcanvas.emf", "EMF+\t\tcustom cap"); ++ SAL_INFO("cppcanvas.emf", "EMF+\t\theader: 0x" << std::hex << header << " type: " << type << std::dec); ++ ++ if (type == EmfPlusCustomLineCapDataTypeDefault) ++ { ++ sal_uInt32 customLineCapDataFlags, baseCap; ++ float baseInset; ++ float widthScale; ++ float fillHotSpotX, fillHotSpotY, strokeHotSpotX, strokeHotSpotY; ++ ++ s >> customLineCapDataFlags >> baseCap >> baseInset ++ >> strokeStartCap >> strokeEndCap >> strokeJoin ++ >> miterLimit >> widthScale ++ >> fillHotSpotX >> fillHotSpotY >> strokeHotSpotX >> strokeHotSpotY; ++ ++ SAL_INFO("cppcanvas.emf", "EMF+\t\tcustomLineCapDataFlags: 0x" << std::hex << customLineCapDataFlags); ++ SAL_INFO("cppcanvas.emf", "EMF+\t\tbaseCap: 0x" << std::hex << baseCap); ++ SAL_INFO("cppcanvas.emf", "EMF+\t\tbaseInset: " << baseInset); ++ SAL_INFO("cppcanvas.emf", "EMF+\t\tstrokeStartCap: 0x" << std::hex << strokeStartCap); ++ SAL_INFO("cppcanvas.emf", "EMF+\t\tstrokeEndCap: 0x" << std::hex << strokeEndCap); ++ SAL_INFO("cppcanvas.emf", "EMF+\t\tstrokeJoin: 0x" << std::hex << strokeJoin); ++ SAL_INFO("cppcanvas.emf", "EMF+\t\tmiterLimit: " << miterLimit); ++ SAL_INFO("cppcanvas.emf", "EMF+\t\twidthScale: " << widthScale); ++ ++ if (customLineCapDataFlags & EmfPlusCustomLineCapDataFillPath) ++ { ++ ReadPath(s, rR, true); ++ } ++ ++ if (customLineCapDataFlags & EmfPlusCustomLineCapDataLinePath) ++ { ++ ReadPath(s, rR, false); ++ } ++ } ++ else if (type == EmfPlusCustomLineCapDataTypeAdjustableArrow) ++ { ++ // TODO only reads the data, does not use them [I've had ++ // no test document to be able to implement it] ++ ++ sal_Int32 width, height, middleInset, fillState, lineStartCap; ++ sal_Int32 lineEndCap, lineJoin, widthScale; ++ float fillHotSpotX, fillHotSpotY, lineHotSpotX, lineHotSpotY; ++ ++ s >> width >> height >> middleInset >> fillState >> lineStartCap ++ >> lineEndCap >> lineJoin >> miterLimit >> widthScale ++ >> fillHotSpotX >> fillHotSpotY >> lineHotSpotX >> lineHotSpotY; ++ ++ SAL_INFO("cppcanvas.emf", "EMF+\t\tTODO - actually read EmfPlusCustomLineCapArrowData object (section 2.2.2.12)"); ++ } ++ } ++ }; ++ + struct EMFPPen : public EMFPBrush + { + XForm transformation; +@@ -604,16 +754,28 @@ namespace cppcanvas + sal_Int32 compoundArrayLen; + float *compoundArray; + sal_Int32 customStartCapLen; +- sal_uInt8 *customStartCap; ++ EMFPCustomLineCap *customStartCap; + sal_Int32 customEndCapLen; +- sal_uInt8 *customEndCap; ++ EMFPCustomLineCap *customEndCap; + + public: + EMFPPen () : EMFPBrush () + { ++ dashPattern = NULL; ++ compoundArray = NULL; ++ customStartCap = NULL; ++ customEndCap = NULL; + } + +- void SetStrokeAttributes (rendering::StrokeAttributes& rStrokeAttributes, ImplRenderer& rR, const OutDevState& rState) ++ ~EMFPPen () ++ { ++ delete[] dashPattern; ++ delete[] compoundArray; ++ delete customStartCap; ++ delete customEndCap; ++ } ++ ++ void SetStrokeWidth(rendering::StrokeAttributes& rStrokeAttributes, ImplRenderer& rR, const OutDevState& rState) + { + #if OSL_DEBUG_LEVEL > 1 + if (width == 0.0) { +@@ -621,8 +783,10 @@ namespace cppcanvas + } + #endif + rStrokeAttributes.StrokeWidth = fabs((rState.mapModeTransform * rR.MapSize (width == 0.0 ? 0.05 : width, 0)).getX()); ++ } + +- // set dashing ++ void SetStrokeDashing(rendering::StrokeAttributes& rStrokeAttributes) ++ { + if (dashStyle != EmfPlusLineStyleSolid) + { + const float dash[] = {3, 3}; +@@ -666,12 +830,18 @@ namespace cppcanvas + s >> transformation; + + if (penFlags & 2) ++ { + s >> startCap; ++ SAL_INFO("cppcanvas.emf", "EMF+\t\tstartCap: 0x" << std::hex << startCap); ++ } + else + startCap = 0; + + if (penFlags & 4) ++ { + s >> endCap; ++ SAL_INFO("cppcanvas.emf", "EMF+\t\tendCap: 0x" << std::hex << endCap); ++ } + else + endCap = 0; + +@@ -737,24 +907,34 @@ namespace cppcanvas + } else + compoundArrayLen = 0; + +- if (penFlags & 2048) { ++ if (penFlags & 2048) ++ { + s >> customStartCapLen; +- if( customStartCapLen<0 ) +- customStartCapLen=0; +- customStartCap = new sal_uInt8 [customStartCapLen]; +- for (i = 0; i < customStartCapLen; i++) +- s >> customStartCap [i]; +- } else ++ SAL_INFO("cppcanvas.emf", "EMF+\t\tcustomStartCapLen: " << customStartCapLen); ++ sal_uInt32 pos = s.Tell(); ++ ++ customStartCap = new EMFPCustomLineCap(); ++ customStartCap->Read(s, rR); ++ ++ // maybe we don't read everything yet, play it safe ;-) ++ s.Seek(pos + customStartCapLen); ++ } ++ else + customStartCapLen = 0; + +- if (penFlags & 4096) { ++ if (penFlags & 4096) ++ { + s >> customEndCapLen; +- if( customEndCapLen<0 ) +- customEndCapLen=0; +- customEndCap = new sal_uInt8 [customEndCapLen]; +- for (i = 0; i < customEndCapLen; i++) +- s >> customEndCap [i]; +- } else ++ SAL_INFO("cppcanvas.emf", "EMF+\t\tcustomEndCapLen: " << customEndCapLen); ++ sal_uInt32 pos = s.Tell(); ++ ++ customEndCap = new EMFPCustomLineCap(); ++ customEndCap->Read(s, rR); ++ ++ // maybe we don't read everything yet, play it safe ;-) ++ s.Seek(pos + customEndCapLen); ++ } ++ else + customEndCapLen = 0; + + EMFPBrush::Read (s, rR); +@@ -1140,7 +1320,39 @@ namespace cppcanvas + } + } + +- void ImplRenderer::EMFPPlusDrawPolygon (::basegfx::B2DPolyPolygon& polygon, const ActionFactoryParameters& rParms, ++ ++ void ImplRenderer::EMFPPlusDrawLineCap(const ::basegfx::B2DPolygon& rPolygon, double fPolyLength, ++ const ::basegfx::B2DPolyPolygon& rLineCap, bool bStart, const rendering::StrokeAttributes& rAttributes, ++ const ActionFactoryParameters& rParms, OutDevState& rState) ++ { ++ if (!rLineCap.count()) ++ return; ++ ++ // it seems the line caps in EMF+ are 4*larger than what ++ // LibreOffice expects, and the mapping in ++ // createAreaGeometryForLineStartEnd scales that down, so ++ // correct it ++ // [unfortunately found no proof for this in the spec :-( - please ++ // feel free to correct this if it causes trouble] ++ double fWidth = rAttributes.StrokeWidth*4; ++ ++ basegfx::B2DPolyPolygon aArrow(basegfx::tools::createAreaGeometryForLineStartEnd( ++ rPolygon, rLineCap, bStart, ++ fWidth, fPolyLength, 0.0, NULL)); ++ ++ // createAreaGeometryForLineStartEnd from some reason always sets ++ // the path as closed, correct it ++ aArrow.setClosed(rLineCap.isClosed()); ++ ++ ActionSharedPtr pAction(internal::PolyPolyActionFactory::createPolyPolyAction(aArrow, rParms.mrCanvas, rState, rAttributes)); ++ if (pAction) ++ { ++ maActions.push_back(MtfAction(pAction, rParms.mrCurrActionIndex)); ++ rParms.mrCurrActionIndex += pAction->getActionCount()-1; ++ } ++ } ++ ++ void ImplRenderer::EMFPPlusDrawPolygon (const ::basegfx::B2DPolyPolygon& polygon, const ActionFactoryParameters& rParms, + OutDevState& rState, const CanvasSharedPtr& rCanvas, sal_uInt32 penIndex) + { + EMFPPen* pen = (EMFPPen*) aObjects [penIndex & 0xff]; +@@ -1154,24 +1366,62 @@ namespace cppcanvas + rState.lineColor = ::vcl::unotools::colorToDoubleSequence (pen->GetColor (), + rCanvas->getUNOCanvas ()->getDevice()->getDeviceColorSpace()); + +- polygon.transform( rState.mapModeTransform ); +- rendering::StrokeAttributes aStrokeAttributes; ++ basegfx::B2DPolyPolygon aPolyPolygon(polygon); ++ aPolyPolygon.transform(rState.mapModeTransform); ++ rendering::StrokeAttributes aCommonAttributes; + +- pen->SetStrokeAttributes (aStrokeAttributes, *this, rState); ++ // some attributes are common for the polygon, and the line ++ // starts & ends - like the stroke width ++ pen->SetStrokeWidth(aCommonAttributes, *this, rState); + +- ActionSharedPtr pPolyAction( +- internal::PolyPolyActionFactory::createPolyPolyAction( +- polygon, rParms.mrCanvas, rState, aStrokeAttributes ) ); ++ // but eg. dashing has to be additionally set only on the ++ // polygon ++ rendering::StrokeAttributes aPolygonAttributes(aCommonAttributes); ++ pen->SetStrokeDashing(aPolygonAttributes); + ++ // render the polygon ++ ActionSharedPtr pPolyAction(internal::PolyPolyActionFactory::createPolyPolyAction(aPolyPolygon, rParms.mrCanvas, rState, aPolygonAttributes)); + if( pPolyAction ) + { +- maActions.push_back( +- MtfAction( +- pPolyAction, +- rParms.mrCurrActionIndex ) ); +- ++ maActions.push_back(MtfAction(pPolyAction, rParms.mrCurrActionIndex)); + rParms.mrCurrActionIndex += pPolyAction->getActionCount()-1; + } ++ ++ // render line starts & ends ++ if (pen->customStartCap || pen->customEndCap) ++ { ++ for (sal_uInt32 i = 0; i < aPolyPolygon.count(); ++i) ++ { ++ // break the polypolygon into polygons ++ basegfx::B2DPolygon aPolygon(aPolyPolygon.getB2DPolygon(i)); ++ ++ if (aPolygon.isClosed()) ++ continue; ++ ++ double fPolyLength = basegfx::tools::getLength(aPolygon); ++ ++ // line start ++ if (pen->customStartCap) ++ { ++ rendering::StrokeAttributes aAttributes(aCommonAttributes); ++ pen->customStartCap->SetAttributes(aAttributes); ++ ++ EMFPPlusDrawLineCap(aPolygon, fPolyLength, pen->customStartCap->polygon, ++ true, aAttributes, rParms, rState); ++ } ++ ++ // line end ++ if (pen->customEndCap) ++ { ++ rendering::StrokeAttributes aAttributes(aCommonAttributes); ++ pen->customEndCap->SetAttributes(aAttributes); ++ ++ EMFPPlusDrawLineCap(aPolygon, fPolyLength, pen->customEndCap->polygon, ++ false, aAttributes, rParms, rState); ++ } ++ } ++ } ++ + } + } + +@@ -1550,7 +1800,7 @@ namespace cppcanvas + + rendering::StrokeAttributes aStrokeAttributes; + +- pen->SetStrokeAttributes (aStrokeAttributes, *this, rState); ++ pen->SetStrokeWidth (aStrokeAttributes, *this, rState); + + ActionSharedPtr pPolyAction( + internal::PolyPolyActionFactory::createPolyPolyAction( +-- +1.8.4.2 + diff --git a/SOURCES/0005-fdo-72774-Generate-correct-group-items-for-the-year-.patch b/SOURCES/0005-fdo-72774-Generate-correct-group-items-for-the-year-.patch new file mode 100644 index 0000000..234443f --- /dev/null +++ b/SOURCES/0005-fdo-72774-Generate-correct-group-items-for-the-year-.patch @@ -0,0 +1,93 @@ +From 584b8621afec7a77ceab2e2f029687a7dd1a18c3 Mon Sep 17 00:00:00 2001 +From: Kohei Yoshida +Date: Tue, 7 Jan 2014 22:13:07 -0500 +Subject: [PATCH 5/9] fdo#72774: Generate correct group items for the year + group. + +This changes bring it back to the same algorithm used in 3.5. + +Change-Id: I16855cef1de133a1f886baa823d5b0d2b148e781 +(cherry picked from commit c2e88a32314012afb799e321ec1d658f99f71781) +Reviewed-on: https://gerrit.libreoffice.org/7306 +Reviewed-by: Eike Rathke +Tested-by: Eike Rathke +--- + sc/inc/dputil.hxx | 2 +- + sc/source/core/data/dpdimsave.cxx | 4 ++-- + sc/source/core/data/dpgroup.cxx | 2 +- + sc/source/core/data/dputil.cxx | 13 ++++++++----- + 4 files changed, 12 insertions(+), 9 deletions(-) + +diff --git a/sc/inc/dputil.hxx b/sc/inc/dputil.hxx +index e4ed831..9568e95 100644 +--- a/sc/inc/dputil.hxx ++++ b/sc/inc/dputil.hxx +@@ -45,7 +45,7 @@ public: + SvNumberFormatter* pFormatter); + + static sal_Int32 getDatePartValue( +- double fValue, const ScDPNumGroupInfo& rInfo, sal_Int32 nDatePart, ++ double fValue, const ScDPNumGroupInfo* pInfo, sal_Int32 nDatePart, + SvNumberFormatter* pFormatter); + + static OUString getDisplayedMeasureName(const OUString& rName, ScSubTotalFunc eFunc); +diff --git a/sc/source/core/data/dpdimsave.cxx b/sc/source/core/data/dpdimsave.cxx +index 16f68b8..2db4023 100644 +--- a/sc/source/core/data/dpdimsave.cxx ++++ b/sc/source/core/data/dpdimsave.cxx +@@ -338,8 +338,8 @@ void fillDateGroupDimension( + { + case sheet::DataPilotFieldGroupBy::YEARS: + nStart = ScDPUtil::getDatePartValue( +- fSourceMin, rDateInfo, sheet::DataPilotFieldGroupBy::YEARS, pFormatter); +- nEnd = ScDPUtil::getDatePartValue(fSourceMax, rDateInfo, sheet::DataPilotFieldGroupBy::YEARS, pFormatter); ++ fSourceMin, NULL, sheet::DataPilotFieldGroupBy::YEARS, pFormatter); ++ nEnd = ScDPUtil::getDatePartValue(fSourceMax, NULL, sheet::DataPilotFieldGroupBy::YEARS, pFormatter); + break; + case sheet::DataPilotFieldGroupBy::QUARTERS: nStart = 1; nEnd = 4; break; + case sheet::DataPilotFieldGroupBy::MONTHS: nStart = 1; nEnd = 12; break; +diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx +index 1e8059a..6a9f824 100644 +--- a/sc/source/core/data/dpgroup.cxx ++++ b/sc/source/core/data/dpgroup.cxx +@@ -911,7 +911,7 @@ void ScDPGroupTableData::FillGroupValues(vector& rItems, const vectorGetFormatTable(); + sal_Int32 nPartValue = ScDPUtil::getDatePartValue( +- pData->GetValue(), *pNumInfo, nDatePart, pFormatter); ++ pData->GetValue(), pNumInfo, nDatePart, pFormatter); + + ScDPItemData aItem(nDatePart, nPartValue); + rItems[i] = pCache->GetIdByItemData(nColumn, aItem); +diff --git a/sc/source/core/data/dputil.cxx b/sc/source/core/data/dputil.cxx +index e34bc79..558e189 100644 +--- a/sc/source/core/data/dputil.cxx ++++ b/sc/source/core/data/dputil.cxx +@@ -294,16 +294,19 @@ OUString ScDPUtil::getNumGroupName( + } + + sal_Int32 ScDPUtil::getDatePartValue( +- double fValue, const ScDPNumGroupInfo& rInfo, sal_Int32 nDatePart, ++ double fValue, const ScDPNumGroupInfo* pInfo, sal_Int32 nDatePart, + SvNumberFormatter* pFormatter) + { + // Start and end are inclusive + // (End date without a time value is included, with a time value it's not) + +- if (fValue < rInfo.mfStart && !rtl::math::approxEqual(fValue, rInfo.mfStart)) +- return ScDPItemData::DateFirst; +- if (fValue > rInfo.mfEnd && !rtl::math::approxEqual(fValue, rInfo.mfEnd)) +- return ScDPItemData::DateLast; ++ if (pInfo) ++ { ++ if (fValue < pInfo->mfStart && !rtl::math::approxEqual(fValue, pInfo->mfStart)) ++ return ScDPItemData::DateFirst; ++ if (fValue > pInfo->mfEnd && !rtl::math::approxEqual(fValue, pInfo->mfEnd)) ++ return ScDPItemData::DateLast; ++ } + + sal_Int32 nResult = 0; + +-- +1.8.4.2 + diff --git a/SOURCES/0006-EMF-Line-thickness-has-to-be-considered-when-drawing.patch b/SOURCES/0006-EMF-Line-thickness-has-to-be-considered-when-drawing.patch new file mode 100644 index 0000000..9a026e4 --- /dev/null +++ b/SOURCES/0006-EMF-Line-thickness-has-to-be-considered-when-drawing.patch @@ -0,0 +1,217 @@ +From 26bfc77430c40530113d3ce739896139522565f4 Mon Sep 17 00:00:00 2001 +From: Jan Holesovsky +Date: Wed, 27 Nov 2013 11:51:32 +0100 +Subject: [PATCH 006/109] EMF+: Line thickness has to be considered when + drawing the caps. + +Change-Id: I6043ee3c214f453afaef06125993c73be624c07e +Reviewed-on: https://gerrit.libreoffice.org/6832 +Reviewed-by: Andras Timar +Tested-by: Andras Timar +--- + basegfx/source/polygon/b2dlinegeometry.cxx | 7 +-- + cppcanvas/source/inc/implrenderer.hxx | 3 +- + cppcanvas/source/mtfrenderer/emfplus.cxx | 75 +++++++++++++++++------------ + include/basegfx/polygon/b2dlinegeometry.hxx | 7 ++- + 4 files changed, 55 insertions(+), 37 deletions(-) + +diff --git a/basegfx/source/polygon/b2dlinegeometry.cxx b/basegfx/source/polygon/b2dlinegeometry.cxx +index 5c016bb..417944d 100644 +--- a/basegfx/source/polygon/b2dlinegeometry.cxx ++++ b/basegfx/source/polygon/b2dlinegeometry.cxx +@@ -44,7 +44,8 @@ namespace basegfx + double fWidth, + double fCandidateLength, + double fDockingPosition, // 0->top, 1->bottom +- double* pConsumedLength) ++ double* pConsumedLength, ++ double fShift) + { + B2DPolyPolygon aRetval; + OSL_ENSURE(rCandidate.count() > 1L, "createAreaGeometryForLineStartEnd: Line polygon has too less points (!)"); +@@ -89,7 +90,7 @@ namespace basegfx + const double fArrowYLength(B2DVector(aUpperCenter).getLength()); + + // move arrow to have docking position centered +- aArrowTransform.translate(0.0, -fArrowYLength * fDockingPosition); ++ aArrowTransform.translate(0.0, -fArrowYLength * fDockingPosition + fShift); + + // prepare polygon length + if(fTools::equalZero(fCandidateLength)) +@@ -98,7 +99,7 @@ namespace basegfx + } + + // get the polygon vector we want to plant this arrow on +- const double fConsumedLength(fArrowYLength * (1.0 - fDockingPosition)); ++ const double fConsumedLength(fArrowYLength * (1.0 - fDockingPosition) - fShift); + const B2DVector aHead(rCandidate.getB2DPoint((bStart) ? 0L : rCandidate.count() - 1L)); + const B2DVector aTail(getPositionAbsolute(rCandidate, + (bStart) ? fConsumedLength : fCandidateLength - fConsumedLength, fCandidateLength)); +diff --git a/cppcanvas/source/inc/implrenderer.hxx b/cppcanvas/source/inc/implrenderer.hxx +index 270c0de..d602945 100644 +--- a/cppcanvas/source/inc/implrenderer.hxx ++++ b/cppcanvas/source/inc/implrenderer.hxx +@@ -282,7 +282,8 @@ static float GetSwapFloat( SvStream& rSt ) + double setFont( sal_uInt8 objectId, const ActionFactoryParameters& rParms, OutDevState& rState ); + + /// Render LineCap, like the start or end arrow of a polygon. +- void EMFPPlusDrawLineCap(const ::basegfx::B2DPolygon& rPolygon, double fPolyLength, ++ /// @return how much we should shorten the original polygon. ++ double EMFPPlusDrawLineCap(const ::basegfx::B2DPolygon& rPolygon, double fPolyLength, + const ::basegfx::B2DPolyPolygon& rLineCap, bool bStart, + const com::sun::star::rendering::StrokeAttributes& rAttributes, + const ActionFactoryParameters& rParms, OutDevState& rState); +diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx +index 1d752e7..bf9720b 100644 +--- a/cppcanvas/source/mtfrenderer/emfplus.cxx ++++ b/cppcanvas/source/mtfrenderer/emfplus.cxx +@@ -1320,13 +1320,12 @@ namespace cppcanvas + } + } + +- +- void ImplRenderer::EMFPPlusDrawLineCap(const ::basegfx::B2DPolygon& rPolygon, double fPolyLength, ++ double ImplRenderer::EMFPPlusDrawLineCap(const ::basegfx::B2DPolygon& rPolygon, double fPolyLength, + const ::basegfx::B2DPolyPolygon& rLineCap, bool bStart, const rendering::StrokeAttributes& rAttributes, + const ActionFactoryParameters& rParms, OutDevState& rState) + { + if (!rLineCap.count()) +- return; ++ return 0.0; + + // it seems the line caps in EMF+ are 4*larger than what + // LibreOffice expects, and the mapping in +@@ -1338,7 +1337,7 @@ namespace cppcanvas + + basegfx::B2DPolyPolygon aArrow(basegfx::tools::createAreaGeometryForLineStartEnd( + rPolygon, rLineCap, bStart, +- fWidth, fPolyLength, 0.0, NULL)); ++ fWidth, fPolyLength, 0, NULL, rAttributes.StrokeWidth)); + + // createAreaGeometryForLineStartEnd from some reason always sets + // the path as closed, correct it +@@ -1350,6 +1349,8 @@ namespace cppcanvas + maActions.push_back(MtfAction(pAction, rParms.mrCurrActionIndex)); + rParms.mrCurrActionIndex += pAction->getActionCount()-1; + } ++ ++ return rAttributes.StrokeWidth; + } + + void ImplRenderer::EMFPPlusDrawPolygon (const ::basegfx::B2DPolyPolygon& polygon, const ActionFactoryParameters& rParms, +@@ -1379,49 +1380,59 @@ namespace cppcanvas + rendering::StrokeAttributes aPolygonAttributes(aCommonAttributes); + pen->SetStrokeDashing(aPolygonAttributes); + +- // render the polygon +- ActionSharedPtr pPolyAction(internal::PolyPolyActionFactory::createPolyPolyAction(aPolyPolygon, rParms.mrCanvas, rState, aPolygonAttributes)); +- if( pPolyAction ) +- { +- maActions.push_back(MtfAction(pPolyAction, rParms.mrCurrActionIndex)); +- rParms.mrCurrActionIndex += pPolyAction->getActionCount()-1; +- } ++ basegfx::B2DPolyPolygon aFinalPolyPolygon; + +- // render line starts & ends +- if (pen->customStartCap || pen->customEndCap) ++ // render line starts & ends if present ++ if (!pen->customStartCap && !pen->customEndCap) ++ aFinalPolyPolygon = aPolyPolygon; ++ else + { + for (sal_uInt32 i = 0; i < aPolyPolygon.count(); ++i) + { +- // break the polypolygon into polygons + basegfx::B2DPolygon aPolygon(aPolyPolygon.getB2DPolygon(i)); + +- if (aPolygon.isClosed()) +- continue; ++ if (!aPolygon.isClosed()) ++ { ++ double fStart = 0.0; ++ double fEnd = 0.0; ++ double fPolyLength = basegfx::tools::getLength(aPolygon); + +- double fPolyLength = basegfx::tools::getLength(aPolygon); ++ // line start ++ if (pen->customStartCap) ++ { ++ rendering::StrokeAttributes aAttributes(aCommonAttributes); ++ pen->customStartCap->SetAttributes(aAttributes); + +- // line start +- if (pen->customStartCap) +- { +- rendering::StrokeAttributes aAttributes(aCommonAttributes); +- pen->customStartCap->SetAttributes(aAttributes); ++ fStart = EMFPPlusDrawLineCap(aPolygon, fPolyLength, pen->customStartCap->polygon, ++ true, aAttributes, rParms, rState); ++ } + +- EMFPPlusDrawLineCap(aPolygon, fPolyLength, pen->customStartCap->polygon, +- true, aAttributes, rParms, rState); +- } ++ // line end ++ if (pen->customEndCap) ++ { ++ rendering::StrokeAttributes aAttributes(aCommonAttributes); ++ pen->customEndCap->SetAttributes(aAttributes); + +- // line end +- if (pen->customEndCap) +- { +- rendering::StrokeAttributes aAttributes(aCommonAttributes); +- pen->customEndCap->SetAttributes(aAttributes); ++ fEnd = EMFPPlusDrawLineCap(aPolygon, fPolyLength, pen->customEndCap->polygon, ++ false, aAttributes, rParms, rState); ++ } + +- EMFPPlusDrawLineCap(aPolygon, fPolyLength, pen->customEndCap->polygon, +- false, aAttributes, rParms, rState); ++ // build new poly, consume something from the old poly ++ if (fStart != 0.0 || fEnd != 0.0) ++ aPolygon = basegfx::tools::getSnippetAbsolute(aPolygon, fStart, fPolyLength - fEnd, fPolyLength); + } ++ ++ aFinalPolyPolygon.append(aPolygon); + } + } + ++ // finally render the polygon ++ ActionSharedPtr pPolyAction(internal::PolyPolyActionFactory::createPolyPolyAction(aFinalPolyPolygon, rParms.mrCanvas, rState, aPolygonAttributes)); ++ if( pPolyAction ) ++ { ++ maActions.push_back(MtfAction(pPolyAction, rParms.mrCurrActionIndex)); ++ rParms.mrCurrActionIndex += pPolyAction->getActionCount()-1; ++ } + } + } + +diff --git a/include/basegfx/polygon/b2dlinegeometry.hxx b/include/basegfx/polygon/b2dlinegeometry.hxx +index 934158f..62e230f 100644 +--- a/include/basegfx/polygon/b2dlinegeometry.hxx ++++ b/include/basegfx/polygon/b2dlinegeometry.hxx +@@ -63,6 +63,10 @@ namespace basegfx + again calculating the length (which may be expensive with beziers). If 0.0 is + given, the length is calculated on demand. + ++ @param fShift ++ When it is necessary to count with the thickness of the line, it ++ makes sense to move the start position slightly - so define the shift. ++ + @return + The Line start and end polygon, correctly rotated and scaled + */ +@@ -73,7 +77,8 @@ namespace basegfx + double fWidth, + double fCandidateLength = 0.0, // 0.0 -> calculate self + double fDockingPosition = 0.5, // 0->top, 1->bottom +- double* pConsumedLength = 0L); ++ double* pConsumedLength = 0L, ++ double fShift = 0.0); + + /** create filled polygon geometry for lines with a line width + +-- +1.8.4.2 + diff --git a/SOURCES/0006-fix-occasional-crash-on-dragging-and-dropping-pages-.patch b/SOURCES/0006-fix-occasional-crash-on-dragging-and-dropping-pages-.patch new file mode 100644 index 0000000..a7f9c7d --- /dev/null +++ b/SOURCES/0006-fix-occasional-crash-on-dragging-and-dropping-pages-.patch @@ -0,0 +1,143 @@ +From 152b0dd43165106f9c01bab33017e23dadf91fb6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Thu, 12 Dec 2013 10:39:06 +0000 +Subject: [PATCH 6/9] fix occasional crash on dragging and dropping pages in + slidesorters + +pages go into the cache, and sometimes they get deleted before the +cache gets processed. Remove deleted pages when they go away + +Change-Id: I291072a8541f4ca36979e9914975d81cc23a9497 +(cherry picked from commit abe9d1463282690313aaf91d2a54011d10b900b9) +(cherry picked from commit 026e9335d792c6557255f064960e0ef6d28728e0) +Reviewed-on: https://gerrit.libreoffice.org/7053 +Reviewed-by: David Tardon +Tested-by: David Tardon +--- + sd/source/ui/slidesorter/cache/SlsRequestQueue.cxx | 33 +++++++++++++++++++--- + sd/source/ui/slidesorter/cache/SlsRequestQueue.hxx | 12 ++++++-- + 2 files changed, 38 insertions(+), 7 deletions(-) + +diff --git a/sd/source/ui/slidesorter/cache/SlsRequestQueue.cxx b/sd/source/ui/slidesorter/cache/SlsRequestQueue.cxx +index 835787b..cdc2b57 100644 +--- a/sd/source/ui/slidesorter/cache/SlsRequestQueue.cxx ++++ b/sd/source/ui/slidesorter/cache/SlsRequestQueue.cxx +@@ -94,6 +94,7 @@ RequestQueue::RequestQueue (const SharedCacheContext& rpCacheContext) + + RequestQueue::~RequestQueue (void) + { ++ Clear(); + } + + +@@ -120,7 +121,15 @@ void RequestQueue::AddRequest ( + // order. + sal_Int32 nPriority (mpCacheContext->GetPriority(aKey)); + Request aRequest (aKey, nPriority, eRequestClass); +- mpRequestQueue->insert(aRequest); ++ ++ std::pair ret = mpRequestQueue->insert(aRequest); ++ bool bInserted = ret.second == true; ++ ++ if (bInserted) ++ { ++ SdrPage *pPage = const_cast(aRequest.maKey); ++ pPage->AddPageUser(*this); ++ } + + SSCD_SET_REQUEST_CLASS(aKey,eRequestClass); + +@@ -131,8 +140,11 @@ void RequestQueue::AddRequest ( + #endif + } + +- +- ++void RequestQueue::PageInDestruction(const SdrPage& rPage) ++{ ++ //remove any requests pending for this page which is going away now ++ RemoveRequest(&rPage); ++} + + bool RequestQueue::RemoveRequest ( + CacheKey aKey) +@@ -152,7 +164,11 @@ bool RequestQueue::RemoveRequest ( + mnMinimumPriority++; + else if (aRequestIterator->mnPriorityInClass == mnMaximumPriority-1) + mnMaximumPriority--; ++ ++ SdrPage *pPage = const_cast(aRequestIterator->maKey); ++ pPage->RemovePageUser(*this); + mpRequestQueue->erase(aRequestIterator); ++ + bRequestWasRemoved = true; + + if (bRequestWasRemoved) +@@ -229,7 +245,10 @@ void RequestQueue::PopFront (void) + { + SSCD_SET_STATUS(maRequestQueue.begin()->mpData->GetPage(),NONE); + +- mpRequestQueue->erase(mpRequestQueue->begin()); ++ Container::const_iterator aIter(mpRequestQueue->begin()); ++ SdrPage *pPage = const_cast(aIter->maKey); ++ pPage->RemovePageUser(*this); ++ mpRequestQueue->erase(aIter); + + // Reset the priority counter if possible. + if (mpRequestQueue->empty()) +@@ -256,6 +275,12 @@ void RequestQueue::Clear (void) + { + ::osl::MutexGuard aGuard (maMutex); + ++ for (Container::iterator aI = mpRequestQueue->begin(), aEnd = mpRequestQueue->end(); aI != aEnd; ++aI) ++ { ++ SdrPage *pPage = const_cast(aI->maKey); ++ pPage->RemovePageUser(*this); ++ } ++ + mpRequestQueue->clear(); + mnMinimumPriority = 0; + mnMaximumPriority = 1; +diff --git a/sd/source/ui/slidesorter/cache/SlsRequestQueue.hxx b/sd/source/ui/slidesorter/cache/SlsRequestQueue.hxx +index 78a4627..088a135 100644 +--- a/sd/source/ui/slidesorter/cache/SlsRequestQueue.hxx ++++ b/sd/source/ui/slidesorter/cache/SlsRequestQueue.hxx +@@ -24,7 +24,8 @@ + #include "cache/SlsCacheContext.hxx" + #include "taskpane/SlideSorterCacheDisplay.hxx" + #include +-#include "osl/mutex.hxx" ++#include ++#include + + + namespace sd { namespace slidesorter { namespace cache { +@@ -34,11 +35,11 @@ class RequestData; + /** The request queue stores requests that are described by the RequestData + sorted according to priority class and then priority. + */ +-class RequestQueue ++class RequestQueue : public sdr::PageUser + { + public: + RequestQueue (const SharedCacheContext& rpCacheContext); +- ~RequestQueue (void); ++ virtual ~RequestQueue(); + + /** Insert a request with highest or lowest priority in its priority + class. When the request is already present then it is first +@@ -99,6 +100,11 @@ public: + */ + ::osl::Mutex& GetMutex (void); + ++ /** Ensure we don't hand out a page deleted before anyone got a ++ chance to process it ++ */ ++ virtual void PageInDestruction(const SdrPage& rPage); ++ + private: + ::osl::Mutex maMutex; + class Container; +-- +1.8.4.2 + diff --git a/SOURCES/0007-cairo-canvas-Line-dashing-size-depends-on-the-line-w.patch b/SOURCES/0007-cairo-canvas-Line-dashing-size-depends-on-the-line-w.patch new file mode 100644 index 0000000..5554a16 --- /dev/null +++ b/SOURCES/0007-cairo-canvas-Line-dashing-size-depends-on-the-line-w.patch @@ -0,0 +1,30 @@ +From 35e44c9d756f3815b00be9aabbb19bd36c430b37 Mon Sep 17 00:00:00 2001 +From: Jan Holesovsky +Date: Wed, 27 Nov 2013 13:11:04 +0100 +Subject: [PATCH 007/109] cairo canvas: Line dashing size depends on the line + width. + +Change-Id: I6a3f563b6effd37b448ec3e8463a87879e0566d4 +Reviewed-on: https://gerrit.libreoffice.org/6833 +Reviewed-by: Andras Timar +Tested-by: Andras Timar +--- + canvas/source/cairo/cairo_canvashelper.cxx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/canvas/source/cairo/cairo_canvashelper.cxx b/canvas/source/cairo/cairo_canvashelper.cxx +index ca75d35..5953495 100644 +--- a/canvas/source/cairo/cairo_canvashelper.cxx ++++ b/canvas/source/cairo/cairo_canvashelper.cxx +@@ -1230,7 +1230,7 @@ namespace cairocanvas + { + double* pDashArray = new double[ strokeAttributes.DashArray.getLength() ]; + for( sal_Int32 i=0; i +Date: Mon, 6 Jan 2014 16:40:59 +0100 +Subject: [PATCH 7/9] fdo#37167 create statement before + execute/wasNull/getBoolean + +This populates "object" member variable. + +The "createStatement" calls were removed in: + + commit b9392a36645d8632b97ad79240f483b3a1683b61 + Author: Ivo Hinkelmann + Date: Thu Apr 23 10:42:05 2009 +0000 + + CWS-TOOLING: integrate CWS dbaperf1 + +This was most probably in error since the call is not removed from the +other modified member functions in this commit and/or failed to +aaccount for the scenario of no parameter (and thus no setXXX call +before execute). + +Change-Id: Ic0e7b7b64ea496791f32c1416aa7d4416f909616 +Reviewed-on: https://gerrit.libreoffice.org/7280 +Reviewed-by: David Tardon +Tested-by: David Tardon +--- + connectivity/source/drivers/jdbc/CallableStatement.cxx | 4 ++++ + connectivity/source/drivers/jdbc/PreparedStatement.cxx | 5 +++++ + 2 files changed, 9 insertions(+) + +diff --git a/connectivity/source/drivers/jdbc/CallableStatement.cxx b/connectivity/source/drivers/jdbc/CallableStatement.cxx +index 7ab349f..50cce64 100644 +--- a/connectivity/source/drivers/jdbc/CallableStatement.cxx ++++ b/connectivity/source/drivers/jdbc/CallableStatement.cxx +@@ -69,12 +69,16 @@ Any SAL_CALL java_sql_CallableStatement::queryInterface( const Type & rType ) th + // ------------------------------------------------------------------------- + sal_Bool SAL_CALL java_sql_CallableStatement::wasNull( ) throw(starsdbc::SQLException, RuntimeException) + { ++ SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); ++ createStatement(t.pEnv); + static jmethodID mID(NULL); + return callBooleanMethod( "wasNull", mID ); + } + + sal_Bool SAL_CALL java_sql_CallableStatement::getBoolean( sal_Int32 columnIndex ) throw(starsdbc::SQLException, RuntimeException) + { ++ SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); ++ createStatement(t.pEnv); + static jmethodID mID(NULL); + return callBooleanMethodWithIntArg( "getBoolean", mID,columnIndex ); + } +diff --git a/connectivity/source/drivers/jdbc/PreparedStatement.cxx b/connectivity/source/drivers/jdbc/PreparedStatement.cxx +index 0458ad7..5f9dafe 100644 +--- a/connectivity/source/drivers/jdbc/PreparedStatement.cxx ++++ b/connectivity/source/drivers/jdbc/PreparedStatement.cxx +@@ -96,6 +96,8 @@ sal_Bool SAL_CALL java_sql_PreparedStatement::execute( ) throw(::com::sun::star + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); + ++ SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); ++ createStatement(t.pEnv); + static jmethodID mID(NULL); + return callBooleanMethod( "execute", mID ); + } +@@ -106,6 +108,9 @@ sal_Int32 SAL_CALL java_sql_PreparedStatement::executeUpdate( ) throw(::com::su + ::osl::MutexGuard aGuard( m_aMutex ); + checkDisposed(java_sql_Statement_BASE::rBHelper.bDisposed); + m_aLogger.log( LogLevel::FINE, STR_LOG_EXECUTING_PREPARED_UPDATE ); ++ ++ SDBThreadAttach t; OSL_ENSURE(t.pEnv,"Java Enviroment geloescht worden!"); ++ createStatement(t.pEnv); + static jmethodID mID(NULL); + return callIntMethod("executeUpdate",mID); + } +-- +1.8.4.2 + diff --git a/SOURCES/0008-fdo-72219-Fix-for-corruption-of-symbols-in-docx.patch b/SOURCES/0008-fdo-72219-Fix-for-corruption-of-symbols-in-docx.patch new file mode 100644 index 0000000..90876aa --- /dev/null +++ b/SOURCES/0008-fdo-72219-Fix-for-corruption-of-symbols-in-docx.patch @@ -0,0 +1,91 @@ +From 2421317990d00e14325298f34db3c60735527697 Mon Sep 17 00:00:00 2001 +From: Rohit Deshmukh +Date: Fri, 6 Dec 2013 15:42:53 +0530 +Subject: [PATCH 8/9] fdo#72219: Fix for corruption of symbols in docx + +Issue: +OUString uses UTF-16, so for a Unicode surrogate character there are 2 +values stored, not just 1. +So we are getting assert failure in "rtl_uString_iterateCodePoints" method. + +erAck: Underlying cause was that the dictionary breakiterator misused +UTF-16 positions as Unicode code point positions. + +Change-Id: I923485f56c2d879b63687adaea2b489a3479991c +Reviewed-on: https://gerrit.libreoffice.org/6955 +Reviewed-by: Eike Rathke +Tested-by: Eike Rathke +(cherry picked from commit d8fd15875901d584a4bbcc07c927fa20332e4841) +Reviewed-on: https://gerrit.libreoffice.org/7322 +(cherry picked from commit 994d0c9e7aa8d1a7602e61b770991da980c1cde5) +Reviewed-on: https://gerrit.libreoffice.org/7324 +--- + i18npool/qa/cppunit/test_breakiterator.cxx | 19 ++++++++++++++++++- + i18npool/source/breakiterator/xdictionary.cxx | 6 ++++-- + 2 files changed, 22 insertions(+), 3 deletions(-) + +diff --git a/i18npool/qa/cppunit/test_breakiterator.cxx b/i18npool/qa/cppunit/test_breakiterator.cxx +index 41e4077..b4174ba 100644 +--- a/i18npool/qa/cppunit/test_breakiterator.cxx ++++ b/i18npool/qa/cppunit/test_breakiterator.cxx +@@ -44,7 +44,7 @@ public: + #endif + void testKhmer(); + void testJapanese(); +- ++ void testChinese(); + CPPUNIT_TEST_SUITE(TestBreakIterator); + CPPUNIT_TEST(testLineBreaking); + CPPUNIT_TEST(testGraphemeIteration); +@@ -60,6 +60,7 @@ public: + CPPUNIT_TEST(testKhmer); + #endif + CPPUNIT_TEST(testJapanese); ++ CPPUNIT_TEST(testChinese); + CPPUNIT_TEST_SUITE_END(); + private: + uno::Reference m_xBreak; +@@ -909,6 +910,22 @@ void TestBreakIterator::testJapanese() + } + } + ++void TestBreakIterator::testChinese() ++{ ++ lang::Locale aLocale; ++ aLocale.Language = "zh"; ++ aLocale.Country = "CN"; ++ i18n::Boundary aBounds; ++ ++ { ++ const sal_Unicode CHINESE[] = { 0x6A35, 0x6A30, 0x69FE, 0x8919, 0xD867, 0xDEDB }; ++ ++ OUString aTest(CHINESE, SAL_N_ELEMENTS(CHINESE)); ++ aBounds = m_xBreak->getWordBoundary(aTest, 4, aLocale, ++ i18n::WordType::DICTIONARY_WORD, true); ++ CPPUNIT_ASSERT(aBounds.startPos == 4 && aBounds.endPos == 6); ++ } ++} + void TestBreakIterator::setUp() + { + BootstrapFixtureBase::setUp(); +diff --git a/i18npool/source/breakiterator/xdictionary.cxx b/i18npool/source/breakiterator/xdictionary.cxx +index 72da09f..3b43fa3 100644 +--- a/i18npool/source/breakiterator/xdictionary.cxx ++++ b/i18npool/source/breakiterator/xdictionary.cxx +@@ -383,9 +383,11 @@ Boundary xdictionary::getWordBoundary(const OUString& rText, sal_Int32 anyPos, s + if (u_isWhitespace(ch)) + i--; + } ++ + boundary.endPos = boundary.startPos; +- rText.iterateCodePoints(&boundary.endPos, aCache.wordboundary[i]); +- rText.iterateCodePoints(&boundary.startPos, aCache.wordboundary[i-1]); ++ boundary.endPos += aCache.wordboundary[i]; ++ boundary.startPos += aCache.wordboundary[i-1]; ++ + } else { + boundary.startPos = anyPos; + if (anyPos < len) rText.iterateCodePoints(&anyPos, 1); +-- +1.8.4.2 + diff --git a/SOURCES/0011-resolved-fdo-67572-export-add-in-equivalents-as-inte.patch b/SOURCES/0011-resolved-fdo-67572-export-add-in-equivalents-as-inte.patch new file mode 100644 index 0000000..8400b15 --- /dev/null +++ b/SOURCES/0011-resolved-fdo-67572-export-add-in-equivalents-as-inte.patch @@ -0,0 +1,123 @@ +From 80994001d563ffd51f008eae4eb88c6eb2b7d38b Mon Sep 17 00:00:00 2001 +From: Eike Rathke +Date: Sat, 2 Nov 2013 21:03:17 +0100 +Subject: [PATCH 011/109] resolved fdo#67572 export add-in equivalents as + internal to .xlsx + +For OOXML .xlsx export the add-in functions that are equivalents of +known internal functions as those internal functions. + +(cherry picked from commit da7c6092a644dc22f90fb8eef0c4f0df06ec204a) + +Minus the DURATION change that was fixed on master (and 4.2) with +62e1a27dc757637223f5f18b1a340ba138e0cb82 + +Change-Id: Ic41f32b67902effa07c3d4db137be08dc5af7265 +Reviewed-on: https://gerrit.libreoffice.org/6530 +Reviewed-by: Markus Mohrhard +Tested-by: Markus Mohrhard +--- + sc/source/filter/inc/formulabase.hxx | 1 + + sc/source/filter/oox/formulabase.cxx | 27 ++++++++++++++++----------- + 2 files changed, 17 insertions(+), 11 deletions(-) + +diff --git a/sc/source/filter/inc/formulabase.hxx b/sc/source/filter/inc/formulabase.hxx +index cb2785e..50948f7 100644 +--- a/sc/source/filter/inc/formulabase.hxx ++++ b/sc/source/filter/inc/formulabase.hxx +@@ -499,6 +499,7 @@ struct FunctionInfo + bool mbParamPairs; /// True = optional parameters are expected to appear in pairs. + bool mbVolatile; /// True = volatile function. + bool mbExternal; /// True = external function in Calc. ++ bool mbInternal; /// True = internal function in Calc. (Both can be true!) + bool mbMacroFunc; /// True = macro sheet function or command. + bool mbVarParam; /// True = use a tFuncVar token, also if min/max are equal. + }; +diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx +index d0db2e7..c222e7e 100644 +--- a/sc/source/filter/oox/formulabase.cxx ++++ b/sc/source/filter/oox/formulabase.cxx +@@ -212,6 +212,7 @@ const sal_uInt16 FUNCFLAG_MACROCALL_NEW = FUNCFLAG_MACROCALL | FUNCFLAG_MACR + must exist. */ + const sal_uInt16 FUNCFLAG_BIFFIMPORTONLY = 0x0800; /// Only used in BIFF binary import filter. + const sal_uInt16 FUNCFLAG_BIFFEXPORTONLY = 0x1000; /// Only used in BIFF binary export filter. ++const sal_uInt16 FUNCFLAG_INTERNAL = 0x2000; /// Function is internal in Calc. + + /// Converts a function library index (value of enum FunctionLibraryType) to function flags. + #define FUNCLIB_TO_FUNCFLAGS( funclib_index ) static_cast< sal_uInt16 >( static_cast< sal_uInt8 >( funclib_index ) << 12 ) +@@ -584,8 +585,8 @@ static const FunctionData saFuncTableBiff4[] = + { "QUOTIENT", "QUOTIENT", 417, NOID, 2, 2, V, { RR }, FUNCFLAG_EXTERNAL }, + { "DELTA", "DELTA", 418, NOID, 1, 2, V, { RR }, FUNCFLAG_EXTERNAL }, + { "GESTEP", "GESTEP", 419, NOID, 1, 2, V, { RR }, FUNCFLAG_EXTERNAL }, +- { "ISEVEN", "ISEVEN", 420, NOID, 1, 1, V, { RR }, FUNCFLAG_EXTERNAL }, // Calc: builtin and add-in +- { "ISODD", "ISODD", 421, NOID, 1, 1, V, { RR }, FUNCFLAG_EXTERNAL }, // Calc: builtin and add-in ++ { "ISEVEN", "ISEVEN", 420, NOID, 1, 1, V, { RR }, FUNCFLAG_EXTERNAL | FUNCFLAG_INTERNAL }, // Calc: builtin and add-in ++ { "ISODD", "ISODD", 421, NOID, 1, 1, V, { RR }, FUNCFLAG_EXTERNAL | FUNCFLAG_INTERNAL }, // Calc: builtin and add-in + { "MROUND", "MROUND", 422, NOID, 2, 2, V, { RR }, FUNCFLAG_EXTERNAL }, + { "ERF", "ERF", 423, NOID, 1, 2, V, { RR }, FUNCFLAG_EXTERNAL }, + { "ERFC", "ERFC", 424, NOID, 1, 1, V, { RR }, FUNCFLAG_EXTERNAL }, +@@ -609,10 +610,10 @@ static const FunctionData saFuncTableBiff4[] = + { "YIELD", "YIELD", 442, NOID, 6, 7, V, { RR }, FUNCFLAG_EXTERNAL }, + { "DOLLARDE", "DOLLARDE", 443, NOID, 2, 2, V, { RR }, FUNCFLAG_EXTERNAL }, + { "DOLLARFR", "DOLLARFR", 444, NOID, 2, 2, V, { RR }, FUNCFLAG_EXTERNAL }, +- { "NOMINAL", "NOMINAL", 445, NOID, 2, 2, V, { RR }, FUNCFLAG_EXTERNAL }, // Calc: builtin and add-in +- { "EFFECT", "EFFECT", 446, NOID, 2, 2, V, { RR }, FUNCFLAG_EXTERNAL }, // Calc: builtin and add-in +- { "CUMPRINC", "CUMPRINC", 447, NOID, 6, 6, V, { RR }, FUNCFLAG_EXTERNAL }, // Calc: builtin and add-in +- { "CUMIPMT", "CUMIPMT", 448, NOID, 6, 6, V, { RR }, FUNCFLAG_EXTERNAL }, // Calc: builtin and add-in ++ { "NOMINAL", "NOMINAL", 445, NOID, 2, 2, V, { RR }, FUNCFLAG_EXTERNAL | FUNCFLAG_INTERNAL }, // Calc: builtin and add-in ++ { "EFFECT", "EFFECT", 446, NOID, 2, 2, V, { RR }, FUNCFLAG_EXTERNAL | FUNCFLAG_INTERNAL }, // Calc: builtin and add-in ++ { "CUMPRINC", "CUMPRINC", 447, NOID, 6, 6, V, { RR }, FUNCFLAG_EXTERNAL | FUNCFLAG_INTERNAL }, // Calc: builtin and add-in ++ { "CUMIPMT", "CUMIPMT", 448, NOID, 6, 6, V, { RR }, FUNCFLAG_EXTERNAL | FUNCFLAG_INTERNAL }, // Calc: builtin and add-in + { "EDATE", "EDATE", 449, NOID, 2, 2, V, { RR }, FUNCFLAG_EXTERNAL }, + { "EOMONTH", "EOMONTH", 450, NOID, 2, 2, V, { RR }, FUNCFLAG_EXTERNAL }, + { "YEARFRAC", "YEARFRAC", 451, NOID, 2, 3, V, { RR }, FUNCFLAG_EXTERNAL }, +@@ -622,7 +623,7 @@ static const FunctionData saFuncTableBiff4[] = + { "COUPNCD", "COUPNCD", 455, NOID, 3, 4, V, { RR }, FUNCFLAG_EXTERNAL }, + { "COUPNUM", "COUPNUM", 456, NOID, 3, 4, V, { RR }, FUNCFLAG_EXTERNAL }, + { "COUPPCD", "COUPPCD", 457, NOID, 3, 4, V, { RR }, FUNCFLAG_EXTERNAL }, +- { "DURATION", "DURATION", 458, NOID, 5, 6, V, { RR }, FUNCFLAG_EXTERNAL }, // Calc: builtin and add-in ++ { "DURATION", "DURATION", 458, NOID, 5, 6, V, { RR }, FUNCFLAG_EXTERNAL }, // Calc: builtin and add-in (but different!) + { "MDURATION", "MDURATION", 459, NOID, 5, 6, V, { RR }, FUNCFLAG_EXTERNAL }, + { "ODDLPRICE", "ODDLPRICE", 460, NOID, 7, 8, V, { RR }, FUNCFLAG_EXTERNAL }, + { "ODDLYIELD", "ODDLYIELD", 461, NOID, 8, 9, V, { RR }, FUNCFLAG_EXTERNAL }, +@@ -632,14 +633,14 @@ static const FunctionData saFuncTableBiff4[] = + { "WEEKNUM", "WEEKNUM", 465, NOID, 1, 2, V, { RR }, FUNCFLAG_EXTERNAL }, + { "AMORDEGRC", "AMORDEGRC", 466, NOID, 6, 7, V, { RR }, FUNCFLAG_EXTERNAL }, + { "AMORLINC", "AMORLINC", 467, NOID, 6, 7, V, { RR }, FUNCFLAG_EXTERNAL }, +- { "CONVERT", "CONVERT", 468, NOID, 3, 3, V, { RR }, FUNCFLAG_EXTERNAL }, // Calc: builtin and add-in ++ { "CONVERT", "CONVERT", 468, NOID, 3, 3, V, { RR }, FUNCFLAG_EXTERNAL }, // Calc: builtin and add-in (but different!) + { "ACCRINT", "ACCRINT", 469, NOID, 6, 7, V, { RR }, FUNCFLAG_EXTERNAL }, + { "ACCRINTM", "ACCRINTM", 470, NOID, 4, 5, V, { RR }, FUNCFLAG_EXTERNAL }, + { "WORKDAY", "WORKDAY", 471, NOID, 2, 3, V, { RR, RR, RX, C }, FUNCFLAG_EXTERNAL }, + { "NETWORKDAYS", "NETWORKDAYS", 472, NOID, 2, 3, V, { RR, RR, RX, C }, FUNCFLAG_EXTERNAL }, +- { "GCD", "GCD", 473, NOID, 1, MX, V, { RX }, FUNCFLAG_EXTERNAL }, // Calc: builtin and add-in ++ { "GCD", "GCD", 473, NOID, 1, MX, V, { RX }, FUNCFLAG_EXTERNAL | FUNCFLAG_INTERNAL }, // Calc: builtin and add-in + { "MULTINOMIAL", "MULTINOMIAL", 474, NOID, 1, MX, V, { RX }, FUNCFLAG_EXTERNAL }, +- { "LCM", "LCM", 475, NOID, 1, MX, V, { RX }, FUNCFLAG_EXTERNAL }, // Calc: builtin and add-in ++ { "LCM", "LCM", 475, NOID, 1, MX, V, { RX }, FUNCFLAG_EXTERNAL | FUNCFLAG_INTERNAL }, // Calc: builtin and add-in + { "FVSCHEDULE", "FVSCHEDULE", 476, NOID, 2, 2, V, { RR, RX }, FUNCFLAG_EXTERNAL }, + + // *** macro sheet commands *** +@@ -999,6 +1000,7 @@ void FunctionProviderImpl::initFunc( const FunctionData& rFuncData, sal_uInt8 nM + xFuncInfo->mbParamPairs = getFlag( rFuncData.mnFlags, FUNCFLAG_PARAMPAIRS ); + xFuncInfo->mbVolatile = getFlag( rFuncData.mnFlags, FUNCFLAG_VOLATILE ); + xFuncInfo->mbExternal = getFlag( rFuncData.mnFlags, FUNCFLAG_EXTERNAL ); ++ xFuncInfo->mbInternal = !xFuncInfo->mbExternal || getFlag( rFuncData.mnFlags, FUNCFLAG_INTERNAL ); + bool bMacroCmd = getFlag( rFuncData.mnFlags, FUNCFLAG_MACROCMD ); + xFuncInfo->mbMacroFunc = bMacroCmd || getFlag( rFuncData.mnFlags, FUNCFLAG_MACROFUNC ); + xFuncInfo->mbVarParam = bMacroCmd || (rFuncData.mnMinParamCount != rFuncData.mnMaxParamCount) || getFlag( rFuncData.mnFlags, FUNCFLAG_ALWAYSVAR ); +@@ -1349,7 +1351,10 @@ bool OpCodeProviderImpl::initFuncOpCodes( const ApiTokenMap& rIntFuncTokenMap, c + { + FunctionInfoRef xFuncInfo = *aIt; + // set API opcode from ODF function name +- bIsValid &= initFuncOpCode( *xFuncInfo, xFuncInfo->mbExternal ? rExtFuncTokenMap : rIntFuncTokenMap ); ++ if (xFuncInfo->mbExternal) ++ bIsValid &= initFuncOpCode( *xFuncInfo, rExtFuncTokenMap ); ++ if (xFuncInfo->mbInternal) ++ bIsValid &= initFuncOpCode( *xFuncInfo, rIntFuncTokenMap ); + // insert the function info into the maps + if( (xFuncInfo->mnApiOpCode != OPCODE_NONAME) && (xFuncInfo->mnApiOpCode != OPCODE_BAD) ) + { +-- +1.8.4.2 + diff --git a/SOURCES/0012-resolved-fdo-61946-use-correct-TabDelta-for-UpdateRe.patch b/SOURCES/0012-resolved-fdo-61946-use-correct-TabDelta-for-UpdateRe.patch new file mode 100644 index 0000000..2ba314f --- /dev/null +++ b/SOURCES/0012-resolved-fdo-61946-use-correct-TabDelta-for-UpdateRe.patch @@ -0,0 +1,39 @@ +From 1aa9bae0ffea4b37392175197f58f26001c06c66 Mon Sep 17 00:00:00 2001 +From: Eike Rathke +Date: Sat, 23 Nov 2013 12:16:51 +0100 +Subject: [PATCH 012/109] resolved fdo#61946 use correct TabDelta for + UpdateReference + +The sheet delta was reverted resulting in the references not being +updated when conditional formats were copy-pasted between sheets. Saved +to .ods then was an identical calcext:target-range-address as for the +copied source range. + +(cherry picked from commit ef8e0beba442f58abe3bc77f6f55fc6109025dd4) + +Backported. + +Change-Id: I038b58f20f71ff1393dccafa3021dac02cd69e4b +Reviewed-on: https://gerrit.libreoffice.org/6768 +Tested-by: Markus Mohrhard +Reviewed-by: Markus Mohrhard +--- + sc/source/core/data/table2.cxx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx +index 220211c..6c530d3 100644 +--- a/sc/source/core/data/table2.cxx ++++ b/sc/source/core/data/table2.cxx +@@ -712,7 +712,7 @@ void ScTable::CopyConditionalFormat( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCRO + ScConditionalFormat* pNewFormat = itr->Clone(pDocument); + + pNewFormat->AddRange(aIntersectedRange); +- pNewFormat->UpdateReference(URM_COPY, aNewRange, nDx, nDy, pTable->nTab - nTab, true); ++ pNewFormat->UpdateReference(URM_COPY, aNewRange, nDx, nDy, nTab - pTable->nTab, true); + + sal_uLong nMax = 0; + for(ScConditionalFormatList::const_iterator itrCond = mpCondFormatList->begin(); +-- +1.8.4.2 + diff --git a/SOURCES/0013-resolved-fdo-53103-actually-use-the-external-data-fi.patch b/SOURCES/0013-resolved-fdo-53103-actually-use-the-external-data-fi.patch new file mode 100644 index 0000000..8a2b912 --- /dev/null +++ b/SOURCES/0013-resolved-fdo-53103-actually-use-the-external-data-fi.patch @@ -0,0 +1,104 @@ +From ea40b8b14d830f5025a3fe2e9da9163b83a843e5 Mon Sep 17 00:00:00 2001 +From: Eike Rathke +Date: Wed, 27 Nov 2013 00:04:44 +0100 +Subject: [PATCH 013/109] resolved fdo#53103 actually use the external data + filter options + +ScDocShell::ConvertFrom() queries the filter options from the SfxItemSet +at SfxMedium, which is fine when loading the data into the table +selector first, but the final load via ScAreaLink created a bare +SfxMedium without options set. Do so. + +Additionally it may now even work that ScDocShell sets options at +SfxMedium, which the ScAreaLink code prepared for but previously the +SfxMedium did not have an SfxItemSet. + +Change-Id: I45d6a24906dc3ba41654b8c0951dd84939d8af5e +(cherry picked from commit 513eadd422ff6a41cfe9a16f82cf32872d729652) +Reviewed-on: https://gerrit.libreoffice.org/6823 +Reviewed-by: Markus Mohrhard +Tested-by: Markus Mohrhard +--- + sc/inc/tablink.hxx | 8 +++++++- + sc/source/ui/docshell/arealink.cxx | 2 +- + sc/source/ui/docshell/tablink.cxx | 18 ++++++++++++------ + 3 files changed, 20 insertions(+), 8 deletions(-) + +diff --git a/sc/inc/tablink.hxx b/sc/inc/tablink.hxx +index 068d87f..49833af 100644 +--- a/sc/inc/tablink.hxx ++++ b/sc/inc/tablink.hxx +@@ -72,6 +72,7 @@ public: + + class ScDocument; + class SfxMedium; ++class SfxFilter; + + class SC_DLLPUBLIC ScDocumentLoader + { +@@ -96,7 +97,12 @@ public: + + void ReleaseDocRef(); // without calling DoClose + +- static OUString GetOptions( SfxMedium& rMedium ); ++ /** Create SfxMedium for stream read with SfxFilter and filter options set ++ at the medium's SfxItemSet. ++ */ ++ static SfxMedium* CreateMedium( const OUString& rFileName, const SfxFilter* pFilter, const OUString& rOptions ); ++ ++ static OUString GetOptions( SfxMedium& rMedium ); + + /** Returns the filter name and options from a file name. + @param bWithContent +diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx +index 6409fbd..f80c80a 100644 +--- a/sc/source/ui/docshell/arealink.cxx ++++ b/sc/source/ui/docshell/arealink.cxx +@@ -253,7 +253,7 @@ sal_Bool ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter, + if ( rNewFilter != aFilterName ) + aOptions.Erase(); + +- SfxMedium* pMed = new SfxMedium(aNewUrl, STREAM_STD_READ, pFilter); ++ SfxMedium* pMed = ScDocumentLoader::CreateMedium( aNewUrl, pFilter, aOptions); + + // aRef->DoClose() will be closed explicitly, but it is still more safe to use SfxObjectShellLock here + ScDocShell* pSrcShell = new ScDocShell(SFX_CREATE_MODE_INTERNAL); +diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx +index ba1ed72..0164e27 100644 +--- a/sc/source/ui/docshell/tablink.cxx ++++ b/sc/source/ui/docshell/tablink.cxx +@@ -519,6 +519,17 @@ void ScDocumentLoader::RemoveAppPrefix( OUString& rFilterName ) + rFilterName = rFilterName.copy( aAppPrefix.getLength()); + } + ++SfxMedium* ScDocumentLoader::CreateMedium( const OUString& rFileName, const SfxFilter* pFilter, ++ const OUString& rOptions ) ++{ ++ // Always create SfxItemSet so ScDocShell can set options. ++ SfxItemSet* pSet = new SfxAllItemSet( SFX_APP()->GetPool() ); ++ if ( !rOptions.isEmpty() ) ++ pSet->Put( SfxStringItem( SID_FILE_FILTEROPTIONS, rOptions ) ); ++ ++ return new SfxMedium( rFileName, STREAM_STD_READ, pFilter, pSet ); ++} ++ + ScDocumentLoader::ScDocumentLoader( const OUString& rFileName, + OUString& rFilterName, OUString& rOptions, + sal_uInt32 nRekCnt, bool bWithInteraction ) : +@@ -530,12 +541,7 @@ ScDocumentLoader::ScDocumentLoader( const OUString& rFileName, + + const SfxFilter* pFilter = ScDocShell::Factory().GetFilterContainer()->GetFilter4FilterName( rFilterName ); + +- // ItemSet immer anlegen, damit die DocShell die Optionen setzen kann +- SfxItemSet* pSet = new SfxAllItemSet( SFX_APP()->GetPool() ); +- if ( !rOptions.isEmpty() ) +- pSet->Put( SfxStringItem( SID_FILE_FILTEROPTIONS, rOptions ) ); +- +- pMedium = new SfxMedium( rFileName, STREAM_STD_READ, pFilter, pSet ); ++ pMedium = CreateMedium( rFileName, pFilter, rOptions); + if ( pMedium->GetError() != ERRCODE_NONE ) + return ; + +-- +1.8.4.2 + diff --git a/SOURCES/0014-resolved-fdo-67536-export-internal-equivalents-as-ad.patch b/SOURCES/0014-resolved-fdo-67536-export-internal-equivalents-as-ad.patch new file mode 100644 index 0000000..066b5a0 --- /dev/null +++ b/SOURCES/0014-resolved-fdo-67536-export-internal-equivalents-as-ad.patch @@ -0,0 +1,166 @@ +From db0d51e647e01d852ef95e46e12f1dba2d09be2b Mon Sep 17 00:00:00 2001 +From: Eike Rathke +Date: Sat, 2 Nov 2013 16:25:42 +0100 +Subject: [PATCH 014/109] resolved fdo#67536 export internal equivalents as + add-in to .xls + +For BIFF .xls export the internal functions that are equivalents of +known add-in functions as those add-in functions. + +(cherry picked from commit 06a5b1ecc39bb50dadc0bcb7378455500943ece3) + +Conflicts: + sc/source/filter/inc/xlformula.hxx + +Change-Id: If37f616a34fdabb3fa971fddad01da3dc1f28ee9 +Reviewed-on: https://gerrit.libreoffice.org/6525 +Reviewed-by: Markus Mohrhard +Tested-by: Markus Mohrhard +--- + sc/source/filter/excel/xeformula.cxx | 16 +++++++++++++--- + sc/source/filter/excel/xlformula.cxx | 24 +++++++++++++++++++++++- + sc/source/filter/inc/xlformula.hxx | 13 +++++++++++-- + 3 files changed, 47 insertions(+), 6 deletions(-) + +diff --git a/sc/source/filter/excel/xeformula.cxx b/sc/source/filter/excel/xeformula.cxx +index 5265bd1..d58e0ba 100644 +--- a/sc/source/filter/excel/xeformula.cxx ++++ b/sc/source/filter/excel/xeformula.cxx +@@ -139,6 +139,7 @@ public: + inline sal_uInt16 GetXclFuncIdx() const { return mrFuncInfo.mnXclFunc; } + inline bool IsVolatile() const { return mrFuncInfo.IsVolatile(); } + inline bool IsFixedParamCount() const { return mrFuncInfo.IsFixedParamCount(); } ++ inline bool IsAddInEquivalent() const { return mrFuncInfo.IsAddInEquivalent(); } + inline bool IsMacroFunc() const { return mrFuncInfo.IsMacroFunc(); } + inline sal_uInt8 GetSpaces() const { return mrTokData.mnSpaces; } + inline const XclExpExtFuncData& GetExtFuncData() const { return maExtFuncData; } +@@ -1360,8 +1361,11 @@ void XclExpFmlaCompImpl::ProcessFunction( const XclExpScToken& rTokData ) + mxData->mbOk = pFuncInfo != 0; + if( !mxData->mbOk ) return; + ++ // internal functions equivalent to an existing add-in ++ if( pFuncInfo->IsAddInEquivalent() ) ++ aExtFuncData.Set( pFuncInfo->GetAddInEquivalentFuncName(), true, false ); + // functions simulated by a macro call in file format +- if( pFuncInfo->IsMacroFunc() ) ++ else if( pFuncInfo->IsMacroFunc() ) + aExtFuncData.Set( pFuncInfo->GetMacroFuncName(), false, true ); + + XclExpFuncData aFuncData( rTokData, *pFuncInfo, aExtFuncData ); +@@ -1643,8 +1647,11 @@ void XclExpFmlaCompImpl::AppendDefaultParam( XclExpFuncData& rFuncData ) + break; + default: + { +- OSL_ENSURE( rFuncData.IsMacroFunc(), "XclExpFmlaCompImpl::AppendDefaultParam - unknown opcode" ); +- if( rFuncData.IsMacroFunc() ) ++ if( rFuncData.IsAddInEquivalent() ) ++ { ++ AppendAddInCallToken( rFuncData.GetExtFuncData() ); ++ } ++ else if( rFuncData.IsMacroFunc() ) + { + // Do not write the OOXML element for new _xlfn. + // prefixed functions. +@@ -1654,7 +1661,10 @@ void XclExpFmlaCompImpl::AppendDefaultParam( XclExpFuncData& rFuncData ) + AppendMacroCallToken( rFuncData.GetExtFuncData() ); + } + else ++ { ++ SAL_WARN( "sc.filter", "XclExpFmlaCompImpl::AppendDefaultParam - unknown opcode" ); + AppendMissingToken(); // to keep parameter count valid ++ } + } + } + +diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx +index d4bdc86..a04a101 100644 +--- a/sc/source/filter/excel/xlformula.cxx ++++ b/sc/source/filter/excel/xlformula.cxx +@@ -40,6 +40,13 @@ String XclFunctionInfo::GetMacroFuncName() const + return EMPTY_STRING; + } + ++String XclFunctionInfo::GetAddInEquivalentFuncName() const ++{ ++ if( IsAddInEquivalent() ) ++ return String( mpcMacroName, strlen(mpcMacroName), RTL_TEXTENCODING_UTF8 ); ++ return EMPTY_STRING; ++} ++ + // abbreviations for function return token class + const sal_uInt8 R = EXC_TOKCLASS_REF; + const sal_uInt8 V = EXC_TOKCLASS_VAL; +@@ -64,6 +71,7 @@ const sal_uInt8 MX = 30; /// Maximum parameter count. + + #define EXC_FUNCNAME( ascii ) "_xlfn." ascii + #define EXC_FUNCNAME_ODF( ascii ) "_xlfnodf." ascii ++#define EXC_FUNCNAME_ADDIN( ascii ) "com.sun.star.sheet.addin." ascii + + /** Functions new in BIFF2. */ + static const XclFunctionInfo saFuncTable_2[] = +@@ -309,7 +317,21 @@ static const XclFunctionInfo saFuncTable_4[] = + { ocPercentrank, 329, 2, 3, V, { RX, VR, VR_E }, 0, 0 }, + { ocModalValue, 330, 1, MX, V, { VA }, 0, 0 }, + { ocTrimMean, 331, 2, 2, V, { RX, VR }, 0, 0 }, +- { ocTInv, 332, 2, 2, V, { VR }, 0, 0 } ++ { ocTInv, 332, 2, 2, V, { VR }, 0, 0 }, ++ // Functions equivalent to add-in functions, use same parameters as ++ // ocExternal but add programmatical function name (here without ++ // "com.sun.star.sheet.addin.") so it can be looked up and stored as ++ // add-in, as older Excel versions only know them as add-in. ++ // These are the functions flagged as AddInMap::bMapDupToInternal=true in ++ // sc/source/core/tool/odffmap.cxx ++ { ocIsEven, 255, 1, MX, R, { RO_E, RO }, EXC_FUNCFLAG_EXPORTONLY | EXC_FUNCFLAG_ADDINEQUIV, EXC_FUNCNAME_ADDIN( "Analysis.getIseven" ) }, ++ { ocIsOdd, 255, 1, MX, R, { RO_E, RO }, EXC_FUNCFLAG_EXPORTONLY | EXC_FUNCFLAG_ADDINEQUIV, EXC_FUNCNAME_ADDIN( "Analysis.getIsodd" ) }, ++ { ocGCD, 255, 1, MX, R, { RO_E, RO }, EXC_FUNCFLAG_EXPORTONLY | EXC_FUNCFLAG_ADDINEQUIV, EXC_FUNCNAME_ADDIN( "Analysis.getGcd" ) }, ++ { ocLCM, 255, 1, MX, R, { RO_E, RO }, EXC_FUNCFLAG_EXPORTONLY | EXC_FUNCFLAG_ADDINEQUIV, EXC_FUNCNAME_ADDIN( "Analysis.getLcm" ) }, ++ { ocEffektiv, 255, 1, MX, R, { RO_E, RO }, EXC_FUNCFLAG_EXPORTONLY | EXC_FUNCFLAG_ADDINEQUIV, EXC_FUNCNAME_ADDIN( "Analysis.getEffect" ) }, ++ { ocKumKapZ, 255, 1, MX, R, { RO_E, RO }, EXC_FUNCFLAG_EXPORTONLY | EXC_FUNCFLAG_ADDINEQUIV, EXC_FUNCNAME_ADDIN( "Analysis.getCumprinc" ) }, ++ { ocKumZinsZ, 255, 1, MX, R, { RO_E, RO }, EXC_FUNCFLAG_EXPORTONLY | EXC_FUNCFLAG_ADDINEQUIV, EXC_FUNCNAME_ADDIN( "Analysis.getCumipmt" ) }, ++ { ocNominal, 255, 1, MX, R, { RO_E, RO }, EXC_FUNCFLAG_EXPORTONLY | EXC_FUNCFLAG_ADDINEQUIV, EXC_FUNCNAME_ADDIN( "Analysis.getNominal" ) } + }; + + /** Functions new in BIFF5/BIFF7. Unsupported functions: DATESTRING, NUMBERSTRING. */ +diff --git a/sc/source/filter/inc/xlformula.hxx b/sc/source/filter/inc/xlformula.hxx +index 7768769..78b5405 100644 +--- a/sc/source/filter/inc/xlformula.hxx ++++ b/sc/source/filter/inc/xlformula.hxx +@@ -285,6 +285,7 @@ const sal_uInt8 EXC_FUNCFLAG_VOLATILE = 0x01; /// Result is volatile ( + const sal_uInt8 EXC_FUNCFLAG_IMPORTONLY = 0x02; /// Only used in import filter. + const sal_uInt8 EXC_FUNCFLAG_EXPORTONLY = 0x04; /// Only used in export filter. + const sal_uInt8 EXC_FUNCFLAG_PARAMPAIRS = 0x08; /// Optional parameters are expected to appear in pairs. ++const sal_uInt8 EXC_FUNCFLAG_ADDINEQUIV = 0x10; /// Function is an add-in equivalent + + // selected function IDs + const sal_uInt16 EXC_FUNCID_IF = 1; +@@ -311,7 +312,11 @@ struct XclFunctionInfo + sal_uInt8 mnRetClass; /// Token class of the return value. + XclFuncParamInfo mpParamInfos[ EXC_FUNCINFO_PARAMINFO_COUNT ]; /// Information for all parameters. + sal_uInt8 mnFlags; /// Additional flags (EXC_FUNCFLAG_* constants). +- const sal_Char* mpcMacroName; /// Function name, if simulated by a macro call (UTF-8). ++ const sal_Char* mpcMacroName; /** Function name, if simulated by ++ a macro call (UTF-8) EXC_FUNCFLAG_ADDINEQUIV is 0; ++ or programmatical add-in name ++ if stored as such and ++ EXC_FUNCFLAG_ADDINEQUIV is set. */ + + /** Returns true, if the function is volatile. */ + inline bool IsVolatile() const { return ::get_flag( mnFlags, EXC_FUNCFLAG_VOLATILE ); } +@@ -320,9 +325,13 @@ struct XclFunctionInfo + /** Returns true, if the function parameter count is fixed. */ + inline bool IsFixedParamCount() const { return (mnXclFunc != EXC_FUNCID_EXTERNCALL) && (mnMinParamCount == mnMaxParamCount); } + /** Returns true, if the function is simulated by a macro call. */ +- inline bool IsMacroFunc() const { return mpcMacroName != 0; } ++ inline bool IsMacroFunc() const { return mpcMacroName != 0 && !(mnFlags & EXC_FUNCFLAG_ADDINEQUIV); } ++ /** Returns true, if the function is stored as an add-in call. */ ++ inline bool IsAddInEquivalent() const { return mpcMacroName != 0 && (mnFlags & EXC_FUNCFLAG_ADDINEQUIV); } + /** Returns the name of the external function as string. */ + String GetMacroFuncName() const; ++ /** Returns the programmatical name of the Add-In function as string. */ ++ String GetAddInEquivalentFuncName() const; + }; + + // ---------------------------------------------------------------------------- +-- +1.8.4.2 + diff --git a/SOURCES/0016-fix-2D-vs-3D-coordinatesystem-regression-fdo-67300.patch b/SOURCES/0016-fix-2D-vs-3D-coordinatesystem-regression-fdo-67300.patch new file mode 100644 index 0000000..2a336d3 --- /dev/null +++ b/SOURCES/0016-fix-2D-vs-3D-coordinatesystem-regression-fdo-67300.patch @@ -0,0 +1,51 @@ +From 578ff4dfd6f0d63670dfb21425b6b81fdc87d852 Mon Sep 17 00:00:00 2001 +From: Markus Mohrhard +Date: Sun, 1 Dec 2013 04:45:36 +0100 +Subject: [PATCH 016/109] fix 2D vs 3D coordinatesystem regression, fdo#67300 + +regression from 088e86b865062dd4cc5ba0c85c6068dea62238db + +Change-Id: Ifc8d5a1da328278175bbc97b4f2aad8e6d200751 +Reviewed-on: https://gerrit.libreoffice.org/6880 +Reviewed-by: Andras Timar +Tested-by: Andras Timar +--- + oox/source/drawingml/chart/typegroupconverter.cxx | 4 ++-- + sc/source/filter/excel/xichart.cxx | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx b/oox/source/drawingml/chart/typegroupconverter.cxx +index 12d086d..589fb62 100644 +--- a/oox/source/drawingml/chart/typegroupconverter.cxx ++++ b/oox/source/drawingml/chart/typegroupconverter.cxx +@@ -248,9 +248,9 @@ Reference< XCoordinateSystem > TypeGroupConverter::createCoordinateSystem() + if( maTypeInfo.mbPolarCoordSystem ) + { + if( mb3dChart ) +- xCoordSystem = css::chart2::PolarCoordinateSystem2d::create(xContext); +- else + xCoordSystem = css::chart2::PolarCoordinateSystem3d::create(xContext); ++ else ++ xCoordSystem = css::chart2::PolarCoordinateSystem2d::create(xContext); + } + else + { +diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx +index e07d1d4..10d858a 100644 +--- a/sc/source/filter/excel/xichart.cxx ++++ b/sc/source/filter/excel/xichart.cxx +@@ -2328,9 +2328,9 @@ Reference< XCoordinateSystem > XclImpChType::CreateCoordSystem( bool b3dChart ) + if( maTypeInfo.mbPolarCoordSystem ) + { + if( b3dChart ) +- xCoordSystem = css::chart2::PolarCoordinateSystem2d::create(xContext); +- else + xCoordSystem = css::chart2::PolarCoordinateSystem3d::create(xContext); ++ else ++ xCoordSystem = css::chart2::PolarCoordinateSystem2d::create(xContext); + } + else + { +-- +1.8.4.2 + diff --git a/SOURCES/0017-fix-validation-error-for-OOXML-chart-export-related-.patch b/SOURCES/0017-fix-validation-error-for-OOXML-chart-export-related-.patch new file mode 100644 index 0000000..87dd819 --- /dev/null +++ b/SOURCES/0017-fix-validation-error-for-OOXML-chart-export-related-.patch @@ -0,0 +1,35 @@ +From 90674ac8a975b16389d9b32016f3ef605a702079 Mon Sep 17 00:00:00 2001 +From: Markus Mohrhard +Date: Sun, 1 Dec 2013 04:19:09 +0100 +Subject: [PATCH 017/109] fix validation error for OOXML chart export, related + fdo#67300 + +Change-Id: I7d74439bba3b912fe9b81ebeca865298bc32d71e +Reviewed-on: https://gerrit.libreoffice.org/6879 +Reviewed-by: Andras Timar +Tested-by: Andras Timar +--- + oox/source/export/chartexport.cxx | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx +index b654001..e6da04b 100644 +--- a/oox/source/export/chartexport.cxx ++++ b/oox/source/export/chartexport.cxx +@@ -1277,8 +1277,11 @@ void ChartExport::exportPieChart( Reference< chart2::XChartType > xChartType ) + sal_Int32 nAttachedAxis = AXIS_PRIMARY_Y; + exportSeries( xChartType, nAttachedAxis ); + +- // firstSliceAng +- exportFirstSliceAng( ); ++ if( !mbIs3DChart ) ++ { ++ // firstSliceAng ++ exportFirstSliceAng( ); ++ } + + pFS->endElement( FSNS( XML_c, nTypeId ) ); + } +-- +1.8.4.2 + diff --git a/SOURCES/0020-fdo-72078-make-status-bar-text-localizable.patch b/SOURCES/0020-fdo-72078-make-status-bar-text-localizable.patch new file mode 100644 index 0000000..35418df --- /dev/null +++ b/SOURCES/0020-fdo-72078-make-status-bar-text-localizable.patch @@ -0,0 +1,53 @@ +From 3b6ac4f3416b2542208745033aaecb3c7a520656 Mon Sep 17 00:00:00 2001 +From: Andras Timar +Date: Mon, 2 Dec 2013 12:11:10 +0100 +Subject: [PATCH 020/109] fdo#72078 make status bar text localizable +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +2nd try to get it right on libreoffice-4-1 + +Change-Id: I66ebc292231069cca708eb56ad876f56829e78f5 +Reviewed-on: https://gerrit.libreoffice.org/6894 +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +--- + sc/source/filter/oox/workbookhelper.cxx | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx +index 09c6947..691887a 100644 +--- a/sc/source/filter/oox/workbookhelper.cxx ++++ b/sc/source/filter/oox/workbookhelper.cxx +@@ -71,6 +71,7 @@ + #include "dbdata.hxx" + #include "datauno.hxx" + #include "globalnames.hxx" ++#include "globstr.hrc" + + #include "formulabuffer.hxx" + #include "vcl/mapmod.hxx" +@@ -572,8 +573,7 @@ void WorkbookGlobals::initialize( bool bWorkbookFile ) + if( xLockable.is() ) + xLockable->addActionLock(); + +- //! TODO: localize progress bar text +- mxProgressBar.reset( new SegmentProgressBar( mrBaseFilter.getStatusIndicator(), "Loading..." ) ); ++ mxProgressBar.reset( new SegmentProgressBar( mrBaseFilter.getStatusIndicator(), ScGlobal::GetRscString(STR_LOAD_DOC) ) ); + mxFmlaParser.reset( new FormulaParser( *this ) ); + + //prevent unnecessary broadcasts and "half way listeners" as +@@ -582,8 +582,7 @@ void WorkbookGlobals::initialize( bool bWorkbookFile ) + } + else if( mrBaseFilter.isExportFilter() ) + { +- //! TODO: localize progress bar text +- mxProgressBar.reset( new SegmentProgressBar( mrBaseFilter.getStatusIndicator(), "Saving..." ) ); ++ mxProgressBar.reset( new SegmentProgressBar( mrBaseFilter.getStatusIndicator(), ScGlobal::GetRscString(STR_SAVE_DOC) ) ); + } + // filter specific + switch( getFilterType() ) +-- +1.8.4.2 + diff --git a/SOURCES/0021-don-t-use-fixed-size-icon-sets-fdo-62652.patch b/SOURCES/0021-don-t-use-fixed-size-icon-sets-fdo-62652.patch new file mode 100644 index 0000000..4f9fbf4 --- /dev/null +++ b/SOURCES/0021-don-t-use-fixed-size-icon-sets-fdo-62652.patch @@ -0,0 +1,40 @@ +From a9d6a9c78cccaa5068a21b9b0e526ab60bbcfabf Mon Sep 17 00:00:00 2001 +From: Markus Mohrhard +Date: Mon, 2 Dec 2013 08:06:44 +0100 +Subject: [PATCH 021/109] don't use fixed size icon sets, fdo#62652 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +actually we should switch to svg as soon as it becomes possible + +Change-Id: Ifbbe5befab94441f04fadb90b779e0bc8c15eda4 +Reviewed-on: https://gerrit.libreoffice.org/6890 +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +--- + sc/source/ui/view/output.cxx | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx +index 5826efd..9bbfee8 100644 +--- a/sc/source/ui/view/output.cxx ++++ b/sc/source/ui/view/output.cxx +@@ -882,11 +882,12 @@ BitmapEx& getIcon( ScIconSetType eType, sal_Int32 nIndex ) + + void drawIconSets( const ScIconSetInfo* pOldIconSetInfo, OutputDevice* pDev, const Rectangle& rRect ) + { +- long nSize = 16; ++ //long nSize = 16; + ScIconSetType eType = pOldIconSetInfo->eIconSetType; + sal_Int32 nIndex = pOldIconSetInfo->nIconIndex; + BitmapEx& rIcon = getIcon( eType, nIndex ); +- pDev->DrawBitmapEx( Point( rRect.Left() +2, rRect.Top() + 2 ), Size( nSize, nSize ), rIcon ); ++ long aOrigSize = std::max(0,std::min(rRect.GetSize().getWidth() - 4, rRect.GetSize().getHeight() -4)); ++ pDev->DrawBitmapEx( Point( rRect.Left() +2, rRect.Top() + 2 ), Size(aOrigSize, aOrigSize), rIcon ); + } + + void drawCells(const Color* pColor, const SvxBrushItem* pBackground, const Color*& pOldColor, const SvxBrushItem*& pOldBackground, +-- +1.8.4.2 + diff --git a/SOURCES/0025-fdo-71056-add-sup-to-list-of-inline-help-XML-tags.patch b/SOURCES/0025-fdo-71056-add-sup-to-list-of-inline-help-XML-tags.patch new file mode 100644 index 0000000..17743fc --- /dev/null +++ b/SOURCES/0025-fdo-71056-add-sup-to-list-of-inline-help-XML-tags.patch @@ -0,0 +1,40 @@ +From 2c0d52812310b1ee07cf5c9e6932c3a02fde0862 Mon Sep 17 00:00:00 2001 +From: Andras Timar +Date: Mon, 2 Dec 2013 13:03:59 +0100 +Subject: [PATCH 025/109] fdo#71056 add to list of inline help XML tags +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Conflicts: + l10ntools/source/xmlparse.cxx + +Change-Id: If0937bd571658e0f76a51e44dd3fa008f701f02e +Reviewed-on: https://gerrit.libreoffice.org/6895 +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +--- + l10ntools/source/xmlparse.cxx | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/l10ntools/source/xmlparse.cxx b/l10ntools/source/xmlparse.cxx +index 55bf4bc..2959bba 100644 +--- a/l10ntools/source/xmlparse.cxx ++++ b/l10ntools/source/xmlparse.cxx +@@ -1215,11 +1215,11 @@ static icu::UnicodeString lcl_QuotRange( + + static bool lcl_isTag( const icu::UnicodeString& rString ) + { +- const int nSize = 12; ++ static const int nSize = 13; + static const icu::UnicodeString vTags[nSize] = { + "ahelp", "link", "item", "emph", "defaultinline", + "switchinline", "caseinline", "variable", +- "bookmark_value", "image", "embedvar", "alt" }; ++ "bookmark_value", "image", "embedvar", "alt", "sup" }; + + for( int nIndex = 0; nIndex < nSize; ++nIndex ) + { +-- +1.8.4.2 + diff --git a/SOURCES/0029-fdo-71434-don-t-show-master-text-if-PlaceHolder-type.patch b/SOURCES/0029-fdo-71434-don-t-show-master-text-if-PlaceHolder-type.patch new file mode 100644 index 0000000..2fe0d3f --- /dev/null +++ b/SOURCES/0029-fdo-71434-don-t-show-master-text-if-PlaceHolder-type.patch @@ -0,0 +1,58 @@ +From 0f4a452be3342d0206d6724faf170fa2786a7777 Mon Sep 17 00:00:00 2001 +From: Korrawit Pruegsanusak +Date: Tue, 26 Nov 2013 22:31:51 +0700 +Subject: [PATCH 029/109] fdo#71434: don't show master text if PlaceHolder + types defined + +I've added all of valid PlaceHolder types from +http://www.schemacentral.com/sc/ooxml/t-p_ST_PlaceholderType.html + +(cherry picked from commit bb1213a740b3b3b2b1967639939dd7a72c6d4237) + +Change-Id: I038fe43ff83699f92ff5eb9945bce12540058478 +Reviewed-on: https://gerrit.libreoffice.org/6821 +Reviewed-by: Muthu Subramanian K +Tested-by: Muthu Subramanian K +Reviewed-by: Thorsten Behrens +Tested-by: Thorsten Behrens +--- + oox/source/ppt/pptgraphicshapecontext.cxx | 23 ++++++++++++++++++++--- + 1 file changed, 20 insertions(+), 3 deletions(-) + +diff --git a/oox/source/ppt/pptgraphicshapecontext.cxx b/oox/source/ppt/pptgraphicshapecontext.cxx +index e21b9a1..fec7785 100644 +--- a/oox/source/ppt/pptgraphicshapecontext.cxx ++++ b/oox/source/ppt/pptgraphicshapecontext.cxx +@@ -149,9 +149,26 @@ Reference< XFastContextHandler > PPTGraphicShapeContext::createFastChildContext( + if ( pPlaceholder.get() ) + { + bool bUseText = true; +- // TODO: Check if pPlaceholder->getSubType is none (i.e. none explicitly specified) +- if( pPlaceholder->getSubType() == XML_obj ) +- bUseText = false; ++ switch( pPlaceholder->getSubType() ) ++ { ++ case XML_title : ++ case XML_body : ++ case XML_ctrTitle : ++ case XML_subTitle : ++ case XML_dt : ++ case XML_sldNum : ++ case XML_ftr : ++ case XML_hdr : ++ case XML_obj : ++ case XML_chart : ++ case XML_tbl : ++ case XML_clipArt : ++ case XML_dgm : ++ case XML_media : ++ case XML_sldImg : ++ case XML_pic : ++ bUseText = false; ++ } + mpShapePtr->applyShapeReference( *pPlaceholder.get(), bUseText ); + PPTShape* pPPTShape = dynamic_cast< PPTShape* >( pPlaceholder.get() ); + if ( pPPTShape ) +-- +1.8.4.2 + diff --git a/SOURCES/0032-write-valid-dxf-record-related-fdo-71971.patch b/SOURCES/0032-write-valid-dxf-record-related-fdo-71971.patch new file mode 100644 index 0000000..054c7f2 --- /dev/null +++ b/SOURCES/0032-write-valid-dxf-record-related-fdo-71971.patch @@ -0,0 +1,46 @@ +From 99643319b62c3673b57f31d61a4619625747a444 Mon Sep 17 00:00:00 2001 +From: Markus Mohrhard +Date: Sat, 30 Nov 2013 06:50:50 +0100 +Subject: [PATCH 032/109] write valid dxf record, related fdo#71971 + +Change-Id: I99f4dfca78cc0fd5d9b947000a99f8414c2a899b +(cherry picked from commit 7415fc31f5cdf7ff3f78dd304b9576b931a82aeb) +Reviewed-on: https://gerrit.libreoffice.org/6878 +Reviewed-by: Eike Rathke +Tested-by: Eike Rathke +--- + sc/source/filter/excel/xestyle.cxx | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx +index 3186cda..486481a 100644 +--- a/sc/source/filter/excel/xestyle.cxx ++++ b/sc/source/filter/excel/xestyle.cxx +@@ -3021,18 +3021,18 @@ void XclExpDxf::SaveXml( XclExpXmlStream& rStrm ) + sax_fastparser::FSHelperPtr& rStyleSheet = rStrm.GetCurrentStream(); + rStyleSheet->startElement( XML_dxf, FSEND ); + +- if (mpAlign) +- mpAlign->SaveXml(rStrm); +- if (mpBorder) +- mpBorder->SaveXml(rStrm); + if (mpFont) + mpFont->SaveXml(rStrm); + if (mpNumberFmt) + mpNumberFmt->SaveXml(rStrm); +- if (mpProt) +- mpProt->SaveXml(rStrm); + if (mpColor) + mpColor->SaveXml(rStrm); ++ if (mpAlign) ++ mpAlign->SaveXml(rStrm); ++ if (mpBorder) ++ mpBorder->SaveXml(rStrm); ++ if (mpProt) ++ mpProt->SaveXml(rStrm); + rStyleSheet->endElement( XML_dxf ); + } + +-- +1.8.4.2 + diff --git a/SOURCES/0036-EMF-Do-not-ignore-source-rectangle-of-the-image-to-b.patch b/SOURCES/0036-EMF-Do-not-ignore-source-rectangle-of-the-image-to-b.patch new file mode 100644 index 0000000..bf7f7a3 --- /dev/null +++ b/SOURCES/0036-EMF-Do-not-ignore-source-rectangle-of-the-image-to-b.patch @@ -0,0 +1,40 @@ +From 6bd555fd034582352dca98266f600340ade1895e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Mat=C3=BA=C5=A1=20Kukan?= +Date: Wed, 4 Dec 2013 16:57:34 +0100 +Subject: [PATCH 036/109] EMF+: Do not ignore source rectangle of the image to + be rendered. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Change-Id: I4f861c7653c89d8f1ca73696e885f33f7bfc3b06 +Reviewed-on: https://gerrit.libreoffice.org/6932 +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +--- + cppcanvas/source/mtfrenderer/emfplus.cxx | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx +index bf9720b..2387934 100644 +--- a/cppcanvas/source/mtfrenderer/emfplus.cxx ++++ b/cppcanvas/source/mtfrenderer/emfplus.cxx +@@ -1862,6 +1862,7 @@ namespace cppcanvas + sal_Int32 aCount; + + ReadRectangle (rMF, sx, sy, sw, sh); ++ Rectangle aSource(Point(sx, sy), Size(sw, sh)); + + SAL_INFO("cppcanvas.emf", "EMF+ " << (type == EmfPlusRecordTypeDrawImagePoints ? "DrawImagePoints" : "DrawImage") << " source rectangle: " << sx << "," << sy << " " << sw << "x" << sh); + +@@ -1902,6 +1903,7 @@ namespace cppcanvas + + if (bValid) { + BitmapEx aBmp( image.graphic.GetBitmapEx () ); ++ aBmp.Crop( aSource ); + + Size aSize( aBmp.GetSizePixel() ); + SAL_INFO("cppcanvas.emf", "EMF+ bitmap size: " << aSize.Width() << "x" << aSize.Height()); +-- +1.8.4.2 + diff --git a/SOURCES/0038-EMF-force-canvas-if-EMF-comments-are-used.patch b/SOURCES/0038-EMF-force-canvas-if-EMF-comments-are-used.patch new file mode 100644 index 0000000..8d92365 --- /dev/null +++ b/SOURCES/0038-EMF-force-canvas-if-EMF-comments-are-used.patch @@ -0,0 +1,41 @@ +From 2f641a7d37fd7fb80286be5a37778c41ac834d93 Mon Sep 17 00:00:00 2001 +From: "Andrzej J.R. Hunt" +Date: Thu, 5 Dec 2013 11:36:53 +0000 +Subject: [PATCH 038/109] EMF+: force canvas if EMF+ comments are used. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Without this the drawinglayer renderer is used, whereas +only the canvas renderer supports EMF+. + +Change-Id: Id8a10e400e08c1913e7d6864a51f7b73fc9be437 +(cherry picked from commit be7d87bea2611eb316b9b379aebc031179d4f794) +Reviewed-on: https://gerrit.libreoffice.org/6940 +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +--- + vcl/source/gdi/gdimtf.cxx | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx +index f5666a6..1240500 100644 +--- a/vcl/source/gdi/gdimtf.cxx ++++ b/vcl/source/gdi/gdimtf.cxx +@@ -2765,6 +2765,13 @@ SvStream& operator>>( SvStream& rIStm, GDIMetaFile& rGDIMetaFile ) + { + pAction = MetaAction::ReadMetaAction( rIStm, &aReadData ); + ++ if (pAction->GetType() == META_COMMENT_ACTION) ++ { ++ MetaCommentAction* pCommentAct = static_cast(pAction); ++ if ( pCommentAct->GetComment() == "EMF_PLUS" ) ++ rGDIMetaFile.UseCanvas( sal_True ); ++ } ++ + if( pAction ) + rGDIMetaFile.AddAction( pAction ); + } +-- +1.8.4.2 + diff --git a/SOURCES/0039-Relater-rhbz-903281-NULL-follow-frames-on-drag-drop.patch b/SOURCES/0039-Relater-rhbz-903281-NULL-follow-frames-on-drag-drop.patch new file mode 100644 index 0000000..99789be --- /dev/null +++ b/SOURCES/0039-Relater-rhbz-903281-NULL-follow-frames-on-drag-drop.patch @@ -0,0 +1,44 @@ +From 1405c123157406e601adbea2c5f13e62c70f0ede Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Wed, 4 Dec 2013 13:10:16 +0000 +Subject: [PATCH 039/109] Relater: rhbz#903281 NULL follow frames on drag/drop + +Change-Id: I50319fb218518edd23ff8c859c355265595050d6 +(cherry picked from commit f141505929c95c97ae4765d7c7221f07e41ef8e7) +Reviewed-on: https://gerrit.libreoffice.org/6926 +Reviewed-by: Eike Rathke +Tested-by: Eike Rathke +--- + sw/source/core/access/accmap.cxx | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx +index 5435961..5b81a26 100644 +--- a/sw/source/core/access/accmap.cxx ++++ b/sw/source/core/access/accmap.cxx +@@ -747,12 +747,18 @@ static bool AreInSameTable( const uno::Reference< XAccessible >& rAcc, + if( pAccImpl->GetFrm()->IsCellFrm() ) + { + const SwTabFrm *pTabFrm1 = pAccImpl->GetFrm()->FindTabFrm(); +- while( pTabFrm1->GetFollow() ) +- pTabFrm1 = pTabFrm1->GetFollow(); ++ if (pTabFrm1) ++ { ++ while (pTabFrm1->GetFollow()) ++ pTabFrm1 = pTabFrm1->GetFollow(); ++ } + + const SwTabFrm *pTabFrm2 = pFrm->FindTabFrm(); +- while( pTabFrm2->GetFollow() ) +- pTabFrm2 = pTabFrm2->GetFollow(); ++ if (pTabFrm2) ++ { ++ while (pTabFrm2->GetFollow()) ++ pTabFrm2 = pTabFrm2->GetFollow(); ++ } + + bRet = (pTabFrm1 == pTabFrm2); + } +-- +1.8.4.2 + diff --git a/SOURCES/0040-fdo-69984-Handle-duplicate-field-names-correctly.patch b/SOURCES/0040-fdo-69984-Handle-duplicate-field-names-correctly.patch new file mode 100644 index 0000000..ccc4308 --- /dev/null +++ b/SOURCES/0040-fdo-69984-Handle-duplicate-field-names-correctly.patch @@ -0,0 +1,314 @@ +From 2ea5c1b6dd1d8fda41c1c1fdc3cf994c4f9e5895 Mon Sep 17 00:00:00 2001 +From: Kohei Yoshida +Date: Thu, 5 Dec 2013 15:37:10 -0500 +Subject: [PATCH 040/109] fdo#69984: Handle duplicate field names correctly. + +Duplicate field names are represented in two ways: 1) 'Name' vs 'Name*' in +the UNO part of the pivot engine, and 2) Name,0 vs Name,1 which are a pair +of textural name and a numeric duplicate index in the non-UNO part of the +engine. But some parts lost this duplicate index information and/or confused +the 2 ways of representation. Hopefully this change will sort things out. + +(cherry picked from commit 7e491281d2ba71490fa22cce1e43ba91f60395e3) + +Conflicts: + sc/inc/pivot.hxx + +Change-Id: I03ae7b6c011c31ace454679837542d6d0909ecaa +Reviewed-on: https://gerrit.libreoffice.org/6944 +Reviewed-by: Eike Rathke +Tested-by: Eike Rathke +--- + sc/inc/dputil.hxx | 8 +++++++- + sc/inc/pivot.hxx | 26 ++++++++++++++------------ + sc/source/core/data/dpobject.cxx | 6 ++++++ + sc/source/core/data/dputil.cxx | 21 +++++++++++++++++++++ + sc/source/core/data/pivot2.cxx | 7 ++++--- + sc/source/ui/dbgui/pvfundlg.cxx | 34 +++++++++++++++++++++++----------- + sc/source/ui/dbgui/pvlaydlg.cxx | 7 +++++-- + sc/source/ui/inc/pvfundlg.hxx | 4 ++-- + 8 files changed, 82 insertions(+), 31 deletions(-) + +diff --git a/sc/inc/dputil.hxx b/sc/inc/dputil.hxx +index 294ca97..e4ed831 100644 +--- a/sc/inc/dputil.hxx ++++ b/sc/inc/dputil.hxx +@@ -26,7 +26,13 @@ public: + + SC_DLLPUBLIC static OUString getSourceDimensionName(const OUString& rName); + +- static OUString createDuplicateDimensionName(const OUString& rOriginal, size_t nDupCount); ++ /** ++ * Get a duplicate index in case the dimension is a duplicate. It returns ++ * 0 in case it's an original dimension. ++ */ ++ sal_uInt8 static getDuplicateIndex(const OUString& rName); ++ ++ SC_DLLPUBLIC static OUString createDuplicateDimensionName(const OUString& rOriginal, size_t nDupCount); + + static OUString getDateGroupName( + sal_Int32 nDatePart, sal_Int32 nValue, SvNumberFormatter* pFormatter, +diff --git a/sc/inc/pivot.hxx b/sc/inc/pivot.hxx +index 85e19e0..a1e063f 100644 +--- a/sc/inc/pivot.hxx ++++ b/sc/inc/pivot.hxx +@@ -52,13 +52,14 @@ + #include + #include + +- +-struct ScDPName ++struct SC_DLLPUBLIC ScDPName + { +- OUString maName; /// Original name of the dimension. +- OUString maLayoutName; /// Layout name (display name) ++ OUString maName; ///< Original name of the dimension. ++ OUString maLayoutName; ///< Layout name (display name) ++ sal_uInt8 mnDupCount; + +- explicit ScDPName(const OUString& rName, const OUString& rLayoutName); ++ ScDPName(); ++ explicit ScDPName(const OUString& rName, const OUString& rLayoutName, sal_uInt8 nDupCount); + }; + + // ============================================================================ +@@ -68,13 +69,14 @@ struct ScDPLabelData + OUString maName; /// Original name of the dimension. + OUString maLayoutName; /// Layout name (display name) + OUString maSubtotalName; +- SCCOL mnCol; /// 0-based field index (not the source column index) +- long mnOriginalDim; /// original dimension index (>= 0 for duplicated dimension) +- sal_uInt16 mnFuncMask; /// Page/Column/Row subtotal function. +- sal_Int32 mnUsedHier; /// Used hierarchy. +- sal_Int32 mnFlags; /// Flags from the DataPilotSource dimension +- bool mbShowAll:1; /// true = Show all (also empty) results. +- bool mbIsValue:1; /// true = Sum or count in data field. ++ SCCOL mnCol; ///< 0-based field index (not the source column index) ++ long mnOriginalDim; ///< original dimension index (>= 0 for duplicated dimension) ++ sal_uInt16 mnFuncMask; ///< Page/Column/Row subtotal function. ++ sal_Int32 mnUsedHier; ///< Used hierarchy. ++ sal_Int32 mnFlags; ///< Flags from the DataPilotSource dimension ++ sal_uInt8 mnDupCount; ++ bool mbShowAll:1; ///< true = Show all (also empty) results. ++ bool mbIsValue:1; ///< true = Sum or count in data field. + bool mbDataLayout:1; + + struct Member +diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx +index fba73d6..3a45a34 100644 +--- a/sc/source/core/data/dpobject.cxx ++++ b/sc/source/core/data/dpobject.cxx +@@ -2278,10 +2278,16 @@ bool ScDPObject::FillLabelDataForDimension( + xDimProp, OUString(SC_UNO_DP_FIELD_SUBTOTALNAME), OUString()); + + bool bIsValue = true; //! check ++ ++ // Name from the UNO dimension object may have trailing '*'s in which ++ // case it's a duplicate dimension. Convert that to a duplicate index. ++ ++ sal_uInt8 nDupCount = ScDPUtil::getDuplicateIndex(aFieldName); + aFieldName = ScDPUtil::getSourceDimensionName(aFieldName); + + rLabelData.maName = aFieldName; + rLabelData.mnCol = static_cast(nDim); ++ rLabelData.mnDupCount = nDupCount; + rLabelData.mbDataLayout = bData; + rLabelData.mbIsValue = bIsValue; + +diff --git a/sc/source/core/data/dputil.cxx b/sc/source/core/data/dputil.cxx +index d1fc655..e34bc79 100644 +--- a/sc/source/core/data/dputil.cxx ++++ b/sc/source/core/data/dputil.cxx +@@ -68,6 +68,27 @@ OUString ScDPUtil::getSourceDimensionName(const OUString& rName) + return comphelper::string::stripEnd(rName, '*'); + } + ++sal_uInt8 ScDPUtil::getDuplicateIndex(const OUString& rName) ++{ ++ // Count all trailing '*'s. ++ ++ sal_Int32 n = rName.getLength(); ++ if (!n) ++ return 0; ++ ++ sal_uInt8 nDupCount = 0; ++ const sal_Unicode* p = rName.getStr(); ++ const sal_Unicode* pStart = p; ++ p += n-1; // Set it to the last char. ++ for (; p != pStart; --p, ++nDupCount) ++ { ++ if (*p != '*') ++ break; ++ } ++ ++ return nDupCount; ++} ++ + OUString ScDPUtil::createDuplicateDimensionName(const OUString& rOriginal, size_t nDupCount) + { + if (!nDupCount) +diff --git a/sc/source/core/data/pivot2.cxx b/sc/source/core/data/pivot2.cxx +index e8aed77..9460632 100644 +--- a/sc/source/core/data/pivot2.cxx ++++ b/sc/source/core/data/pivot2.cxx +@@ -58,10 +58,10 @@ bool equals(const DataPilotFieldReference& left, const DataPilotFieldReference& + + } + +-// ============================================================================ ++ScDPName::ScDPName() : mnDupCount(0) {} + +-ScDPName::ScDPName(const OUString& rName, const OUString& rLayoutName) : +- maName(rName), maLayoutName(rLayoutName) {} ++ScDPName::ScDPName(const OUString& rName, const OUString& rLayoutName, sal_uInt8 nDupCount) : ++ maName(rName), maLayoutName(rLayoutName), mnDupCount(nDupCount) {} + + // ============================================================================ + +@@ -85,6 +85,7 @@ ScDPLabelData::ScDPLabelData() : + mnFuncMask(PIVOT_FUNC_NONE), + mnUsedHier(0), + mnFlags(0), ++ mnDupCount(0), + mbShowAll(false), + mbIsValue(false), + mbDataLayout(false) +diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx +index f9e468b..af369f4 100644 +--- a/sc/source/ui/dbgui/pvfundlg.cxx ++++ b/sc/source/ui/dbgui/pvfundlg.cxx +@@ -35,6 +35,7 @@ + #include "dpsave.hxx" + #include "pvfundlg.hrc" + #include "globstr.hrc" ++#include "dputil.hxx" + + #include + +@@ -574,8 +575,13 @@ void ScDPSubtotalOptDlg::FillLabelData( ScDPLabelData& rLabelData ) const + else + rLabelData.maSortInfo.Mode = DataPilotFieldSortMode::DATA; + +- rLabelData.maSortInfo.Field = GetFieldName(maLbSortBy.GetSelectEntry()); +- rLabelData.maSortInfo.IsAscending = maRbSortAsc.IsChecked(); ++ ScDPName aFieldName = GetFieldName(maLbSortBy.GetSelectEntry()); ++ if (!aFieldName.maName.isEmpty()) ++ { ++ rLabelData.maSortInfo.Field = ++ ScDPUtil::createDuplicateDimensionName(aFieldName.maName, aFieldName.mnDupCount); ++ rLabelData.maSortInfo.IsAscending = maRbSortAsc.IsChecked(); ++ } + + // *** LAYOUT MODE *** + +@@ -584,10 +590,15 @@ void ScDPSubtotalOptDlg::FillLabelData( ScDPLabelData& rLabelData ) const + + // *** AUTO SHOW *** + +- rLabelData.maShowInfo.IsEnabled = maCbShow.IsChecked(); +- rLabelData.maShowInfo.ShowItemsMode = maLbShowFromWrp.GetControlValue(); +- rLabelData.maShowInfo.ItemCount = sal::static_int_cast( maNfShow.GetValue() ); +- rLabelData.maShowInfo.DataField = GetFieldName(maLbShowUsing.GetSelectEntry()); ++ aFieldName = GetFieldName(maLbShowUsing.GetSelectEntry()); ++ if (!aFieldName.maName.isEmpty()) ++ { ++ rLabelData.maShowInfo.IsEnabled = maCbShow.IsChecked(); ++ rLabelData.maShowInfo.ShowItemsMode = maLbShowFromWrp.GetControlValue(); ++ rLabelData.maShowInfo.ItemCount = sal::static_int_cast( maNfShow.GetValue() ); ++ rLabelData.maShowInfo.DataField = ++ ScDPUtil::createDuplicateDimensionName(aFieldName.maName, aFieldName.mnDupCount); ++ } + + // *** HIDDEN ITEMS *** + +@@ -613,7 +624,7 @@ void ScDPSubtotalOptDlg::Init( const ScDPNameVec& rDataFields, bool bEnableLayou + for( ScDPNameVec::const_iterator aIt = rDataFields.begin(), aEnd = rDataFields.end(); aIt != aEnd; ++aIt ) + { + // Cache names for later lookup. +- maDataFieldNameMap.insert(NameMapType::value_type(aIt->maLayoutName, aIt->maName)); ++ maDataFieldNameMap.insert(NameMapType::value_type(aIt->maLayoutName, *aIt)); + + maLbSortBy.InsertEntry( aIt->maLayoutName ); + maLbShowUsing.InsertEntry( aIt->maLayoutName ); // for AutoShow +@@ -714,10 +725,10 @@ void ScDPSubtotalOptDlg::InitHideListBox() + maLbHide.Enable( bEnable ); + } + +-const OUString& ScDPSubtotalOptDlg::GetFieldName(const OUString& rLayoutName) const ++ScDPName ScDPSubtotalOptDlg::GetFieldName(const OUString& rLayoutName) const + { + NameMapType::const_iterator itr = maDataFieldNameMap.find(rLayoutName); +- return itr == maDataFieldNameMap.end() ? rLayoutName : itr->second; ++ return itr == maDataFieldNameMap.end() ? ScDPName() : itr->second; + } + + sal_uInt16 ScDPSubtotalOptDlg::FindListBoxEntry( +@@ -728,8 +739,9 @@ sal_uInt16 ScDPSubtotalOptDlg::FindListBoxEntry( + while (nPos < rLBox.GetEntryCount()) + { + // translate the displayed field name back to its original field name. +- const OUString& rName = GetFieldName(rLBox.GetEntry(nPos)); +- if (rName.equals(rEntry)) ++ ScDPName aName = GetFieldName(rLBox.GetEntry(nPos)); ++ OUString aUnoName = ScDPUtil::createDuplicateDimensionName(aName.maName, aName.mnDupCount); ++ if (aUnoName.equals(rEntry)) + { + bFound = true; + break; +diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx +index 79178c9..b682845 100644 +--- a/sc/source/ui/dbgui/pvlaydlg.cxx ++++ b/sc/source/ui/dbgui/pvlaydlg.cxx +@@ -60,6 +60,7 @@ + #include "dpsave.hxx" + #include "dpshttab.hxx" + #include "scmod.hxx" ++#include "dputil.hxx" + + #include "sc.hrc" + #include "scabstdlg.hxx" +@@ -783,7 +784,7 @@ void ScPivotLayoutDlg::NotifyDoubleClick( ScPivotFieldType eType, size_t nFieldI + OUString aFuncStr = GetFuncString(nMask); + aLayoutName = aFuncStr + pDFData->maName; + } +- aDataFieldNames.push_back(ScDPName(pDFData->maName, aLayoutName)); ++ aDataFieldNames.push_back(ScDPName(pDFData->maName, aLayoutName, pDFData->mnDupCount)); + } + + bool bLayout = (eType == PIVOTFIELDTYPE_ROW) && +@@ -1588,7 +1589,9 @@ IMPL_LINK_NOARG(ScPivotLayoutDlg, OkHdl) + + for( ScDPLabelDataVector::const_iterator aIt = maLabelData.begin(), aEnd = maLabelData.end(); aIt != aEnd; ++aIt ) + { +- ScDPSaveDimension* pDim = aSaveData.GetExistingDimensionByName(aIt->maName); ++ // "UNO" name may have trailing '*'s which signifies duplicate index. ++ OUString aUnoName = ScDPUtil::createDuplicateDimensionName(aIt->maName, aIt->mnDupCount); ++ ScDPSaveDimension* pDim = aSaveData.GetExistingDimensionByName(aUnoName); + + if (!pDim) + continue; +diff --git a/sc/source/ui/inc/pvfundlg.hxx b/sc/source/ui/inc/pvfundlg.hxx +index c02cb5c..6ad269d 100644 +--- a/sc/source/ui/inc/pvfundlg.hxx ++++ b/sc/source/ui/inc/pvfundlg.hxx +@@ -162,7 +162,7 @@ private: + void Init( const ScDPNameVec& rDataFields, bool bEnableLayout ); + void InitHideListBox(); + +- const OUString& GetFieldName(const OUString& rLayoutName) const; ++ ScDPName GetFieldName(const OUString& rLayoutName) const; + + /** Searches for a listbox entry, starts search at specified position. */ + sal_uInt16 FindListBoxEntry( const ListBox& rLBox, const String& rEntry, sal_uInt16 nStartPos ) const; +@@ -203,7 +203,7 @@ private: + ScDPObject& mrDPObj; /// The DataPilot object (for member names). + ScDPLabelData maLabelData; /// Cache for members data. + +- typedef ::boost::unordered_map< OUString, OUString, OUStringHash > NameMapType; ++ typedef ::boost::unordered_map NameMapType; + NameMapType maDataFieldNameMap; /// Cache for displayed name to field name mapping. + }; + +-- +1.8.4.2 + diff --git a/SOURCES/0042-fdo-71892-sw-fix-crash-when-pasting-table-in-footnot.patch b/SOURCES/0042-fdo-71892-sw-fix-crash-when-pasting-table-in-footnot.patch new file mode 100644 index 0000000..8552c5e --- /dev/null +++ b/SOURCES/0042-fdo-71892-sw-fix-crash-when-pasting-table-in-footnot.patch @@ -0,0 +1,74 @@ +From 640e8abbff03f7f242c0c0b9d73ffd2eda3c4e35 Mon Sep 17 00:00:00 2001 +From: Michael Stahl +Date: Thu, 5 Dec 2013 21:58:11 +0100 +Subject: [PATCH 042/109] fdo#71892: sw: fix crash when pasting table in + footnote +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The code that updates RSIDs assumes that the number of nodes copied is +the same as the number of nodes inserted, which is not true when pasting +a table into a footnote because Writer can't do that, hence all table +nodes are missing. Count inserted nodes instead. + +(regression from 062eaeffe7cb986255063bb9b0a5f3fb3fc8e34c) + +(cherry picked from commit 4580094d2d9d5b952c4526ee23204f75a5bb2f1b) + +Conflicts: + sw/source/core/frmedt/fecopy.cxx + +(cherry picked from commit 2171fff4c1a57ede8f9693d7c0d95c1171a49a70) + +Change-Id: I77b5b7751d1036a6401f708532537d874969502e +Reviewed-on: https://gerrit.libreoffice.org/6951 +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +--- + sw/source/core/frmedt/fecopy.cxx | 23 ++++++++++------------- + 1 file changed, 10 insertions(+), 13 deletions(-) + +diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx +index 3fa4a73..6c503dc 100644 +--- a/sw/source/core/frmedt/fecopy.cxx ++++ b/sw/source/core/frmedt/fecopy.cxx +@@ -1039,25 +1039,22 @@ sal_Bool SwFEShell::Paste( SwDoc* pClpDoc, sal_Bool bIncludingPageFrames ) + aIndexBefore--; + + pClpDoc->CopyRange( aCpyPam, rInsPos, false ); ++ // Note: aCpyPam is invalid now + +- { +- ++aIndexBefore; +- SwPaM aPaM(SwPosition(aIndexBefore), +- SwPosition(rInsPos.nNode)); ++ ++aIndexBefore; ++ SwPaM aPaM(SwPosition(aIndexBefore), ++ SwPosition(rInsPos.nNode)); + +- aPaM.GetDoc()->MakeUniqueNumRules(aPaM); +- } +- } ++ aPaM.GetDoc()->MakeUniqueNumRules(aPaM); + +- // Update the rsid of each pasted text node. +- { +- xub_StrLen nNodesCnt = aCpyPam.End()->nNode.GetIndex() - aCpyPam.Start()->nNode.GetIndex(); ++ // Update the rsid of each pasted text node. + SwNodes &rDestNodes = GetDoc()->GetNodes(); +- xub_StrLen nDestStart = PCURCRSR->GetPoint()->nNode.GetIndex() - nNodesCnt; ++ sal_uLong const nEndIdx = aPaM.End()->nNode.GetIndex(); + +- for ( sal_uInt64 nIdx = 0; nIdx <= nNodesCnt; nIdx++ ) ++ for (sal_uLong nIdx = aPaM.Start()->nNode.GetIndex(); ++ nIdx <= nEndIdx; ++nIdx) + { +- SwTxtNode *pTxtNode = rDestNodes[ nDestStart + nIdx ]->GetTxtNode(); ++ SwTxtNode *const pTxtNode = rDestNodes[nIdx]->GetTxtNode(); + if ( pTxtNode ) + { + GetDoc()->UpdateParRsid( pTxtNode ); +-- +1.8.4.2 + diff --git a/SOURCES/0043-fdo-69518-Correctly-handle-the-old-constraint-syntax.patch b/SOURCES/0043-fdo-69518-Correctly-handle-the-old-constraint-syntax.patch new file mode 100644 index 0000000..44845d5 --- /dev/null +++ b/SOURCES/0043-fdo-69518-Correctly-handle-the-old-constraint-syntax.patch @@ -0,0 +1,482 @@ +From cfc9cef1e26e98153eb93229a9c18a674a3ebf11 Mon Sep 17 00:00:00 2001 +From: Kohei Yoshida +Date: Fri, 6 Dec 2013 10:43:38 -0500 +Subject: [PATCH 043/109] fdo#69518: Correctly handle the old constraint + syntax. + +We apparently support this syntax for ODF-backward compatibility. + +To fix this, I resurrected ScDPObject::ParseFilters() which was removed as +unused, adjusted it for the String->OUString change, and changed the filter +data structure to the UNO one rather than using the old one we no longer use +elsewhere. + +(cherry picked from commit 1d85c8df2fb9cb25fc524485339ae9f11e8da676) + +Conflicts: + sc/inc/dpobject.hxx + sc/source/core/data/dpobject.cxx + sc/source/core/tool/interpr2.cxx + +Change-Id: If52b38aaa1e8b208fb0ef9d92a6e853decdf43e3 +Reviewed-on: https://gerrit.libreoffice.org/6962 +Reviewed-by: Eike Rathke +Tested-by: Eike Rathke +--- + sc/inc/dpobject.hxx | 8 +- + sc/inc/dpoutput.hxx | 21 ----- + sc/source/core/data/dpobject.cxx | 163 ++++++++++++++++++++------------------- + sc/source/core/tool/interpr2.cxx | 15 ++++ + 4 files changed, 103 insertions(+), 104 deletions(-) + +diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx +index 735b033..8505a53 100644 +--- a/sc/inc/dpobject.hxx ++++ b/sc/inc/dpobject.hxx +@@ -183,9 +183,11 @@ public: + const OUString& rDataFieldName, + std::vector& rFilters); + +- bool ParseFilters( ScDPGetPivotDataField& rTarget, +- std::vector< ScDPGetPivotDataField >& rFilters, +- const OUString& rFilterList ); ++ bool ParseFilters( ++ OUString& rDataFieldName, ++ std::vector& rFilters, ++ std::vector& rFilterFuncs, ++ const OUString& rFilterList ); + + void GetMemberResultNames(ScDPUniqueStringSet& rNames, long nDimension); + +diff --git a/sc/inc/dpoutput.hxx b/sc/inc/dpoutput.hxx +index 293d937..7b38c7e 100644 +--- a/sc/inc/dpoutput.hxx ++++ b/sc/inc/dpoutput.hxx +@@ -41,29 +41,8 @@ namespace com { namespace sun { namespace star { namespace sheet { + + class Rectangle; + class ScDocument; +- + struct ScDPOutLevelData; + +- +-struct ScDPGetPivotDataField +-{ +- OUString maFieldName; +- com::sun::star::sheet::GeneralFunction meFunction; +- +- bool mbValIsStr; +- OUString maValStr; +- double mnValNum; +- +- ScDPGetPivotDataField() : +- meFunction( com::sun::star::sheet::GeneralFunction_NONE ), +- mbValIsStr( false ), +- mnValNum( 0.0 ) +- { +- } +-}; +- +- +- + class ScDPOutput + { + private: +diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx +index 3a45a34..677ccd5 100644 +--- a/sc/source/core/data/dpobject.cxx ++++ b/sc/source/core/data/dpobject.cxx +@@ -1400,25 +1400,27 @@ void ScDPObject::GetMemberResultNames(ScDPUniqueStringSet& rNames, long nDimensi + pOutput->GetMemberResultNames(rNames, nDimension); // used only with table data -> level not needed + } + +-static bool lcl_Dequote( const String& rSource, xub_StrLen nStartPos, xub_StrLen& rEndPos, String& rResult ) ++namespace { ++ ++bool dequote( const OUString& rSource, sal_Int32 nStartPos, sal_Int32& rEndPos, OUString& rResult ) + { + // nStartPos has to point to opening quote + + bool bRet = false; + const sal_Unicode cQuote = '\''; + +- if ( rSource.GetChar(nStartPos) == cQuote ) ++ if (rSource[nStartPos] == cQuote) + { + OUStringBuffer aBuffer; +- xub_StrLen nPos = nStartPos + 1; +- const xub_StrLen nLen = rSource.Len(); ++ sal_Int32 nPos = nStartPos + 1; ++ const sal_Int32 nLen = rSource.getLength(); + + while ( nPos < nLen ) + { +- const sal_Unicode cNext = rSource.GetChar(nPos); ++ const sal_Unicode cNext = rSource[nPos]; + if ( cNext == cQuote ) + { +- if ( nPos+1 < nLen && rSource.GetChar(nPos+1) == cQuote ) ++ if (nPos+1 < nLen && rSource[nPos+1] == cQuote) + { + // double quote is used for an embedded quote + aBuffer.append( cNext ); // append one quote +@@ -1449,7 +1451,7 @@ struct ScGetPivotDataFunctionEntry + sheet::GeneralFunction eFunc; + }; + +-static bool lcl_ParseFunction( const String& rList, xub_StrLen nStartPos, xub_StrLen& rEndPos, sheet::GeneralFunction& rFunc ) ++bool parseFunction( const OUString& rList, sal_Int32 nStartPos, sal_Int32& rEndPos, sheet::GeneralFunction& rFunc ) + { + static const ScGetPivotDataFunctionEntry aFunctions[] = + { +@@ -1471,22 +1473,22 @@ static bool lcl_ParseFunction( const String& rList, xub_StrLen nStartPos, xub_St + { "StdDevp", sheet::GeneralFunction_STDEVP } + }; + +- const xub_StrLen nListLen = rList.Len(); +- while ( nStartPos < nListLen && rList.GetChar(nStartPos) == ' ' ) ++ const sal_Int32 nListLen = rList.getLength(); ++ while (nStartPos < nListLen && rList[nStartPos] == ' ') + ++nStartPos; + + bool bParsed = false; + bool bFound = false; +- String aFuncStr; +- xub_StrLen nFuncEnd = 0; +- if ( nStartPos < nListLen && rList.GetChar(nStartPos) == '\'' ) +- bParsed = lcl_Dequote( rList, nStartPos, nFuncEnd, aFuncStr ); ++ OUString aFuncStr; ++ sal_Int32 nFuncEnd = 0; ++ if (nStartPos < nListLen && rList[nStartPos] == '\'') ++ bParsed = dequote( rList, nStartPos, nFuncEnd, aFuncStr ); + else + { +- nFuncEnd = rList.Search( static_cast(']'), nStartPos ); +- if ( nFuncEnd != STRING_NOTFOUND ) ++ nFuncEnd = rList.indexOf(']', nStartPos); ++ if (nFuncEnd >= 0) + { +- aFuncStr = rList.Copy( nStartPos, nFuncEnd - nStartPos ); ++ aFuncStr = rList.copy(nStartPos, nFuncEnd - nStartPos); + bParsed = true; + } + } +@@ -1498,12 +1500,12 @@ static bool lcl_ParseFunction( const String& rList, xub_StrLen nStartPos, xub_St + const sal_Int32 nFuncCount = sizeof(aFunctions) / sizeof(aFunctions[0]); + for ( sal_Int32 nFunc=0; nFunc(']'), nStartPos ); +- if ( nClosePos != STRING_NOTFOUND ) ++ sal_Int32 nClosePos = rList.indexOf(']', nStartPos); ++ if (nClosePos >= 0) + { +- xub_StrLen nNameEnd = nClosePos; +- xub_StrLen nSemiPos = rList.Search( static_cast(';'), nStartPos ); +- if ( nSemiPos != STRING_NOTFOUND && nSemiPos < nClosePos && pFunc ) ++ sal_Int32 nNameEnd = nClosePos; ++ sal_Int32 nSemiPos = rList.indexOf(';', nStartPos); ++ if (nSemiPos >= 0 && nSemiPos < nClosePos && pFunc) + { +- xub_StrLen nFuncEnd = 0; +- if ( lcl_ParseFunction( rList, nSemiPos + 1, nFuncEnd, *pFunc ) ) ++ sal_Int32 nFuncEnd = 0; ++ if (parseFunction(rList, nSemiPos+1, nFuncEnd, *pFunc)) + nNameEnd = nSemiPos; + } + +- aDequoted = rList.Copy( nStartPos, nNameEnd - nStartPos ); ++ aDequoted = rList.copy(nStartPos, nNameEnd - nStartPos); + // spaces before the closing bracket or semicolon + aDequoted = comphelper::string::stripEnd(aDequoted, ' '); + nQuoteEnd = nClosePos + 1; +@@ -1589,26 +1592,26 @@ static bool lcl_IsAtStart( const String& rList, const String& rSearch, sal_Int32 + if ( bParsed && ScGlobal::GetpTransliteration()->isEqual( aDequoted, rSearch ) ) + { + nMatchList = nQuoteEnd; // match count in the list string, including quotes +- nMatchSearch = rSearch.Len(); ++ nMatchSearch = rSearch.getLength(); + } + } + else + { + // otherwise look for search string at the start of rList +- ScGlobal::GetpTransliteration()->equals( rList, 0, rList.Len(), nMatchList, +- rSearch, 0, rSearch.Len(), nMatchSearch ); ++ ScGlobal::GetpTransliteration()->equals( ++ rList, 0, rList.getLength(), nMatchList, rSearch, 0, rSearch.getLength(), nMatchSearch); + } + +- if ( nMatchSearch == rSearch.Len() ) ++ if (nMatchSearch == rSearch.getLength()) + { + // search string is at start of rList - look for following space or end of string + + bool bValid = false; +- if ( sal::static_int_cast(nMatchList) >= rList.Len() ) ++ if ( sal::static_int_cast(nMatchList) >= rList.getLength() ) + bValid = true; + else + { +- sal_Unicode cNext = rList.GetChar(sal::static_int_cast(nMatchList)); ++ sal_Unicode cNext = rList[nMatchList]; + if ( cNext == ' ' || ( bAllowBracket && cNext == '[' ) ) + bValid = true; + } +@@ -1623,17 +1626,20 @@ static bool lcl_IsAtStart( const String& rList, const String& rSearch, sal_Int32 + return false; + } + +-bool ScDPObject::ParseFilters( ScDPGetPivotDataField& rTarget, +- std::vector< ScDPGetPivotDataField >& rFilters, +- const OUString& rFilterList ) ++} // anonymous namespace ++ ++bool ScDPObject::ParseFilters( ++ OUString& rDataFieldName, ++ std::vector& rFilters, ++ std::vector& rFilterFuncs, const OUString& rFilterList ) + { + // parse the string rFilterList into parameters for GetPivotData + + CreateObjects(); // create xSource if not already done + +- std::vector aDataNames; // data fields (source name) +- std::vector aGivenNames; // data fields (compound name) +- std::vector aFieldNames; // column/row/data fields ++ std::vector aDataNames; // data fields (source name) ++ std::vector aGivenNames; // data fields (compound name) ++ std::vector aFieldNames; // column/row/data fields + std::vector< uno::Sequence > aFieldValues; + + // +@@ -1691,7 +1697,7 @@ bool ScDPObject::ParseFilters( ScDPGetPivotDataField& rTarget, + { + uno::Reference xMembers = xLevSupp->getMembers(); + +- String aFieldName( xLevNam->getName() ); ++ OUString aFieldName( xLevNam->getName() ); + uno::Sequence aMemberNames( xMembers->getElementNames() ); + + aFieldNames.push_back( aFieldName ); +@@ -1713,8 +1719,8 @@ bool ScDPObject::ParseFilters( ScDPGetPivotDataField& rTarget, + + bool bError = false; + bool bHasData = false; +- String aRemaining(comphelper::string::strip(rFilterList, ' ')); +- while ( aRemaining.Len() && !bError ) ++ OUString aRemaining(comphelper::string::strip(rFilterList, ' ')); ++ while (!aRemaining.isEmpty() && !bError) + { + bool bUsed = false; + +@@ -1722,17 +1728,17 @@ bool ScDPObject::ParseFilters( ScDPGetPivotDataField& rTarget, + + for ( SCSIZE nDataPos=0; nDataPos(nMatched) ); ++ rDataFieldName = aFound; ++ aRemaining = aRemaining.copy(nMatched); + bHasData = true; + bUsed = true; + } +@@ -1740,21 +1746,21 @@ bool ScDPObject::ParseFilters( ScDPGetPivotDataField& rTarget, + + // look for field name + +- String aSpecField; ++ OUString aSpecField; + bool bHasFieldName = false; + if ( !bUsed ) + { + sal_Int32 nMatched = 0; + for ( SCSIZE nField=0; nField(nMatched) ); ++ aRemaining = aRemaining.copy(nMatched); + aRemaining = comphelper::string::stripStart(aRemaining, ' '); + + // field name has to be followed by item name in brackets +- if ( aRemaining.GetChar(0) == '[' ) ++ if (!aRemaining.isEmpty() && aRemaining[0] == '[') + { + bHasFieldName = true; + // bUsed remains false - still need the item +@@ -1774,8 +1780,8 @@ bool ScDPObject::ParseFilters( ScDPGetPivotDataField& rTarget, + { + bool bItemFound = false; + sal_Int32 nMatched = 0; +- String aFoundName; +- String aFoundValue; ++ OUString aFoundName; ++ OUString aFoundValue; + sheet::GeneralFunction eFunc = sheet::GeneralFunction_NONE; + sheet::GeneralFunction eFoundFunc = sheet::GeneralFunction_NONE; + +@@ -1790,7 +1796,7 @@ bool ScDPObject::ParseFilters( ScDPGetPivotDataField& rTarget, + const OUString* pItemArr = rItems.getConstArray(); + for ( sal_Int32 nItem=0; nItem(nMatched) ); ++ sheet::DataPilotFieldFilter aField; ++ aField.FieldName = aFoundName; ++ aField.MatchValue = aFoundValue; ++ rFilters.push_back(aField); ++ rFilterFuncs.push_back(eFoundFunc); ++ aRemaining = aRemaining.copy(nMatched); + } + } + +@@ -1831,7 +1834,7 @@ bool ScDPObject::ParseFilters( ScDPGetPivotDataField& rTarget, + if ( !bError && !bHasData && aDataNames.size() == 1 ) + { + // if there's only one data field, its name need not be specified +- rTarget.maFieldName = aDataNames[0]; ++ rDataFieldName = aDataNames[0]; + bHasData = true; + } + +diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx +index 7cc59de..a0f270d 100644 +--- a/sc/source/core/tool/interpr2.cxx ++++ b/sc/source/core/tool/interpr2.cxx +@@ -3005,6 +3005,21 @@ void ScInterpreter::ScGetPivotData() + return; + } + ++ if (bOldSyntax) ++ { ++ OUString aFilterStr = aDataFieldName; ++ std::vector aFilterFuncs; ++ if (!pDPObj->ParseFilters(aDataFieldName, aFilters, aFilterFuncs, aFilterStr)) ++ { ++ PushError(errNoRef); ++ return; ++ } ++ ++ // TODO : For now, we ignore filter functions since we couldn't find a ++ // live example of how they are supposed to be used. We'll support ++ // this again once we come across a real-world example. ++ } ++ + double fVal = pDPObj->GetPivotData(aDataFieldName, aFilters); + if (rtl::math::isNan(fVal)) + { +-- +1.8.4.2 + diff --git a/SOURCES/0044-Do-not-create-paths-starting-when-root-is-just.patch b/SOURCES/0044-Do-not-create-paths-starting-when-root-is-just.patch new file mode 100644 index 0000000..17f0c7a --- /dev/null +++ b/SOURCES/0044-Do-not-create-paths-starting-when-root-is-just.patch @@ -0,0 +1,45 @@ +From 2e01c8727ac2652563dd4f0c45be4aa957136be8 Mon Sep 17 00:00:00 2001 +From: Stephan Bergmann +Date: Fri, 6 Dec 2013 16:52:27 +0100 +Subject: [PATCH 044/109] Do not create paths starting "//" when root is just + "/" + +(cherry picked from commit bd8b3be0c7535e74ca8b63969be5c2bece0d3a3b) +Conflicts: + configmgr/source/access.cxx + +Change-Id: If0b413a4fdd93465074548c7ea5451288c1d12aa +Reviewed-on: https://gerrit.libreoffice.org/6961 +Reviewed-by: Eike Rathke +Tested-by: Eike Rathke +--- + configmgr/source/access.cxx | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx +index 9f18e8f..aa04a94 100644 +--- a/configmgr/source/access.cxx ++++ b/configmgr/source/access.cxx +@@ -565,14 +565,15 @@ OUString Access::getHierarchicalName() throw (css::uno::RuntimeException) { + checkLocalizedPropertyAccess(); + // For backwards compatibility, return an absolute path representation where + // available: +- OUStringBuffer path; ++ OUString rootPath; + rtl::Reference< RootAccess > root(getRootAccess()); + if (root.is()) { +- path.append(root->getAbsolutePathRepresentation()); ++ rootPath = root->getAbsolutePathRepresentation(); + } + OUString rel(getRelativePathRepresentation()); +- if (path.getLength() != 0 && !rel.isEmpty()) { +- path.append(sal_Unicode('/')); ++ OUStringBuffer path(rootPath); ++ if (!rootPath.isEmpty() && rootPath != "/" && !rel.isEmpty()) { ++ path.append('/'); + } + path.append(rel); + return path.makeStringAndClear(); +-- +1.8.4.2 + diff --git a/SOURCES/0046-fdo-66984-Define-an-assignment-operator-to-prevent-d.patch b/SOURCES/0046-fdo-66984-Define-an-assignment-operator-to-prevent-d.patch new file mode 100644 index 0000000..ec3bd15 --- /dev/null +++ b/SOURCES/0046-fdo-66984-Define-an-assignment-operator-to-prevent-d.patch @@ -0,0 +1,113 @@ +From 1d33b1de2b9eeef0043c057bbfa539ab1e7c3238 Mon Sep 17 00:00:00 2001 +From: Kohei Yoshida +Date: Fri, 6 Dec 2013 19:44:21 -0500 +Subject: [PATCH 046/109] fdo#66984: Define an assignment operator to prevent + double deletion. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The code path was assigning one ScDPObject to another via assignment, +but we didn't define one. So we were using the compiler generated +assignment which only shallow-copies data members, which ultimately +caused double-deletion of one of its data members. + +Change-Id: Ie98d0789e51aebff683dbcc0e533a9a0a87943d5 +(cherry picked from commit bd976e5b070ec68a4f842190db4d0c1ea0e93428) +Reviewed-on: https://gerrit.libreoffice.org/6966 +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +--- + sc/inc/dpobject.hxx | 3 +++ + sc/source/core/data/dpobject.cxx | 49 +++++++++++++++++++++++++++++++++++----- + 2 files changed, 46 insertions(+), 6 deletions(-) + +diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx +index 8505a53..06d4957 100644 +--- a/sc/inc/dpobject.hxx ++++ b/sc/inc/dpobject.hxx +@@ -118,11 +118,14 @@ public: + ScDPObject(const ScDPObject& r); + ~ScDPObject(); + ++ ScDPObject& operator= (const ScDPObject& r); ++ + void EnableGetPivotData(bool b); + + void SetAllowMove(bool bSet); + + void InvalidateData(); ++ void Clear(); + void ClearTableData(); + void ReloadGroupTableData(); + +diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx +index 677ccd5..169231a 100644 +--- a/sc/source/core/data/dpobject.cxx ++++ b/sc/source/core/data/dpobject.cxx +@@ -354,12 +354,34 @@ ScDPObject::ScDPObject(const ScDPObject& r) : + + ScDPObject::~ScDPObject() + { +- delete pOutput; +- delete pSaveData; +- delete pSheetDesc; +- delete pImpDesc; +- delete pServDesc; +- ClearTableData(); ++ Clear(); ++} ++ ++ScDPObject& ScDPObject::operator= (const ScDPObject& r) ++{ ++ Clear(); ++ ++ pDoc = r.pDoc; ++ aTableName = r.aTableName; ++ aTableTag = r.aTableTag; ++ aOutRange = r.aOutRange; ++ mnAutoFormatIndex = r.mnAutoFormatIndex; ++ nHeaderRows = r.nHeaderRows; ++ mbHeaderLayout = r.mbHeaderLayout; ++ bAllowMove = false; ++ bSettingsChanged = false; ++ mbEnableGetPivotData = r.mbEnableGetPivotData; ++ ++ if (r.pSaveData) ++ pSaveData = new ScDPSaveData(*r.pSaveData); ++ if (r.pSheetDesc) ++ pSheetDesc = new ScSheetSourceDesc(*r.pSheetDesc); ++ if (r.pImpDesc) ++ pImpDesc = new ScImportSourceDesc(*r.pImpDesc); ++ if (r.pServDesc) ++ pServDesc = new ScDPServiceDesc(*r.pServDesc); ++ ++ return *this; + } + + void ScDPObject::EnableGetPivotData(bool b) +@@ -780,6 +802,21 @@ void ScDPObject::InvalidateData() + bSettingsChanged = true; + } + ++void ScDPObject::Clear() ++{ ++ delete pOutput; ++ delete pSaveData; ++ delete pSheetDesc; ++ delete pImpDesc; ++ delete pServDesc; ++ pOutput = NULL; ++ pSaveData = NULL; ++ pSheetDesc = NULL; ++ pImpDesc = NULL; ++ pServDesc = NULL; ++ ClearTableData(); ++} ++ + void ScDPObject::ClearTableData() + { + ClearSource(); +-- +1.8.4.2 + diff --git a/SOURCES/0047-EMF-Fill-line-cap-object-if-EmfPlusCustomLineCapData.patch b/SOURCES/0047-EMF-Fill-line-cap-object-if-EmfPlusCustomLineCapData.patch new file mode 100644 index 0000000..f0b2e04 --- /dev/null +++ b/SOURCES/0047-EMF-Fill-line-cap-object-if-EmfPlusCustomLineCapData.patch @@ -0,0 +1,111 @@ +From 812963c5ff6e1c4685eddb830a82a69a3801d820 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Mat=C3=BA=C5=A1=20Kukan?= +Date: Fri, 6 Dec 2013 14:40:50 +0100 +Subject: [PATCH 047/109] EMF+: Fill line cap object if + EmfPlusCustomLineCapDataFillPath is set. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Change-Id: I7b53a8f18e1fb24b1ae0322bdf0980e431a0725f +(cherry picked from commit 131f3230d98f24faf57d9404e333cb1fb183345b) +Reviewed-on: https://gerrit.libreoffice.org/6960 +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +--- + cppcanvas/source/inc/implrenderer.hxx | 2 +- + cppcanvas/source/mtfrenderer/emfplus.cxx | 23 ++++++++++++++++++++--- + 2 files changed, 21 insertions(+), 4 deletions(-) + +diff --git a/cppcanvas/source/inc/implrenderer.hxx b/cppcanvas/source/inc/implrenderer.hxx +index d602945..a6f86e0 100644 +--- a/cppcanvas/source/inc/implrenderer.hxx ++++ b/cppcanvas/source/inc/implrenderer.hxx +@@ -284,7 +284,7 @@ static float GetSwapFloat( SvStream& rSt ) + /// Render LineCap, like the start or end arrow of a polygon. + /// @return how much we should shorten the original polygon. + double EMFPPlusDrawLineCap(const ::basegfx::B2DPolygon& rPolygon, double fPolyLength, +- const ::basegfx::B2DPolyPolygon& rLineCap, bool bStart, ++ const ::basegfx::B2DPolyPolygon& rLineCap, bool isFilled, bool bStart, + const com::sun::star::rendering::StrokeAttributes& rAttributes, + const ActionFactoryParameters& rParms, OutDevState& rState); + +diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx +index 2387934..a11dc8b 100644 +--- a/cppcanvas/source/mtfrenderer/emfplus.cxx ++++ b/cppcanvas/source/mtfrenderer/emfplus.cxx +@@ -626,6 +626,7 @@ namespace cppcanvas + sal_uInt32 strokeStartCap, strokeEndCap, strokeJoin; + float miterLimit; + basegfx::B2DPolyPolygon polygon; ++ bool mbIsFilled; + + public: + EMFPCustomLineCap() : EMFPObject() +@@ -652,7 +653,7 @@ namespace cppcanvas + aAttributes.MiterLimit = miterLimit; + } + +- void ReadPath(SvStream& s, ImplRenderer& rR, bool bClosed) ++ void ReadPath(SvStream& s, ImplRenderer& rR, bool bFill) + { + sal_Int32 pathLength; + s >> pathLength; +@@ -669,7 +670,7 @@ namespace cppcanvas + path.Read(s, pathFlags, rR); + + polygon = path.GetPolygon(rR, false); +- polygon.setClosed(bClosed); ++ mbIsFilled = bFill; + + // transformation to convert the path to what LibreOffice + // expects +@@ -1321,7 +1322,7 @@ namespace cppcanvas + } + + double ImplRenderer::EMFPPlusDrawLineCap(const ::basegfx::B2DPolygon& rPolygon, double fPolyLength, +- const ::basegfx::B2DPolyPolygon& rLineCap, bool bStart, const rendering::StrokeAttributes& rAttributes, ++ const ::basegfx::B2DPolyPolygon& rLineCap, bool bIsFilled, bool bStart, const rendering::StrokeAttributes& rAttributes, + const ActionFactoryParameters& rParms, OutDevState& rState) + { + if (!rLineCap.count()) +@@ -1350,6 +1351,20 @@ namespace cppcanvas + rParms.mrCurrActionIndex += pAction->getActionCount()-1; + } + ++ if (bIsFilled) ++ { ++ bool bWasFillColorSet = rState.isFillColorSet; ++ rState.isFillColorSet = true; ++ rState.fillColor = rState.lineColor; ++ ActionSharedPtr pAction2(internal::PolyPolyActionFactory::createPolyPolyAction(aArrow, rParms.mrCanvas, rState)); ++ if (pAction2) ++ { ++ maActions.push_back(MtfAction(pAction2, rParms.mrCurrActionIndex)); ++ rParms.mrCurrActionIndex += pAction2->getActionCount()-1; ++ } ++ rState.isFillColorSet = bWasFillColorSet; ++ } ++ + return rAttributes.StrokeWidth; + } + +@@ -1404,6 +1419,7 @@ namespace cppcanvas + pen->customStartCap->SetAttributes(aAttributes); + + fStart = EMFPPlusDrawLineCap(aPolygon, fPolyLength, pen->customStartCap->polygon, ++ pen->customStartCap->mbIsFilled, + true, aAttributes, rParms, rState); + } + +@@ -1414,6 +1430,7 @@ namespace cppcanvas + pen->customEndCap->SetAttributes(aAttributes); + + fEnd = EMFPPlusDrawLineCap(aPolygon, fPolyLength, pen->customEndCap->polygon, ++ pen->customEndCap->mbIsFilled, + false, aAttributes, rParms, rState); + } + +-- +1.8.4.2 + diff --git a/SOURCES/0049-fdo-72488-Broken-text-when-showing-visible-space.patch b/SOURCES/0049-fdo-72488-Broken-text-when-showing-visible-space.patch new file mode 100644 index 0000000..6ed7b7f --- /dev/null +++ b/SOURCES/0049-fdo-72488-Broken-text-when-showing-visible-space.patch @@ -0,0 +1,48 @@ +From b79b4b88c5eb6b0fe4092b5eb98f3088f316f7b2 Mon Sep 17 00:00:00 2001 +From: Khaled Hosny +Date: Sun, 8 Dec 2013 22:30:28 +0200 +Subject: [PATCH 049/109] fdo#72488: Broken text when showing visible space +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Turning on showing nonprinting characters replaces the space with bullet +character, but still draws the text with the original kern array, this +works fine until there are ligatures involving the space character as +the number of glyphs after replacing the space with the bullet will be +different and the kern array will be completely off. + +This is a hack that gives up on replacing the space with a bullet when +its width is zero, not sure if it would interfere with other legitimate +uses. + +Change-Id: I3803a2097b7c9dab1fb53b24404e8550c5bf537e +Reviewed-on: https://gerrit.libreoffice.org/7005 +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +--- + sw/source/core/txtnode/fntcache.cxx | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx +index 80b2ea8..0857604 100644 +--- a/sw/source/core/txtnode/fntcache.cxx ++++ b/sw/source/core/txtnode/fntcache.cxx +@@ -1531,7 +1531,13 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) + + for( sal_Int32 i = 0; i < aStr.getLength(); ++i ) + if( CH_BLANK == aStr[ i ] ) +- aStr = aStr.replaceAt(i, 1, OUString(CH_BULLET)); ++ { ++ /* fdo#72488 Hack: try to see if the space is zero width ++ * and don't bother with inserting a bullet in this case. ++ */ ++ if (pKernArray[i + nCopyStart] != pKernArray[ i + nCopyStart + 1]) ++ aStr = aStr.replaceAt(i, 1, OUString(CH_BULLET)); ++ } + } + + xub_StrLen nCnt = rInf.GetText().getLength(); +-- +1.8.4.2 + diff --git a/SOURCES/0050-CID-736170-CID-736171-CID-736172-Out-of-Bounds-read-.patch b/SOURCES/0050-CID-736170-CID-736171-CID-736172-Out-of-Bounds-read-.patch new file mode 100644 index 0000000..796301c --- /dev/null +++ b/SOURCES/0050-CID-736170-CID-736171-CID-736172-Out-of-Bounds-read-.patch @@ -0,0 +1,52 @@ +From 74f181d285425bf7ec2ec8a18ad9f2e075f52594 Mon Sep 17 00:00:00 2001 +From: Julien Nabet +Date: Sat, 7 Dec 2013 19:05:47 +0100 +Subject: [PATCH 050/109] CID#736170, CID#736171, CID#736172 Out-of-Bounds + read/write +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Let's be sure that nMaxcolorIndex < 256 + +Change-Id: I349184ad92c8e7b10a90a32e093972bfaee52467 +Reviewed-on: https://gerrit.libreoffice.org/6970 +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +Reviewed-on: https://gerrit.libreoffice.org/6972 +--- + filter/source/graphicfilter/icgm/class5.cxx | 15 +++++++-------- + 1 file changed, 7 insertions(+), 8 deletions(-) + +diff --git a/filter/source/graphicfilter/icgm/class5.cxx b/filter/source/graphicfilter/icgm/class5.cxx +index c0319b7..eb53788 100644 +--- a/filter/source/graphicfilter/icgm/class5.cxx ++++ b/filter/source/graphicfilter/icgm/class5.cxx +@@ -316,17 +316,16 @@ void CGM::ImplDoClass5() + if ( nMaxColorIndex > 255 ) + { + mbStatus = sal_False; ++ break; + } +- else +- { +- if ( pElement->nLatestColorMaximumIndex < nMaxColorIndex ) +- pElement->nLatestColorMaximumIndex = nMaxColorIndex; ++ if ( pElement->nLatestColorMaximumIndex < nMaxColorIndex ) ++ pElement->nLatestColorMaximumIndex = nMaxColorIndex; + +- for ( nIndex = nColorStartIndex; nIndex <= nMaxColorIndex; nIndex++ ) +- { +- pElement->aLatestColorTable[ nIndex ] = ImplGetBitmapColor( sal_True ); +- } ++ for ( nIndex = nColorStartIndex; nIndex <= nMaxColorIndex; nIndex++ ) ++ { ++ pElement->aLatestColorTable[ nIndex ] = ImplGetBitmapColor( sal_True ); + } ++ + pElement->nColorMaximumIndex = pElement->nLatestColorMaximumIndex; + for ( nIndex = nColorStartIndex; nIndex <= nMaxColorIndex; nIndex++ ) + { +-- +1.8.4.2 + diff --git a/SOURCES/0056-sax-xmloff-fix-ODF-import-export-of-text-time-text-t.patch b/SOURCES/0056-sax-xmloff-fix-ODF-import-export-of-text-time-text-t.patch new file mode 100644 index 0000000..7da9554 --- /dev/null +++ b/SOURCES/0056-sax-xmloff-fix-ODF-import-export-of-text-time-text-t.patch @@ -0,0 +1,670 @@ +From 4ac4c151af9f743203728792f9840c4bafbb9390 Mon Sep 17 00:00:00 2001 +From: Michael Stahl +Date: Tue, 10 Dec 2013 15:14:00 +0100 +Subject: [PATCH 056/109] sax, xmloff: fix ODF import/export of + text:time/text:time-value + +The value written for an Impress time field is something like +text:time-value="0000-00-00T23:28:07" (in LO 3.5+) or +text:time-value="0-00-00T23:28:07" (in OOo 3.3) which contains an +invalid all-zero date. Such values are actually rejected by the +ODF import since commit ae3e2f170045a1525f67e9f3e9b7e03d94f2b56b. + +Actually there was no real support to read the RelaxNG type +timeOrDateTime before. + +So fix that by: +- adding convertTimeOrDateTime/parseTimeOrDateTime functions to + sax::Converter +- recognizing and ignoring the 2 invalid all-zero values written by + LO 3.5 and historic OOo respectively +- writing a bare "time" in text:time-value if the DateTime struct + contains zero Date members + (Older OOo versions and AOO cannot actually read that, but everything + they _can_ read is invalid ODF...) + +(cherry picked from commit cc407e50e8a1a74f9d1ed29d444dce9bd2e9167a) + +The backport contains one change: +XMLTextFieldExport::ProcessTimeOrDateTime() still writes the invalid +value (to not add new backwards compat issues in stable branch), +so this patch only fixes the import side of things. + +Conflicts: + sax/source/tools/converter.cxx + xmloff/source/text/txtfldi.cxx + +Change-Id: I754076caee74a5163ed3f972af0f23796aa14f9f +Reviewed-on: https://gerrit.libreoffice.org/7026 +Reviewed-by: Eike Rathke +Tested-by: Eike Rathke +--- + include/sax/tools/converter.hxx | 9 ++ + sax/qa/cppunit/test_converter.cxx | 138 +++++++++++++++++++++++- + sax/source/tools/converter.cxx | 213 ++++++++++++++++++++++++++++---------- + xmloff/inc/txtflde.hxx | 6 ++ + xmloff/source/text/txtflde.cxx | 24 ++++- + xmloff/source/text/txtfldi.cxx | 4 +- + 6 files changed, 331 insertions(+), 63 deletions(-) + +diff --git a/include/sax/tools/converter.hxx b/include/sax/tools/converter.hxx +index 615308c..683fadb 100644 +--- a/include/sax/tools/converter.hxx ++++ b/include/sax/tools/converter.hxx +@@ -160,10 +160,19 @@ public: + const com::sun::star::util::DateTime& rDateTime, + bool bAddTimeIf0AM = false ); + ++ /** convert util::DateTime to ISO "time" or "dateTime" string */ ++ static void convertTimeOrDateTime(OUStringBuffer& rBuffer, ++ const com::sun::star::util::DateTime& rDateTime, ++ sal_Int16 const* pTimeZoneOffset); ++ + /** convert ISO "date" or "dateTime" string to util::DateTime */ + static bool convertDateTime( com::sun::star::util::DateTime& rDateTime, + const OUString& rString ); + ++ /** convert ISO "time" or "dateTime" string to util::DateTime */ ++ static bool parseTimeOrDateTime(com::sun::star::util::DateTime& rDateTime, ++ const OUString& rString); ++ + /** convert ISO "date" or "dateTime" string to util::DateTime or + util::Date */ + static bool convertDateOrDateTime( +diff --git a/sax/qa/cppunit/test_converter.cxx b/sax/qa/cppunit/test_converter.cxx +index cfda248..f4b0c12 100644 +--- a/sax/qa/cppunit/test_converter.cxx ++++ b/sax/qa/cppunit/test_converter.cxx +@@ -53,6 +53,7 @@ public: + + void testDuration(); + void testDateTime(); ++ void testTime(); + void testDouble(); + void testMeasure(); + void testBool(); +@@ -64,6 +65,7 @@ public: + CPPUNIT_TEST_SUITE(ConverterTest); + CPPUNIT_TEST(testDuration); + CPPUNIT_TEST(testDateTime); ++ CPPUNIT_TEST(testTime); + CPPUNIT_TEST(testDouble); + CPPUNIT_TEST(testMeasure); + CPPUNIT_TEST(testBool); +@@ -240,7 +242,7 @@ void ConverterTest::testDateTime() + doTestDateTimeF( "0001-13-01T00:00:00" ); // invalid: M > 12 + doTestDateTimeF( "0001-01-32T00:00:00" ); // invalid: D > 31 + doTestDateTimeF( "0001-01-01T25:00:00" ); // invalid: H > 24 +- doTestDateTimeF( "0001-01-01T00:60:00" ); // invalid: H > 59 ++ doTestDateTimeF( "0001-01-01T00:60:00" ); // invalid: M > 59 + doTestDateTimeF( "0001-01-01T00:00:60" ); // invalid: S > 59 + doTestDateTimeF( "0001-01-01T24:01:00" ); // invalid: H=24, but M != 0 + doTestDateTimeF( "0001-01-01T24:00:01" ); // invalid: H=24, but S != 0 +@@ -251,9 +253,143 @@ void ConverterTest::testDateTime() + doTestDateTimeF( "0001-01-02T00:00:00-14:01" ); // invalid: TZ < -14:00 + doTestDateTimeF( "2100-02-29T00:00:00-00:00" ); // invalid: no leap year + doTestDateTimeF( "1900-02-29T00:00:00-00:00" ); // invalid: no leap year ++ doTestDateTimeF( "00:00:00" ); // invalid: no date ++ doTestDateTimeF( "T00:00:00" ); // invalid: no date + SAL_INFO("sax.cppunit","\nSAX CONVERTER TEST END"); + } + ++static void doTestTime(util::DateTime const & rdt, char const*const pis, ++ char const*const i_pos = 0) ++{ ++ char const*const pos((i_pos) ? i_pos : pis); ++ OUString is(OUString::createFromAscii(pis)); ++ util::DateTime odt; ++ SAL_INFO("sax.cppunit","about to convert '" << is << "'"); ++ bool bSuccess( Converter::parseTimeOrDateTime(odt, is) ); ++ SAL_INFO("sax.cppunit","Y:" << odt.Year << " M:" << odt.Month << " D:" << odt.Day << " H:" << odt.Hours << " M:" << odt.Minutes << " S:" << odt.Seconds << " nS:" << odt.NanoSeconds << " UTC: " << (bool)odt.IsUTC); ++ CPPUNIT_ASSERT(bSuccess); ++ CPPUNIT_ASSERT(eqDateTime(rdt, odt)); ++ OUStringBuffer buf; ++ Converter::convertTimeOrDateTime(buf, odt, 0); ++ SAL_INFO("sax.cppunit","" << buf.toString()); ++ CPPUNIT_ASSERT_EQUAL(OUString::createFromAscii(pos), ++ buf.makeStringAndClear()); ++} ++ ++static void doTestTimeF(char const*const pis) ++{ ++ util::DateTime odt; ++ bool bSuccess = Converter::parseTimeOrDateTime(odt, ++ OUString::createFromAscii(pis)); ++ SAL_INFO("sax.cppunit","Y:" << odt.Year << " M:" << odt.Month << " D:" << odt.Day << " H:" << odt.Hours << "H M:" << odt.Minutes << " S:" << odt.Seconds << " nS:" << odt.NanoSeconds); ++ CPPUNIT_ASSERT(!bSuccess); ++} ++ ++void ConverterTest::testTime() // time or dateTime + horrible backcompat mess ++{ ++ doTestTime( util::DateTime(0, 0, 0, 0, 1, 1, 1, false), ++ "0001-01-01T00:00:00" ); ++ doTestTime( util::DateTime(0, 0, 0, 0, 1, 1, 1, false), ++ "0001-01-01T00:00:00" ); ++ doTestTime( util::DateTime(0, 0, 0, 0, 1, 1, 1, true), ++ "0001-01-01T00:00:00Z" ); ++ doTestTime( util::DateTime(0, 0, 0, 0, 1, 1, -1, false), ++ "-0001-01-01T00:00:00"); ++ doTestTime( util::DateTime(0, 0, 0, 0, 1, 1, -1, true), ++ "-0001-01-01T01:00:00+01:00", "-0001-01-01T00:00:00Z"); ++ doTestTime( util::DateTime(0, 0, 0, 0, 1, 1, -324, false), ++ "-0324-01-01T00:00:00" ); ++ doTestTime( util::DateTime(0, 0, 0, 0, 1, 1, 1, true), ++ "0001-01-01T00:00:00-00:00", "0001-01-01T00:00:00Z" ); ++ doTestTime( util::DateTime(0, 0, 0, 0, 1, 1, 1, true), ++ "0001-01-01T00:00:00+00:00", "0001-01-01T00:00:00Z" ); ++ doTestTime( util::DateTime(0, 0, 0, 12, 2, 1, 1, true), ++ "0001-01-02T00:00:00-12:00", "0001-01-02T12:00:00Z" ); ++ doTestTime( util::DateTime(0, 0, 0, 12, 1, 1, 1, true), ++ "0001-01-02T00:00:00+12:00", "0001-01-01T12:00:00Z" ); ++ doTestTime( util::DateTime(990000000, 59, 59, 23, 31, 12, 9999, false), ++ "9999-12-31T23:59:59.99", "9999-12-31T23:59:59.990000000" ); ++ doTestTime( util::DateTime(990000000, 59, 59, 23, 31, 12, 9999, true), ++ "9999-12-31T23:59:59.99Z", "9999-12-31T23:59:59.990000000Z" ); ++ doTestTime( util::DateTime(999999999, 59, 59, 23, 31, 12, 9999, false), ++ "9999-12-31T23:59:59.9999999999999999999999999999999999999", ++ "9999-12-31T23:59:59.999999999" ); ++ doTestTime( util::DateTime(999999999, 59, 59, 23, 31, 12, 9999, true), ++ "9999-12-31T23:59:59.9999999999999999999999999999999999999Z", ++ "9999-12-31T23:59:59.999999999Z" ); ++ doTestTime( util::DateTime(0, 0, 0, 0, 29, 2, 2000, true), // leap year ++ "2000-02-29T00:00:00-00:00", "2000-02-29T00:00:00Z" ); ++ doTestTime( util::DateTime(0, 0, 0, 0, 29, 2, 1600, true), // leap year ++ "1600-02-29T00:00:00-00:00", "1600-02-29T00:00:00Z" ); ++ doTestTime( util::DateTime(0, 0, 0, 24, 1, 1, 333, false) ++ /*(0, 0, 0, 0, 2, 1, 333)*/, ++ "0333-01-01T24:00:00"/*, "0333-01-02T00:00:00"*/ ); ++ // While W3C XMLSchema specifies a minimum of 4 year digits we are lenient ++ // in what we accept. ++ doTestTime( util::DateTime(0, 0, 0, 0, 1, 1, 1, false), ++ "1-01-01T00:00:00", "0001-01-01T00:00:00" ); ++ ++ doTestTime( util::DateTime(0, 0, 0, 0, 0, 0, 0, false), "00:00:00" ); ++ doTestTime( util::DateTime(0, 0, 0, 24, 0, 0, 0, false), "24:00:00" ); ++ doTestTime( util::DateTime(0, 0, 59, 0, 0, 0, 0, false), "00:59:00" ); ++ doTestTime( util::DateTime(0, 1, 2, 4, 0, 0, 0, true), "04:02:01Z" ); ++ doTestTime( util::DateTime(0, 1, 2, 4, 0, 0, 0, true), ++ "05:02:01+01:00", "04:02:01Z" ); ++ doTestTime( util::DateTime(0, 11, 12, 9, 0, 0, 0, true), ++ "05:12:11-04:00", "09:12:11Z" ); ++ doTestTime( util::DateTime(990000000, 59, 59, 23, 0, 0, 0, false), ++ "23:59:59.99", "23:59:59.990000000" ); ++ doTestTime( util::DateTime(990000000, 59, 59, 23, 0, 0, 0, true), ++ "23:59:59.99Z", "23:59:59.990000000Z" ); ++ // backwards compatible: recognize invalid 0000-00-00 date (LO 3.5) ++ doTestTime( util::DateTime(0, 1, 0, 0, 0, 0, 0, false), ++ "0000-00-00T00:00:01", "00:00:01" ); ++ // backwards compatible: recognize invalid 0-00-00 date (OOo) ++ doTestTime( util::DateTime(0, 0, 1, 0, 0, 0, 0, false), ++ "0-00-00T00:01:00", "00:01:00" ); ++ ++ doTestTimeF( "+0001-01-01T00:00:00" ); // invalid: ^+ ++ doTestTimeF( "0001-1-01T00:00:00" ); // invalid: < 2 M ++ doTestTimeF( "0001-01-1T00:00:00" ); // invalid: < 2 D ++ doTestTimeF( "0001-01-01T0:00:00" ); // invalid: < 2 H ++ doTestTimeF( "0001-01-01T00:0:00" ); // invalid: < 2 M ++ doTestTimeF( "0001-01-01T00:00:0" ); // invalid: < 2 S ++ doTestTimeF( "0001-01-01T00:00:00." ); // invalid: .$ ++ doTestTimeF( "0001-01-01T00:00:00+1:00" ); // invalid: < 2 TZ H ++ doTestTimeF( "0001-01-01T00:00:00+00:1" ); // invalid: < 2 TZ M ++ doTestTimeF( "0001-13-01T00:00:00" ); // invalid: M > 12 ++ doTestTimeF( "0001-01-32T00:00:00" ); // invalid: D > 31 ++ doTestTimeF( "0001-01-01T25:00:00" ); // invalid: H > 24 ++ doTestTimeF( "0001-01-01T00:60:00" ); // invalid: M > 59 ++ doTestTimeF( "0001-01-01T00:00:60" ); // invalid: S > 59 ++ doTestTimeF( "0001-01-01T24:01:00" ); // invalid: H=24, but M != 0 ++ doTestTimeF( "0001-01-01T24:00:01" ); // invalid: H=24, but S != 0 ++ doTestTimeF( "0001-01-01T24:00:00.1" ); // invalid: H=24, but H != 0 ++ doTestTimeF( "0001-01-02T00:00:00+15:00" ); // invalid: TZ > +14:00 ++ doTestTimeF( "0001-01-02T00:00:00+14:01" ); // invalid: TZ > +14:00 ++ doTestTimeF( "0001-01-02T00:00:00-15:00" ); // invalid: TZ < -14:00 ++ doTestTimeF( "0001-01-02T00:00:00-14:01" ); // invalid: TZ < -14:00 ++ doTestTimeF( "2100-02-29T00:00:00-00:00" ); // invalid: no leap year ++ doTestTimeF( "1900-02-29T00:00:00-00:00" ); // invalid: no leap year ++ doTestTimeF( "T00:00:00" ); // invalid: T ++ doTestTimeF( "0:00:00" ); // invalid: < 2 H ++ doTestTimeF( "00:0:00" ); // invalid: < 2 M ++ doTestTimeF( "00:00:0" ); // invalid: < 2 S ++ doTestTimeF( "00:00:00." ); // invalid: .$ ++ doTestTimeF( "00:00:00+1:00" ); // invalid: < 2 TZ H ++ doTestTimeF( "00:00:00+00:1" ); // invalid: < 2 TZ M ++ doTestTimeF( "25:00:00" ); // invalid: H > 24 ++ doTestTimeF( "00:60:00" ); // invalid: M > 59 ++ doTestTimeF( "00:00:60" ); // invalid: S > 59 ++ doTestTimeF( "24:01:00" ); // invalid: H=24, but M != 0 ++ doTestTimeF( "24:00:01" ); // invalid: H=24, but S != 0 ++ doTestTimeF( "24:00:00.1" ); // invalid: H=24, but H != 0 ++ doTestTimeF( "00:00:00+15:00" ); // invalid: TZ > +14:00 ++ doTestTimeF( "00:00:00+14:01" ); // invalid: TZ > +14:00 ++ doTestTimeF( "00:00:00-15:00" ); // invalid: TZ < -14:00 ++ doTestTimeF( "00:00:00-14:01" ); // invalid: TZ < -14:00 ++} ++ + void doTestDouble(char const*const pis, double const rd, + sal_Int16 const nSourceUnit, sal_Int16 const nTargetUnit) + { +diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx +index e99690e..bc8b0c1 100644 +--- a/sax/source/tools/converter.cxx ++++ b/sax/source/tools/converter.cxx +@@ -1231,6 +1231,69 @@ void Converter::convertDate( + convertDateTime(i_rBuffer, dt, false); + } + ++static void convertTime( ++ OUStringBuffer& i_rBuffer, ++ const com::sun::star::util::DateTime& i_rDateTime) ++{ ++ if (i_rDateTime.Hours < 10) { ++ i_rBuffer.append(sal_Unicode('0')); ++ } ++ i_rBuffer.append( static_cast(i_rDateTime.Hours) ) ++ .append(sal_Unicode(':')); ++ if (i_rDateTime.Minutes < 10) { ++ i_rBuffer.append(sal_Unicode('0')); ++ } ++ i_rBuffer.append( static_cast(i_rDateTime.Minutes) ) ++ .append(sal_Unicode(':')); ++ if (i_rDateTime.Seconds < 10) { ++ i_rBuffer.append(sal_Unicode('0')); ++ } ++ i_rBuffer.append( static_cast(i_rDateTime.Seconds) ); ++ if (i_rDateTime.NanoSeconds > 0) { ++ OSL_ENSURE(i_rDateTime.NanoSeconds < 1000000000,"NanoSeconds cannot be more than 999 999 999"); ++ i_rBuffer.append(sal_Unicode('.')); ++ std::ostringstream ostr; ++ ostr.fill('0'); ++ ostr.width(9); ++ ostr << i_rDateTime.NanoSeconds; ++ i_rBuffer.append(OUString::createFromAscii(ostr.str().c_str())); ++ } ++} ++ ++static void convertTimeZone( ++ OUStringBuffer& i_rBuffer, ++ const com::sun::star::util::DateTime& i_rDateTime, ++ sal_Int16 const* pTimeZoneOffset) ++{ ++ if (pTimeZoneOffset) ++ { ++ lcl_AppendTimezone(i_rBuffer, *pTimeZoneOffset); ++ } ++ else if (i_rDateTime.IsUTC) ++ { ++ lcl_AppendTimezone(i_rBuffer, 0); ++ } ++} ++ ++/** convert util::DateTime to ISO "time" or "dateTime" string */ ++void Converter::convertTimeOrDateTime( ++ OUStringBuffer& i_rBuffer, ++ const com::sun::star::util::DateTime& i_rDateTime, ++ sal_Int16 const* pTimeZoneOffset) ++{ ++ if (i_rDateTime.Year == 0 || ++ i_rDateTime.Month < 1 || i_rDateTime.Month > 12 || ++ i_rDateTime.Day < 1 || i_rDateTime.Day > 31) ++ { ++ convertTime(i_rBuffer, i_rDateTime); ++ convertTimeZone(i_rBuffer, i_rDateTime, pTimeZoneOffset); ++ } ++ else ++ { ++ convertDateTime(i_rBuffer, i_rDateTime, true); ++ } ++} ++ + /** convert util::DateTime to ISO "date" or "dateTime" string */ + void Converter::convertDateTime( + OUStringBuffer& i_rBuffer, +@@ -1238,10 +1301,7 @@ void Converter::convertDateTime( + bool i_bAddTimeIf0AM ) + { + const sal_Unicode dash('-'); +- const sal_Unicode col (':'); +- const sal_Unicode dot ('.'); + const sal_Unicode zero('0'); +- const sal_Unicode tee ('T'); + + sal_Int32 const nYear(abs(i_rDateTime.Year)); + if (i_rDateTime.Year < 0) { +@@ -1271,42 +1331,11 @@ void Converter::convertDateTime( + i_rDateTime.Hours != 0 || + i_bAddTimeIf0AM ) + { +- i_rBuffer.append(tee); +- if( i_rDateTime.Hours < 10 ) { +- i_rBuffer.append(zero); +- } +- i_rBuffer.append( static_cast(i_rDateTime.Hours) ) +- .append(col); +- if( i_rDateTime.Minutes < 10 ) { +- i_rBuffer.append(zero); +- } +- i_rBuffer.append( static_cast(i_rDateTime.Minutes) ) +- .append(col); +- if( i_rDateTime.Seconds < 10 ) { +- i_rBuffer.append(zero); +- } +- i_rBuffer.append( static_cast(i_rDateTime.Seconds) ); +- if( i_rDateTime.NanoSeconds > 0 ) { +- OSL_ENSURE(i_rDateTime.NanoSeconds < 1000000000,"NanoSeconds cannot be more than 999 999 999"); +- i_rBuffer.append(dot); +- std::ostringstream ostr; +- ostr.fill('0'); +- ostr.width(9); +- ostr << i_rDateTime.NanoSeconds; +- i_rBuffer.append(OUString::createFromAscii(ostr.str().c_str())); +- } ++ i_rBuffer.append(sal_Unicode('T')); ++ convertTime(i_rBuffer, i_rDateTime); + } + +- sal_uInt16 * pTimezone(0); // FIXME pass this as parameter +- if (pTimezone) +- { +- lcl_AppendTimezone(i_rBuffer, *pTimezone); +- } +- else if (i_rDateTime.IsUTC) +- { +- // append local time +- lcl_AppendTimezone(i_rBuffer, 0); +- } ++ convertTimeZone(i_rBuffer, i_rDateTime, 0); + } + + /** convert ISO "date" or "dateTime" string to util::DateTime */ +@@ -1379,11 +1408,17 @@ static void lcl_ConvertToUTC( + { + return; + } ++ sal_Int16 nDayAdd(0); + while (24 <= o_rHours) + { + o_rHours -= 24; +- ++o_rDay; ++ ++nDayAdd; + } ++ if (o_rDay == 0) ++ { ++ return; // handle time without date - don't adjust what isn't there ++ } ++ o_rDay += nDayAdd; + sal_Int16 const nDaysInMonth(lcl_MaxDaysPerMonth(o_rMonth, o_rYear)); + if (o_rDay <= nDaysInMonth) + { +@@ -1414,6 +1449,10 @@ static void lcl_ConvertToUTC( + ++nDaySubtract; + } + o_rHours -= nOffsetHours; ++ if (o_rDay == 0) ++ { ++ return; // handle time without date - don't adjust what isn't there ++ } + if (nDaySubtract < o_rDay) + { + o_rDay -= nDaySubtract; +@@ -1453,18 +1492,17 @@ readDateTimeComponent(const OUString & rString, + return true; + } + +- +- + /** convert ISO "date" or "dateTime" string to util::DateTime or util::Date */ +-bool Converter::convertDateOrDateTime( +- util::Date & rDate, util::DateTime & rDateTime, +- bool & rbDateTime, const OUString & rString ) ++static bool lcl_parseDate( ++ bool & isNegative, ++ sal_Int32 & nYear, sal_Int32 & nMonth, sal_Int32 & nDay, ++ bool & bHaveTime, ++ sal_Int32 & nPos, ++ const OUString & string, ++ bool const bIgnoreInvalidOrMissingDate) + { + bool bSuccess = true; +- bool isNegative(false); + +- const OUString string = rString.trim().toAsciiUpperCase(); +- sal_Int32 nPos(0); + if (string.getLength() > nPos) + { + if (sal_Unicode('-') == string[nPos]) +@@ -1474,13 +1512,15 @@ bool Converter::convertDateOrDateTime( + } + } + +- sal_Int32 nYear(0); + { + // While W3C XMLSchema specifies years with a minimum of 4 digits, be + // leninent in what we accept for years < 1000. One digit is acceptable + // if the remainders match. + bSuccess = readDateTimeComponent(string, nPos, nYear, 1, false); +- bSuccess &= (0 < nYear); ++ if (!bIgnoreInvalidOrMissingDate) ++ { ++ bSuccess &= (0 < nYear); ++ } + bSuccess &= (nPos < string.getLength()); // not last token + } + if (bSuccess && (sal_Unicode('-') != string[nPos])) // separator +@@ -1492,11 +1532,14 @@ bool Converter::convertDateOrDateTime( + ++nPos; + } + +- sal_Int32 nMonth(0); + if (bSuccess) + { + bSuccess = readDateTimeComponent(string, nPos, nMonth, 2, true); +- bSuccess &= (0 < nMonth) && (nMonth <= 12); ++ if (!bIgnoreInvalidOrMissingDate) ++ { ++ bSuccess &= (0 < nMonth); ++ } ++ bSuccess &= (nMonth <= 12); + bSuccess &= (nPos < string.getLength()); // not last token + } + if (bSuccess && (sal_Unicode('-') != string[nPos])) // separator +@@ -1508,14 +1551,16 @@ bool Converter::convertDateOrDateTime( + ++nPos; + } + +- sal_Int32 nDay(0); + if (bSuccess) + { + bSuccess = readDateTimeComponent(string, nPos, nDay, 2, true); +- bSuccess &= (0 < nDay) && (nDay <= lcl_MaxDaysPerMonth(nMonth, nYear)); ++ if (!bIgnoreInvalidOrMissingDate) ++ { ++ bSuccess &= (0 < nDay); ++ } ++ bSuccess &= (nDay <= lcl_MaxDaysPerMonth(nMonth, nYear)); + } + +- bool bHaveTime(false); + if (bSuccess && (nPos < string.getLength())) + { + if (sal_Unicode('T') == string[nPos]) // time separator +@@ -1525,6 +1570,40 @@ bool Converter::convertDateOrDateTime( + } + } + ++ return bSuccess; ++} ++ ++/** convert ISO "date" or "dateTime" string to util::DateTime or util::Date */ ++static bool lcl_parseDateTime( ++ util::Date *const pDate, util::DateTime & rDateTime, ++ bool & rbDateTime, ++ const OUString & rString, ++ bool const bIgnoreInvalidOrMissingDate) ++{ ++ bool bSuccess = true; ++ ++ const OUString string = rString.trim().toAsciiUpperCase(); ++ ++ bool isNegative(false); ++ sal_Int32 nYear(0); ++ sal_Int32 nMonth(0); ++ sal_Int32 nDay(0); ++ sal_Int32 nPos(0); ++ bool bHaveTime(false); ++ ++ if ( !bIgnoreInvalidOrMissingDate ++ || string.indexOf(':') == -1 // no time? ++ || (string.indexOf('-') != -1 ++ && string.indexOf('-') < string.indexOf(':'))) ++ { ++ bSuccess &= lcl_parseDate(isNegative, nYear, nMonth, nDay, ++ bHaveTime, nPos, string, bIgnoreInvalidOrMissingDate); ++ } ++ else ++ { ++ bHaveTime = true; ++ } ++ + sal_Int32 nHours(0); + sal_Int32 nMinutes(0); + sal_Int32 nSeconds(0); +@@ -1658,7 +1737,7 @@ bool Converter::convertDateOrDateTime( + sal_uInt16 * pTimezone(0); // FIXME pass this as parameter + sal_Int16 const nTimezoneOffset = ((bHaveTimezoneMinus) ? (-1) : (+1)) + * ((nTimezoneHours * 60) + nTimezoneMinutes); +- if (bHaveTime) // time is optional ++ if (!pDate || bHaveTime) // time is optional + { + rDateTime.Year = + ((isNegative) ? (-1) : (+1)) * static_cast(nYear); +@@ -1691,10 +1770,10 @@ bool Converter::convertDateOrDateTime( + } + else + { +- rDate.Year = ++ pDate->Year = + ((isNegative) ? (-1) : (+1)) * static_cast(nYear); +- rDate.Month = static_cast(nMonth); +- rDate.Day = static_cast(nDay); ++ pDate->Month = static_cast(nMonth); ++ pDate->Day = static_cast(nDay); + if (bHaveTimezone) + { + if (pTimezone) +@@ -1713,6 +1792,26 @@ bool Converter::convertDateOrDateTime( + return bSuccess; + } + ++/** convert ISO "time" or "dateTime" string to util::DateTime */ ++bool Converter::parseTimeOrDateTime( ++ util::DateTime & rDateTime, ++ const OUString & rString) ++{ ++ bool dummy; ++ return lcl_parseDateTime( ++ 0, rDateTime, dummy, rString, true); ++} ++ ++/** convert ISO "date" or "dateTime" string to util::DateTime or util::Date */ ++bool Converter::convertDateOrDateTime( ++ util::Date & rDate, util::DateTime & rDateTime, ++ bool & rbDateTime, ++ const OUString & rString ) ++{ ++ return lcl_parseDateTime( ++ &rDate, rDateTime, rbDateTime, rString, false); ++} ++ + + /** gets the position of the first comma after npos in the string + rStr. Commas inside '"' pairs are not matched */ +diff --git a/xmloff/inc/txtflde.hxx b/xmloff/inc/txtflde.hxx +index 30e607b..53b84cf 100644 +--- a/xmloff/inc/txtflde.hxx ++++ b/xmloff/inc/txtflde.hxx +@@ -366,6 +366,12 @@ protected: + sal_Bool bIsDate, /// export as date (rather than date/time)? + sal_uInt16 nPrefix = XML_NAMESPACE_TEXT); /// attribute name prefix + ++ /// export time or dateTime ++ void ProcessTimeOrDateTime( ++ enum ::xmloff::token::XMLTokenEnum eXMLName, /// attribute token ++ const ::com::sun::star::util::DateTime& rTime, /// date/time value ++ sal_uInt16 nPrefix = XML_NAMESPACE_TEXT); /// attribute name prefix ++ + /// export all attributes for bibliography data fields + void ProcessBibliographyData( + const ::com::sun::star::uno::Reference < +diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx +index 7e013db..0ad8fcb 100644 +--- a/xmloff/source/text/txtflde.cxx ++++ b/xmloff/source/text/txtflde.cxx +@@ -1261,17 +1261,17 @@ void XMLTextFieldExport::ExportFieldHelper( + if (xPropSetInfo->hasPropertyByName(sPropertyDateTimeValue)) + { + // no value -> current time +- ProcessDateTime(XML_TIME_VALUE, ++ ProcessTimeOrDateTime(XML_TIME_VALUE, + GetDateTimeProperty(sPropertyDateTimeValue, + rPropSet), +- sal_False ); ++ XML_NAMESPACE_TEXT); + } + if (xPropSetInfo->hasPropertyByName(sPropertyDateTime)) + { + // no value -> current time +- ProcessDateTime(XML_TIME_VALUE, ++ ProcessTimeOrDateTime(XML_TIME_VALUE, + GetDateTimeProperty(sPropertyDateTime,rPropSet), +- sal_False ); ++ XML_NAMESPACE_TEXT); + } + if (xPropSetInfo->hasPropertyByName(sPropertyIsFixed)) + { +@@ -2674,6 +2674,22 @@ void XMLTextFieldExport::ProcessDateTime(enum XMLTokenEnum eName, + } + } + ++/// export a time or dateTime ++void XMLTextFieldExport::ProcessTimeOrDateTime(enum XMLTokenEnum eName, ++ const util::DateTime& rTime, ++ sal_uInt16 nPrefix) ++{ ++ OUStringBuffer aBuffer; ++ ++ // date/time value ++// ::sax::Converter::convertTimeOrDateTime(aBuffer, rTime, 0); ++// NOTE: for 4.1 continue writing the invalid value that old versions can read ++ ::sax::Converter::convertDateTime(aBuffer, rTime); ++ ++ // output attribute ++ ProcessString(eName, aBuffer.makeStringAndClear(), sal_True, nPrefix); ++} ++ + + SvXMLEnumMapEntry const aBibliographyDataTypeMap[] = + { +diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx +index cf6bc10..875677c 100644 +--- a/xmloff/source/text/txtfldi.cxx ++++ b/xmloff/source/text/txtfldi.cxx +@@ -1106,6 +1106,7 @@ void XMLTimeFieldImportContext::ProcessAttribute( + { + case XML_TOK_TEXTFIELD_TIME_VALUE: + { ++ // FIXME double appears unused? + double fTmp; + if (GetImport().GetMM100UnitConverter(). + convertDateTime(fTmp, sAttrValue)) +@@ -1114,7 +1115,8 @@ void XMLTimeFieldImportContext::ProcessAttribute( + bTimeOK = sal_True; + } + +- if (::sax::Converter::convertDateTime(aDateTimeValue, sAttrValue)) ++ if (::sax::Converter::parseTimeOrDateTime(aDateTimeValue, ++ sAttrValue)) + { + bTimeOK = sal_True; + } +-- +1.8.4.2 + diff --git a/SOURCES/0057-fdo-66969-Set-selected-page-name-after-building-all-.patch b/SOURCES/0057-fdo-66969-Set-selected-page-name-after-building-all-.patch new file mode 100644 index 0000000..7474e6b --- /dev/null +++ b/SOURCES/0057-fdo-66969-Set-selected-page-name-after-building-all-.patch @@ -0,0 +1,121 @@ +From 5618ac8ccddbff67b4b27a9c08f97d3bf2bcec3f Mon Sep 17 00:00:00 2001 +From: Kohei Yoshida +Date: Tue, 10 Dec 2013 12:50:48 -0500 +Subject: [PATCH 057/109] fdo#66969: Set selected page name after building all + dimension members. + +Because the new implementation relies on the visiblity flag of the +dimension members, they need to exist before setting currently selected +page, which is still used in documents generated by the older version of +LibreOffice. + +Change-Id: I6cec5fd3d2165f714fc01b596d3761890d87a4ff +(cherry picked from commit 2e1b90a4272defb917b23e2e360e171114d6fa4d) +Reviewed-on: https://gerrit.libreoffice.org/7027 +Reviewed-by: Eike Rathke +Tested-by: Eike Rathke +--- + sc/source/filter/xml/xmldpimp.cxx | 33 ++++++++++++++++++++++++++++++++- + sc/source/filter/xml/xmldpimp.hxx | 7 +++++++ + 2 files changed, 39 insertions(+), 1 deletion(-) + +diff --git a/sc/source/filter/xml/xmldpimp.cxx b/sc/source/filter/xml/xmldpimp.cxx +index 83f58f7..825060c 100644 +--- a/sc/source/filter/xml/xmldpimp.cxx ++++ b/sc/source/filter/xml/xmldpimp.cxx +@@ -412,6 +412,11 @@ void ScXMLDataPilotTableContext::SetButtons() + pDPObject->RefreshAfterLoad(); + } + ++void ScXMLDataPilotTableContext::SetSelectedPage( const OUString& rDimName, const OUString& rSelected ) ++{ ++ maSelectedPages.insert(SelectedPagesType::value_type(rDimName, rSelected)); ++} ++ + void ScXMLDataPilotTableContext::AddDimension(ScDPSaveDimension* pDim) + { + if (pDPSave) +@@ -548,10 +553,36 @@ void ScXMLDataPilotTableContext::EndElement() + if ( pDPCollection->GetByName(pDPObject->GetName()) ) + pDPObject->SetName( String() ); // ignore the invalid name, create a new name in AfterXMLLoading + ++ ProcessSelectedPages(); ++ + pDPCollection->InsertNewTable(pDPObject); + SetButtons(); + } + ++void ScXMLDataPilotTableContext::ProcessSelectedPages() ++{ ++ // Set selected pages after building all dimension members. ++ if (!pDPObject) ++ return; ++ ++ pDPObject->BuildAllDimensionMembers(); ++ ScDPSaveData* pSaveData = pDPObject->GetSaveData(); ++ if (!pSaveData) ++ return; ++ ++ SelectedPagesType::const_iterator it = maSelectedPages.begin(), itEnd = maSelectedPages.end(); ++ for (; it != itEnd; ++it) ++ { ++ const OUString& rDimName = it->first; ++ const OUString& rSelected = it->second; ++ ScDPSaveDimension* pDim = pSaveData->GetExistingDimensionByName(rDimName); ++ if (!pDim) ++ continue; ++ ++ pDim->SetCurrentPage(&rSelected); ++ } ++} ++ + void ScXMLDataPilotTableContext::SetGrandTotal( + XMLTokenEnum eOrientation, bool bVisible, const OUString& rDisplayName) + { +@@ -1111,7 +1142,7 @@ void ScXMLDataPilotFieldContext::EndElement() + pDim->SetOrientation(nOrientation); + if (bSelectedPage) + { +- pDim->SetCurrentPage(&sSelectedPage); ++ pDataPilotTable->SetSelectedPage(pDim->GetName(), sSelectedPage); + } + pDataPilotTable->AddDimension(pDim); + if (bIsGroupField) +diff --git a/sc/source/filter/xml/xmldpimp.hxx b/sc/source/filter/xml/xmldpimp.hxx +index 1aa851d..32f878d 100644 +--- a/sc/source/filter/xml/xmldpimp.hxx ++++ b/sc/source/filter/xml/xmldpimp.hxx +@@ -71,6 +71,8 @@ public: + + class ScXMLDataPilotTableContext : public SvXMLImportContext + { ++ typedef boost::unordered_map SelectedPagesType; ++ + struct GrandTotalItem + { + OUString maDisplayName; +@@ -114,9 +116,13 @@ class ScXMLDataPilotTableContext : public SvXMLImportContext + bool bDrillDown:1; + bool bHeaderGridLayout:1; + ++ SelectedPagesType maSelectedPages; ++ + const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); } + ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); } + ++ void ProcessSelectedPages(); ++ + public: + + ScXMLDataPilotTableContext( ScXMLImport& rImport, sal_uInt16 nPrfx, +@@ -151,6 +157,7 @@ public: + void AddGroupDim(const ScDPSaveNumGroupDimension& aNumGroupDim); + void AddGroupDim(const ScDPSaveGroupDimension& aGroupDim); + void SetButtons(); ++ void SetSelectedPage( const OUString& rDimName, const OUString& rSelected ); + }; + + class ScXMLDPSourceSQLContext : public SvXMLImportContext +-- +1.8.4.2 + diff --git a/SOURCES/0058-fdo-66969-Reset-group-dimension-data-from-all-refere.patch b/SOURCES/0058-fdo-66969-Reset-group-dimension-data-from-all-refere.patch new file mode 100644 index 0000000..b4e2cfb --- /dev/null +++ b/SOURCES/0058-fdo-66969-Reset-group-dimension-data-from-all-refere.patch @@ -0,0 +1,208 @@ +From b8339a06050fcbff25e3c990e1ff8ca02dc7bad5 Mon Sep 17 00:00:00 2001 +From: Kohei Yoshida +Date: Tue, 10 Dec 2013 15:56:06 -0500 +Subject: [PATCH 058/109] fdo#66969: Reset group dimension data from all + referencing pivot objects. + +The previous code was doing it only with the first referencing pivot table, +which would break the rest of them sharing the same cache if +the first one doesn't contain all group dimensions used in all of the +referencing pivot tables. + +Change-Id: I35d6907ef8db7ed69db42583cac92b2b74406e2c +(cherry picked from commit b3977983e9f662392426f581516d86d7034ad0fd) +Reviewed-on: https://gerrit.libreoffice.org/7028 +Reviewed-by: Eike Rathke +Tested-by: Eike Rathke +--- + sc/inc/dpobject.hxx | 10 +++---- + sc/source/core/data/dpobject.cxx | 57 ++++++++++++++++++++++++++-------------- + 2 files changed, 42 insertions(+), 25 deletions(-) + +diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx +index 06d4957..51d4790 100644 +--- a/sc/inc/dpobject.hxx ++++ b/sc/inc/dpobject.hxx +@@ -290,7 +290,7 @@ public: + private: + ScDPCache* getExistingCache(const ScRange& rRange); + +- void updateCache(const ScRange& rRange, const ScDPDimensionSaveData* pDimData, std::set& rRefs); ++ void updateCache(const ScRange& rRange, std::set& rRefs); + bool remove(const ScDPCache* p); + }; + +@@ -313,8 +313,7 @@ public: + ScDPCache* getExistingCache(const OUString& rName); + + void updateCache( +- const OUString& rName, const ScRange& rRange, +- const ScDPDimensionSaveData* pDimData, std::set& rRefs); ++ const OUString& rName, const ScRange& rRange, std::set& rRefs); + bool remove(const ScDPCache* p); + }; + +@@ -358,8 +357,9 @@ public: + com::sun::star::uno::Reference createRowSet( + sal_Int32 nSdbType, const OUString& rDBName, const OUString& rCommand); + +- void updateCache(sal_Int32 nSdbType, const OUString& rDBName, const OUString& rCommand, +- const ScDPDimensionSaveData* pDimData, std::set& rRefs); ++ void updateCache( ++ sal_Int32 nSdbType, const OUString& rDBName, const OUString& rCommand, ++ std::set& rRefs); + bool remove(const ScDPCache* p); + }; + +diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx +index 169231a..653bc0c 100644 +--- a/sc/source/core/data/dpobject.cxx ++++ b/sc/source/core/data/dpobject.cxx +@@ -2809,6 +2809,25 @@ struct FindInvalidRange : public std::unary_function + } + }; + ++void setGroupItemsToCache( ScDPCache& rCache, const std::set& rRefs ) ++{ ++ // Go through all referencing pivot tables, and re-fill the group dimension info. ++ std::set::const_iterator itRef = rRefs.begin(), itRefEnd = rRefs.end(); ++ for (; itRef != itRefEnd; ++itRef) ++ { ++ const ScDPObject* pObj = *itRef; ++ const ScDPSaveData* pSave = pObj->GetSaveData(); ++ if (!pSave) ++ continue; ++ ++ const ScDPDimensionSaveData* pGroupDims = pSave->GetExistingDimensionData(); ++ if (!pGroupDims) ++ continue; ++ ++ pGroupDims->WriteToCache(rCache); ++ } ++} ++ + } + + bool ScDPCollection::SheetCaches::hasCache(const ScRange& rRange) const +@@ -2926,8 +2945,7 @@ void ScDPCollection::SheetCaches::updateReference( + } + } + +-void ScDPCollection::SheetCaches::updateCache( +- const ScRange& rRange, const ScDPDimensionSaveData* pDimData, std::set& rRefs) ++void ScDPCollection::SheetCaches::updateCache(const ScRange& rRange, std::set& rRefs) + { + RangeIndexType::iterator it = std::find(maRanges.begin(), maRanges.end(), rRange); + if (it == maRanges.end()) +@@ -2947,12 +2965,15 @@ void ScDPCollection::SheetCaches::updateCache( + } + + ScDPCache& rCache = *itCache->second; ++ ++ // Update the cache with new cell values. This will clear all group dimension info. + rCache.InitFromDoc(mpDoc, rRange); +- if (pDimData) +- pDimData->WriteToCache(rCache); + + std::set aRefs(rCache.GetAllReferences()); + rRefs.swap(aRefs); ++ ++ // Make sure to re-populate the group dimension info. ++ setGroupItemsToCache(rCache, rRefs); + } + + bool ScDPCollection::SheetCaches::remove(const ScDPCache* p) +@@ -3010,8 +3031,7 @@ size_t ScDPCollection::NameCaches::size() const + } + + void ScDPCollection::NameCaches::updateCache( +- const OUString& rName, const ScRange& rRange, const ScDPDimensionSaveData* pDimData, +- std::set& rRefs) ++ const OUString& rName, const ScRange& rRange, std::set& rRefs) + { + CachesType::iterator itr = maCaches.find(rName); + if (itr == maCaches.end()) +@@ -3021,12 +3041,14 @@ void ScDPCollection::NameCaches::updateCache( + } + + ScDPCache& rCache = *itr->second; ++ // Update the cache with new cell values. This will clear all group dimension info. + rCache.InitFromDoc(mpDoc, rRange); +- if (pDimData) +- pDimData->WriteToCache(rCache); + + std::set aRefs(rCache.GetAllReferences()); + rRefs.swap(aRefs); ++ ++ // Make sure to re-populate the group dimension info. ++ setGroupItemsToCache(rCache, rRefs); + } + + bool ScDPCollection::NameCaches::remove(const ScDPCache* p) +@@ -3171,7 +3193,7 @@ uno::Reference ScDPCollection::DBCaches::createRowSet( + + void ScDPCollection::DBCaches::updateCache( + sal_Int32 nSdbType, const OUString& rDBName, const OUString& rCommand, +- const ScDPDimensionSaveData* pDimData, std::set& rRefs) ++ std::set& rRefs) + { + DBType aType(nSdbType, rDBName, rCommand); + CachesType::iterator it = maCaches.find(aType); +@@ -3204,12 +3226,12 @@ void ScDPCollection::DBCaches::updateCache( + return; + } + +- if (pDimData) +- pDimData->WriteToCache(rCache); +- + comphelper::disposeComponent(xRowSet); + std::set aRefs(rCache.GetAllReferences()); + aRefs.swap(rRefs); ++ ++ // Make sure to re-populate the group dimension info. ++ setGroupItemsToCache(rCache, rRefs); + } + + bool ScDPCollection::DBCaches::remove(const ScDPCache* p) +@@ -3271,11 +3293,6 @@ sal_uLong ScDPCollection::ReloadCache(ScDPObject* pDPObj, std::set& + if (!pDPObj) + return STR_ERR_DATAPILOTSOURCE; + +- const ScDPSaveData* pSaveData = pDPObj->GetSaveData(); +- const ScDPDimensionSaveData* pDimData = NULL; +- if (pSaveData) +- pDimData = pSaveData->GetExistingDimensionData(); +- + if (pDPObj->IsSheetData()) + { + // data source is internal sheet. +@@ -3292,7 +3309,7 @@ sal_uLong ScDPCollection::ReloadCache(ScDPObject* pDPObj, std::set& + // cache by named range + ScDPCollection::NameCaches& rCaches = GetNameCaches(); + if (rCaches.hasCache(pDesc->GetRangeName())) +- rCaches.updateCache(pDesc->GetRangeName(), pDesc->GetSourceRange(), pDimData, rRefs); ++ rCaches.updateCache(pDesc->GetRangeName(), pDesc->GetSourceRange(), rRefs); + else + { + // Not cached yet. Collect all tables that use this named +@@ -3305,7 +3322,7 @@ sal_uLong ScDPCollection::ReloadCache(ScDPObject* pDPObj, std::set& + // cache by cell range + ScDPCollection::SheetCaches& rCaches = GetSheetCaches(); + if (rCaches.hasCache(pDesc->GetSourceRange())) +- rCaches.updateCache(pDesc->GetSourceRange(), pDimData, rRefs); ++ rCaches.updateCache(pDesc->GetSourceRange(), rRefs); + else + { + // Not cached yet. Collect all tables that use this range as +@@ -3324,7 +3341,7 @@ sal_uLong ScDPCollection::ReloadCache(ScDPObject* pDPObj, std::set& + ScDPCollection::DBCaches& rCaches = GetDBCaches(); + if (rCaches.hasCache(pDesc->GetCommandType(), pDesc->aDBName, pDesc->aObject)) + rCaches.updateCache( +- pDesc->GetCommandType(), pDesc->aDBName, pDesc->aObject, pDimData, rRefs); ++ pDesc->GetCommandType(), pDesc->aDBName, pDesc->aObject, rRefs); + else + { + // Not cached yet. Collect all tables that use this range as +-- +1.8.4.2 + diff --git a/SOURCES/0059-fdo-68160-Revert-Resolves-ii122335-Disabling-the-old.patch b/SOURCES/0059-fdo-68160-Revert-Resolves-ii122335-Disabling-the-old.patch new file mode 100644 index 0000000..bdaec5f --- /dev/null +++ b/SOURCES/0059-fdo-68160-Revert-Resolves-ii122335-Disabling-the-old.patch @@ -0,0 +1,150 @@ +From 4c0ac90b4864d5eee401b54cdcd54e29ae4ddc53 Mon Sep 17 00:00:00 2001 +From: Eike Rathke +Date: Wed, 11 Dec 2013 23:34:55 +0100 +Subject: [PATCH 059/109] fdo#68160 Revert "Resolves: #ii122335# Disabling the + old task pane" +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +fdo#68160 Revert "Partly revert "Resolves: #ii122335# Disabling the old task pane"" + +This reverts commit cb4225144f1fff44f9bb972fe06f51524da11b8b. + +To be able to revert 95ae39c0c34c9a5e6fa6e72bf3a631a9a799b872 entirely. + +fdo#68160 Revert "Resolves: #ii122335# Disabling the old task pane" + +This reverts commit 95ae39c0c34c9a5e6fa6e72bf3a631a9a799b872. + +We need a TaskPane even in Writer and Calc to be used by extensions. +Sidebar is experimental so TaskPane is needed anyway for Impress (see +fdo#72371). + +Change-Id: Ia94ab377a59996ba434b56e3823117183674afb7 +Reviewed-on: https://gerrit.libreoffice.org/7042 +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +--- + sc/source/ui/view/tabvwsh.cxx | 1 + + sc/uiconfig/scalc/menubar/menubar.xml | 1 + + sw/source/ui/uiview/view0.cxx | 1 + + sw/uiconfig/sglobal/menubar/menubar.xml | 1 + + sw/uiconfig/sweb/menubar/menubar.xml | 1 + + sw/uiconfig/swform/menubar/menubar.xml | 1 + + sw/uiconfig/swreport/menubar/menubar.xml | 1 + + sw/uiconfig/swriter/menubar/menubar.xml | 1 + + sw/uiconfig/swxform/menubar/menubar.xml | 1 + + 9 files changed, 9 insertions(+) + +diff --git a/sc/source/ui/view/tabvwsh.cxx b/sc/source/ui/view/tabvwsh.cxx +index 7949e17..537499b 100644 +--- a/sc/source/ui/view/tabvwsh.cxx ++++ b/sc/source/ui/view/tabvwsh.cxx +@@ -54,6 +54,7 @@ SFX_IMPL_INTERFACE(ScTabViewShell,SfxViewShell,ScResId(SCSTR_TABVIEWSHELL)) + SFX_CHILDWINDOW_REGISTRATION(SfxTemplateDialogWrapper::GetChildWindowId()); + SFX_CHILDWINDOW_REGISTRATION(SfxInfoBarContainerChild::GetChildWindowId()); + SFX_CHILDWINDOW_CONTEXT_REGISTRATION(SID_NAVIGATOR); ++ SFX_CHILDWINDOW_REGISTRATION(SID_TASKPANE); + SFX_CHILDWINDOW_REGISTRATION(::sfx2::sidebar::SidebarChildWindow::GetChildWindowId()); + SFX_CHILDWINDOW_REGISTRATION(ScNameDlgWrapper::GetChildWindowId()); + SFX_CHILDWINDOW_REGISTRATION(ScNameDefDlgWrapper::GetChildWindowId()); +diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml +index 777c324..ca8d8ba 100644 +--- a/sc/uiconfig/scalc/menubar/menubar.xml ++++ b/sc/uiconfig/scalc/menubar/menubar.xml +@@ -139,6 +139,7 @@ + + + ++ + + + +diff --git a/sw/source/ui/uiview/view0.cxx b/sw/source/ui/uiview/view0.cxx +index 73555a8..e5f7b3b 100644 +--- a/sw/source/ui/uiview/view0.cxx ++++ b/sw/source/ui/uiview/view0.cxx +@@ -90,6 +90,7 @@ SFX_IMPL_NAMED_VIEWFACTORY(SwView, "Default") + SFX_IMPL_INTERFACE( SwView, SfxViewShell, SW_RES(RID_TOOLS_TOOLBOX) ) + { + SFX_CHILDWINDOW_CONTEXT_REGISTRATION(SID_NAVIGATOR); ++ SFX_CHILDWINDOW_REGISTRATION(SID_TASKPANE); + SFX_CHILDWINDOW_REGISTRATION(::sfx2::sidebar::SidebarChildWindow::GetChildWindowId()); + SFX_CHILDWINDOW_REGISTRATION(SfxTemplateDialogWrapper::GetChildWindowId()); + SFX_CHILDWINDOW_REGISTRATION(SfxInfoBarContainerChild::GetChildWindowId()); +diff --git a/sw/uiconfig/sglobal/menubar/menubar.xml b/sw/uiconfig/sglobal/menubar/menubar.xml +index 3c310f2..f79d0ec 100644 +--- a/sw/uiconfig/sglobal/menubar/menubar.xml ++++ b/sw/uiconfig/sglobal/menubar/menubar.xml +@@ -137,6 +137,7 @@ + + + ++ + + + +diff --git a/sw/uiconfig/sweb/menubar/menubar.xml b/sw/uiconfig/sweb/menubar/menubar.xml +index 30229a7..3cb3b76 100644 +--- a/sw/uiconfig/sweb/menubar/menubar.xml ++++ b/sw/uiconfig/sweb/menubar/menubar.xml +@@ -108,6 +108,7 @@ + + + ++ + + + +diff --git a/sw/uiconfig/swform/menubar/menubar.xml b/sw/uiconfig/swform/menubar/menubar.xml +index 4f22cf1..806da2d 100644 +--- a/sw/uiconfig/swform/menubar/menubar.xml ++++ b/sw/uiconfig/swform/menubar/menubar.xml +@@ -136,6 +136,7 @@ + + + ++ + + + +diff --git a/sw/uiconfig/swreport/menubar/menubar.xml b/sw/uiconfig/swreport/menubar/menubar.xml +index 39284e8..bc90989 100644 +--- a/sw/uiconfig/swreport/menubar/menubar.xml ++++ b/sw/uiconfig/swreport/menubar/menubar.xml +@@ -137,6 +137,7 @@ + + + ++ + + + +diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml +index 618e757..9506ab9 100644 +--- a/sw/uiconfig/swriter/menubar/menubar.xml ++++ b/sw/uiconfig/swriter/menubar/menubar.xml +@@ -141,6 +141,7 @@ + + + ++ + + + +diff --git a/sw/uiconfig/swxform/menubar/menubar.xml b/sw/uiconfig/swxform/menubar/menubar.xml +index e1d2c83..84b1fc3 100644 +--- a/sw/uiconfig/swxform/menubar/menubar.xml ++++ b/sw/uiconfig/swxform/menubar/menubar.xml +@@ -138,6 +138,7 @@ + + + ++ + + + +-- +1.8.4.2 + diff --git a/SOURCES/0060-fdo-66864-Return-from-full-screen-should-restore-too.patch b/SOURCES/0060-fdo-66864-Return-from-full-screen-should-restore-too.patch new file mode 100644 index 0000000..e01fb89 --- /dev/null +++ b/SOURCES/0060-fdo-66864-Return-from-full-screen-should-restore-too.patch @@ -0,0 +1,82 @@ +From 171f2ca39a08299abe54e92e8096cdaa5e02a4dc Mon Sep 17 00:00:00 2001 +From: Jan Holesovsky +Date: Fri, 15 Nov 2013 10:59:36 +0100 +Subject: [PATCH 060/109] fdo#66864: Return from full-screen should restore + toolbars. + +The fix for fdo#37758 was not correct, we shouldn't fiddle with the m_bVisible +itself, but instead react on the m_bMasterHide flag; or at least that is my +understanding of the related framework code (why is it so confusing?!) + +Change-Id: I791fcea9e5e5313b6a5b776cb3187cbd1a028386 +(cherry picked from commit 986644335c3f9e99ec3c6bebc0b75cca0acdf79b) +Reviewed-on: https://gerrit.libreoffice.org/7065 +Reviewed-by: Jan Holesovsky +Tested-by: Jan Holesovsky +--- + .../source/layoutmanager/toolbarlayoutmanager.cxx | 26 +++++++++------------- + 1 file changed, 11 insertions(+), 15 deletions(-) + +diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx +index 52a0d7b..1bb03d1 100644 +--- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx ++++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx +@@ -294,7 +294,7 @@ Rectangle ToolbarLayoutManager::implts_calcDockingArea() + SolarMutexGuard aGuard; + + Window* pWindow = VCLUnoHelper::GetWindow( xWindow ); +- if ( pWindow && !xDockWindow->isFloating() && pConstIter->m_bVisible ) ++ if ( pWindow && !xDockWindow->isFloating() && pConstIter->m_bVisible && !pConstIter->m_bMasterHide ) + { + awt::Rectangle aPosSize = xWindow->getPosSize(); + if ( pConstIter->m_aDockedData.m_nDockedArea != nCurrDockingArea ) +@@ -442,7 +442,7 @@ bool ToolbarLayoutManager::requestToolbar( const OUString& rResourceURL ) + if ( !xUIElement.is() ) + bMustCallCreate = true; + +- bool bCreateOrShowToolbar( aRequestedToolbar.m_bVisible & !aRequestedToolbar.m_bMasterHide ); ++ bool bCreateOrShowToolbar( aRequestedToolbar.m_bVisible && !aRequestedToolbar.m_bMasterHide ); + + uno::Reference< awt::XWindow2 > xContainerWindow( m_xContainerWindow, uno::UNO_QUERY ); + if ( xContainerWindow.is() && aRequestedToolbar.m_bFloating ) +@@ -681,28 +681,24 @@ void ToolbarLayoutManager::setVisible( bool bVisible ) + UIElementVector::iterator pIter; + for ( pIter = aUIElementVector.begin(); pIter != aUIElementVector.end(); ++pIter ) + { +- pIter->m_bMasterHide = !bVisible; ++ if (!pIter->m_bFloating) ++ { ++ UIElement aUIElement(*pIter); ++ aUIElement.m_bMasterHide = !bVisible; ++ implts_setToolbar(aUIElement); ++ implts_setLayoutDirty(); ++ } ++ + Window* pWindow = getWindowFromXUIElement( pIter->m_xUIElement ); + if ( pWindow ) + { +- bool bSetVisible( pIter->m_bVisible & bVisible ); ++ bool bSetVisible( pIter->m_bVisible && bVisible ); + if ( !bSetVisible ) +- { + pWindow->Hide(); +- +- UIElement aUIElement( *pIter ); +- if ( !aUIElement.m_bFloating ) +- implts_setLayoutDirty(); +- +- aUIElement.m_bVisible = false; +- implts_setToolbar( aUIElement ); +- } + else + { + if ( pIter->m_bFloating ) + pWindow->Show(true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); +- else +- implts_setLayoutDirty(); + } + } + } +-- +1.8.4.2 + diff --git a/SOURCES/0061-fdo-70499-selectn-of-lock-unlocked-cells-with-worksh.patch b/SOURCES/0061-fdo-70499-selectn-of-lock-unlocked-cells-with-worksh.patch new file mode 100644 index 0000000..7089348 --- /dev/null +++ b/SOURCES/0061-fdo-70499-selectn-of-lock-unlocked-cells-with-worksh.patch @@ -0,0 +1,123 @@ +From ed0f9df37cac6c2e8d886488b2dbbe1034e0d385 Mon Sep 17 00:00:00 2001 +From: Noel Power +Date: Thu, 21 Nov 2013 18:12:50 +0000 +Subject: [PATCH 061/109] fdo#70499 selectn of lock/unlocked cells with + worksheet protection reversed + +The ooxml spec documentation is rather confusing ( for me at least ) and the +sense of the of the sheetProtection attributes as described seems reversed to +how I read it ( or maybe it is the equivelant option in ScTableProtection that +operates with the reverse sense ) In anycase the import ( and export ) +have been adjusted to take that into consideration, also the export now actually +deals with the defaults correctly. + +Change-Id: Ia69567b8898b39c9d171486cfa800e1748c5814b +Reviewed-on: https://gerrit.libreoffice.org/7075 +Reviewed-by: Kohei Yoshida +Tested-by: Kohei Yoshida +--- + sc/qa/unit/subsequent_export-test.cxx | 4 ++-- + sc/source/filter/excel/excrecds.cxx | 30 +++++++++++++++--------------- + sc/source/filter/oox/worksheetsettings.cxx | 30 +++++++++++++++--------------- + 3 files changed, 32 insertions(+), 32 deletions(-) + +diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx +index 9a06e9a..f7b5141 100644 +--- a/sc/qa/unit/subsequent_export-test.cxx ++++ b/sc/qa/unit/subsequent_export-test.cxx +@@ -347,8 +347,8 @@ void ScExportTest::testSheetProtectionXLSX() + CPPUNIT_ASSERT( (sal_uInt8)aHash[1] == 61 ); + } + // we could flesh out this check I guess +- CPPUNIT_ASSERT ( pTabProtect->isOptionEnabled( ScTableProtection::OBJECTS ) ); +- CPPUNIT_ASSERT ( pTabProtect->isOptionEnabled( ScTableProtection::SCENARIOS ) ); ++ CPPUNIT_ASSERT ( !pTabProtect->isOptionEnabled( ScTableProtection::OBJECTS ) ); ++ CPPUNIT_ASSERT ( !pTabProtect->isOptionEnabled( ScTableProtection::SCENARIOS ) ); + } + xDocSh->DoClose(); + } +diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx +index 39e4222..4330fe0 100644 +--- a/sc/source/filter/excel/excrecds.cxx ++++ b/sc/source/filter/excel/excrecds.cxx +@@ -520,21 +520,21 @@ void XclExpSheetProtection::SaveXml( XclExpXmlStream& rStrm ) + rWorksheet->singleElement( XML_sheetProtection, + XML_sheet, XclXmlUtils::ToPsz( true ), + XML_password, sHash.getStr(), +- XML_objects, pTabProtect->isOptionEnabled( ScTableProtection::OBJECTS ) ? XclXmlUtils::ToPsz( true ) : NULL, +- XML_scenarios, pTabProtect->isOptionEnabled( ScTableProtection::SCENARIOS ) ? XclXmlUtils::ToPsz( true ) : NULL, +- XML_formatCells, pTabProtect->isOptionEnabled( ScTableProtection::FORMAT_CELLS ) ? NULL : XclXmlUtils::ToPsz( true ), +- XML_formatColumns, pTabProtect->isOptionEnabled( ScTableProtection::FORMAT_COLUMNS ) ? NULL : XclXmlUtils::ToPsz( true ), +- XML_formatRows, pTabProtect->isOptionEnabled( ScTableProtection::FORMAT_ROWS ) ? NULL : XclXmlUtils::ToPsz( true ), +- XML_insertColumns, pTabProtect->isOptionEnabled( ScTableProtection::INSERT_COLUMNS ) ? NULL : XclXmlUtils::ToPsz( true ), +- XML_insertRows, pTabProtect->isOptionEnabled( ScTableProtection::INSERT_ROWS ) ? NULL : XclXmlUtils::ToPsz( true ), +- XML_insertHyperlinks, pTabProtect->isOptionEnabled( ScTableProtection::INSERT_HYPERLINKS ) ? NULL : XclXmlUtils::ToPsz( true ), +- XML_deleteColumns, pTabProtect->isOptionEnabled( ScTableProtection::DELETE_COLUMNS ) ? NULL : XclXmlUtils::ToPsz( true ), +- XML_deleteRows, pTabProtect->isOptionEnabled( ScTableProtection::DELETE_ROWS ) ? NULL : XclXmlUtils::ToPsz( true ), +- XML_selectLockedCells, pTabProtect->isOptionEnabled( ScTableProtection::SELECT_LOCKED_CELLS ) ? XclXmlUtils::ToPsz( true ) : NULL, +- XML_sort, pTabProtect->isOptionEnabled( ScTableProtection::SORT ) ? NULL : XclXmlUtils::ToPsz( true ), +- XML_autoFilter, pTabProtect->isOptionEnabled( ScTableProtection::AUTOFILTER ) ? NULL : XclXmlUtils::ToPsz( true ), +- XML_pivotTables, pTabProtect->isOptionEnabled( ScTableProtection::PIVOT_TABLES ) ? NULL : XclXmlUtils::ToPsz( true ), +- XML_selectUnlockedCells, pTabProtect->isOptionEnabled( ScTableProtection::SELECT_UNLOCKED_CELLS ) ? XclXmlUtils::ToPsz( true ) : NULL, ++ XML_objects, pTabProtect->isOptionEnabled( ScTableProtection::OBJECTS ) ? NULL : XclXmlUtils::ToPsz( true ), ++ XML_scenarios, pTabProtect->isOptionEnabled( ScTableProtection::SCENARIOS ) ? NULL : XclXmlUtils::ToPsz( true ), ++ XML_formatCells, pTabProtect->isOptionEnabled( ScTableProtection::FORMAT_CELLS ) ? XclXmlUtils::ToPsz( false ) : NULL, ++ XML_formatColumns, pTabProtect->isOptionEnabled( ScTableProtection::FORMAT_COLUMNS ) ? XclXmlUtils::ToPsz( false ) : NULL, ++ XML_formatRows, pTabProtect->isOptionEnabled( ScTableProtection::FORMAT_ROWS ) ? XclXmlUtils::ToPsz( false ) : NULL, ++ XML_insertColumns, pTabProtect->isOptionEnabled( ScTableProtection::INSERT_COLUMNS ) ? XclXmlUtils::ToPsz( false ) : NULL, ++ XML_insertRows, pTabProtect->isOptionEnabled( ScTableProtection::INSERT_ROWS ) ? XclXmlUtils::ToPsz( false ) : NULL, ++ XML_insertHyperlinks, pTabProtect->isOptionEnabled( ScTableProtection::INSERT_HYPERLINKS ) ? XclXmlUtils::ToPsz( false ) : NULL, ++ XML_deleteColumns, pTabProtect->isOptionEnabled( ScTableProtection::DELETE_COLUMNS ) ? XclXmlUtils::ToPsz( false ) : NULL, ++ XML_deleteRows, pTabProtect->isOptionEnabled( ScTableProtection::DELETE_ROWS ) ? XclXmlUtils::ToPsz( false ) : NULL, ++ XML_selectLockedCells, pTabProtect->isOptionEnabled( ScTableProtection::SELECT_LOCKED_CELLS ) ? NULL : XclXmlUtils::ToPsz( true ), ++ XML_sort, pTabProtect->isOptionEnabled( ScTableProtection::SORT ) ? XclXmlUtils::ToPsz( false ) : NULL, ++ XML_autoFilter, pTabProtect->isOptionEnabled( ScTableProtection::AUTOFILTER ) ? XclXmlUtils::ToPsz( false ) : NULL, ++ XML_pivotTables, pTabProtect->isOptionEnabled( ScTableProtection::PIVOT_TABLES ) ? XclXmlUtils::ToPsz( false ) : NULL, ++ XML_selectUnlockedCells, pTabProtect->isOptionEnabled( ScTableProtection::SELECT_UNLOCKED_CELLS ) ? NULL : XclXmlUtils::ToPsz( true ), + FSEND ); + } + } +diff --git a/sc/source/filter/oox/worksheetsettings.cxx b/sc/source/filter/oox/worksheetsettings.cxx +index 96ca193..aa13f9c 100644 +--- a/sc/source/filter/oox/worksheetsettings.cxx ++++ b/sc/source/filter/oox/worksheetsettings.cxx +@@ -244,21 +244,21 @@ void WorksheetSettings::finalizeImport() + aPass[1] = maSheetProt.mnPasswordHash & 0xFF; + aProtect.setPasswordHash(aPass, PASSHASH_XL); + } +- aProtect.setOption( ScTableProtection::OBJECTS, maSheetProt.mbObjects); +- aProtect.setOption( ScTableProtection::SCENARIOS, maSheetProt.mbScenarios ); +- aProtect.setOption( ScTableProtection::FORMAT_CELLS, maSheetProt.mbFormatCells ); +- aProtect.setOption( ScTableProtection::FORMAT_COLUMNS, maSheetProt.mbFormatColumns ); +- aProtect.setOption( ScTableProtection::FORMAT_ROWS, maSheetProt.mbFormatRows ); +- aProtect.setOption( ScTableProtection::INSERT_COLUMNS, maSheetProt.mbInsertColumns ); +- aProtect.setOption( ScTableProtection::INSERT_ROWS, maSheetProt.mbInsertRows ); +- aProtect.setOption( ScTableProtection::INSERT_HYPERLINKS, maSheetProt.mbInsertHyperlinks ); +- aProtect.setOption( ScTableProtection::DELETE_COLUMNS, maSheetProt.mbDeleteColumns ); +- aProtect.setOption( ScTableProtection::DELETE_ROWS,maSheetProt.mbDeleteRows ); +- aProtect.setOption( ScTableProtection::SELECT_LOCKED_CELLS, maSheetProt.mbSelectLocked ); +- aProtect.setOption( ScTableProtection::SORT, maSheetProt.mbSort ); +- aProtect.setOption( ScTableProtection::AUTOFILTER, maSheetProt.mbAutoFilter ); +- aProtect.setOption( ScTableProtection::PIVOT_TABLES, maSheetProt.mbPivotTables ); +- aProtect.setOption( ScTableProtection::SELECT_UNLOCKED_CELLS, maSheetProt.mbSelectUnlocked ); ++ aProtect.setOption( ScTableProtection::OBJECTS, !maSheetProt.mbObjects); ++ aProtect.setOption( ScTableProtection::SCENARIOS, !maSheetProt.mbScenarios ); ++ aProtect.setOption( ScTableProtection::FORMAT_CELLS, !maSheetProt.mbFormatCells ); ++ aProtect.setOption( ScTableProtection::FORMAT_COLUMNS, !maSheetProt.mbFormatColumns ); ++ aProtect.setOption( ScTableProtection::FORMAT_ROWS, !maSheetProt.mbFormatRows ); ++ aProtect.setOption( ScTableProtection::INSERT_COLUMNS, !maSheetProt.mbInsertColumns ); ++ aProtect.setOption( ScTableProtection::INSERT_ROWS, !maSheetProt.mbInsertRows ); ++ aProtect.setOption( ScTableProtection::INSERT_HYPERLINKS, !maSheetProt.mbInsertHyperlinks ); ++ aProtect.setOption( ScTableProtection::DELETE_COLUMNS, !maSheetProt.mbDeleteColumns ); ++ aProtect.setOption( ScTableProtection::DELETE_ROWS,!maSheetProt.mbDeleteRows ); ++ aProtect.setOption( ScTableProtection::SELECT_LOCKED_CELLS, !maSheetProt.mbSelectLocked ); ++ aProtect.setOption( ScTableProtection::SORT, !maSheetProt.mbSort ); ++ aProtect.setOption( ScTableProtection::AUTOFILTER, !maSheetProt.mbAutoFilter ); ++ aProtect.setOption( ScTableProtection::PIVOT_TABLES, !maSheetProt.mbPivotTables ); ++ aProtect.setOption( ScTableProtection::SELECT_UNLOCKED_CELLS, !maSheetProt.mbSelectUnlocked ); + + getScDocument().SetTabProtection( getSheetIndex(), &aProtect ); + } +-- +1.8.4.2 + diff --git a/SOURCES/0063-correctly-dispose-to-avoid-cyclic-dependencies.patch b/SOURCES/0063-correctly-dispose-to-avoid-cyclic-dependencies.patch new file mode 100644 index 0000000..32b0a5a --- /dev/null +++ b/SOURCES/0063-correctly-dispose-to-avoid-cyclic-dependencies.patch @@ -0,0 +1,81 @@ +From a3f38bdaaff91abdf2e0f01d0b6370aa958e4a20 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Tue, 10 Dec 2013 16:54:59 +0000 +Subject: [PATCH 063/109] correctly dispose to avoid cyclic dependencies + +accessibility cruft is still listening to dead tables so crashes in +slidesorting in main panel if moved slide has tables in it after visiting slide +sorter once. + +(cherry picked from commit 0b8e2e5efe20519e8b5563314bac0cbb84a3b967) + +Conflicts: + svx/source/table/svdotable.cxx + +Change-Id: I09f9a73b01fb2ddf059402146acdc7bd823798b9 +Reviewed-on: https://gerrit.libreoffice.org/7051 +Reviewed-by: Miklos Vajna +Tested-by: Miklos Vajna +--- + svx/source/table/svdotable.cxx | 20 +++++++++++++++++++- + 1 file changed, 19 insertions(+), 1 deletion(-) + +diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx +index bed3988..474d42d 100644 +--- a/svx/source/table/svdotable.cxx ++++ b/svx/source/table/svdotable.cxx +@@ -268,9 +268,9 @@ void SdrTableObjImpl::init( SdrTableObj* pTable, sal_Int32 nColumns, sal_Int32 n + mpTableObj = pTable; + mxTable = new TableModel( pTable ); + mxTable->init( nColumns, nRows ); +- mpLayouter = new TableLayouter( mxTable ); + Reference< XModifyListener > xListener( static_cast< ::com::sun::star::util::XModifyListener* >(this) ); + mxTable->addModifyListener( xListener ); ++ mpLayouter = new TableLayouter( mxTable ); + UpdateWritingMode(); + LayoutTable( mpTableObj->aRect, true, true ); + mpTableObj->maLogicRect = mpTableObj->aRect; +@@ -282,6 +282,8 @@ SdrTableObjImpl& SdrTableObjImpl::operator=( const SdrTableObjImpl& rSource ) + { + if (this != &rSource) + { ++ disconnectTableStyle(); ++ + if( mpLayouter ) + { + delete mpLayouter; +@@ -307,6 +309,8 @@ SdrTableObjImpl& SdrTableObjImpl::operator=( const SdrTableObjImpl& rSource ) + ApplyCellStyles(); + mpTableObj->aRect = mpTableObj->maLogicRect; + LayoutTable( mpTableObj->aRect, false, false ); ++ ++ connectTableStyle(); + } + return *this; + } +@@ -453,8 +457,22 @@ bool SdrTableObjImpl::ApplyCellStyles() + + void SdrTableObjImpl::dispose() + { ++ disconnectTableStyle(); ++ mxTableStyle.clear(); ++ ++ if( mpLayouter ) ++ { ++ delete mpLayouter; ++ mpLayouter = 0; ++ } ++ + if( mxTable.is() ) ++ { ++ Reference< XModifyListener > xListener( static_cast< ::com::sun::star::util::XModifyListener* >(this) ); ++ mxTable->removeModifyListener( xListener ); + mxTable->dispose(); ++ mxTable.clear(); ++ } + } + + // ----------------------------------------------------------------------------- +-- +1.8.4.2 + diff --git a/SOURCES/0064-disposed-but-not-dtored.patch b/SOURCES/0064-disposed-but-not-dtored.patch new file mode 100644 index 0000000..5f6b63c --- /dev/null +++ b/SOURCES/0064-disposed-but-not-dtored.patch @@ -0,0 +1,42 @@ +From fcd101173cd3436f17a57dbe116f2ed35219a1e5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Wed, 11 Dec 2013 11:57:34 +0000 +Subject: [PATCH 064/109] disposed but not dtored + +just die when you are supposed to, without this endless amounts of accessiblity +cells remain after sorting slides with tables in them + +(cherry picked from commit 1c28065d8fe3e9a1394a7ecfc29e95a9639a1012) + +Conflicts: + svx/source/table/accessibletableshape.cxx + +Change-Id: Ice9a86b8b806e58f9bf871341a38f7729798dda9 +(cherry picked from commit a90e08cb15e712e1d15a16de9a2677e57d81fd13) +Reviewed-on: https://gerrit.libreoffice.org/7052 +Reviewed-by: Miklos Vajna +Tested-by: Miklos Vajna +--- + svx/source/table/accessibletableshape.cxx | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/svx/source/table/accessibletableshape.cxx b/svx/source/table/accessibletableshape.cxx +index a5e910e..8872591 100644 +--- a/svx/source/table/accessibletableshape.cxx ++++ b/svx/source/table/accessibletableshape.cxx +@@ -113,6 +113,12 @@ void AccessibleTableShapeImpl::dispose() + { + if( mxTable.is() ) + { ++ //remove all the cell's acc object in table's dispose. ++ for( AccessibleCellMap::iterator iter( maChildMap.begin() ); iter != maChildMap.end(); iter++ ) ++ { ++ (*iter).second->dispose(); ++ } ++ maChildMap.clear(); + Reference< XModifyListener > xListener( this ); + mxTable->removeModifyListener( xListener ); + mxTable.clear(); +-- +1.8.4.2 + diff --git a/SOURCES/0065-fdo-72697-accept-future-loext-sender-initials.patch b/SOURCES/0065-fdo-72697-accept-future-loext-sender-initials.patch new file mode 100644 index 0000000..b1ff273 --- /dev/null +++ b/SOURCES/0065-fdo-72697-accept-future-loext-sender-initials.patch @@ -0,0 +1,47 @@ +From bedc707bffdfe906a15036a40da1b9179d91b4fc Mon Sep 17 00:00:00 2001 +From: Eike Rathke +Date: Fri, 13 Dec 2013 23:05:06 +0100 +Subject: [PATCH 065/109] fdo#72697 accept future + +... of to-be + +Change-Id: Ia601c0debc5d66682aa92e14fb063395f9f48ab5 +(cherry picked from commit 1379294741ff85d4c09d9ded7579ad50dea88fb7) +Reviewed-on: https://gerrit.libreoffice.org/7076 +Reviewed-by: Miklos Vajna +Tested-by: Miklos Vajna +--- + xmloff/source/text/txtfldi.cxx | 2 +- + xmloff/source/text/txtimp.cxx | 3 ++- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx +index 875677c..3d99acf 100644 +--- a/xmloff/source/text/txtfldi.cxx ++++ b/xmloff/source/text/txtfldi.cxx +@@ -3669,7 +3669,7 @@ SvXMLImportContext* XMLAnnotationImportContext::CreateChildContext( + pContext = new XMLStringBufferImportContext(GetImport(), nPrefix, + rLocalName, aDateBuffer); + } +- else if( XML_NAMESPACE_TEXT == nPrefix ) ++ else if( XML_NAMESPACE_TEXT == nPrefix || XML_NAMESPACE_LO_EXT == nPrefix ) + { + if( IsXMLToken( rLocalName, XML_SENDER_INITIALS ) ) + pContext = new XMLStringBufferImportContext(GetImport(), nPrefix, +diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx +index b5028ae..24221a6 100644 +--- a/xmloff/source/text/txtimp.cxx ++++ b/xmloff/source/text/txtimp.cxx +@@ -155,7 +155,8 @@ static SvXMLTokenMapEntry aTextPElemTokenMap[] = + // sender fields + { XML_NAMESPACE_TEXT, XML_SENDER_FIRSTNAME,XML_TOK_TEXT_SENDER_FIRSTNAME}, + { XML_NAMESPACE_TEXT, XML_SENDER_LASTNAME, XML_TOK_TEXT_SENDER_LASTNAME }, +- { XML_NAMESPACE_TEXT, XML_SENDER_INITIALS, XML_TOK_TEXT_SENDER_INITIALS }, ++ { XML_NAMESPACE_LO_EXT, XML_SENDER_INITIALS, XML_TOK_TEXT_SENDER_INITIALS }, ++ { XML_NAMESPACE_TEXT, XML_SENDER_INITIALS, XML_TOK_TEXT_SENDER_INITIALS }, + { XML_NAMESPACE_TEXT, XML_SENDER_TITLE, XML_TOK_TEXT_SENDER_TITLE }, + { XML_NAMESPACE_TEXT, XML_SENDER_POSITION, XML_TOK_TEXT_SENDER_POSITION }, + { XML_NAMESPACE_TEXT, XML_SENDER_EMAIL, XML_TOK_TEXT_SENDER_EMAIL }, +-- +1.8.4.2 + diff --git a/SOURCES/0066-odbc-DBMetaData-NULL-pattern-equivalent-to-not-foo.patch b/SOURCES/0066-odbc-DBMetaData-NULL-pattern-equivalent-to-not-foo.patch new file mode 100644 index 0000000..8d65703 --- /dev/null +++ b/SOURCES/0066-odbc-DBMetaData-NULL-pattern-equivalent-to-not-foo.patch @@ -0,0 +1,102 @@ +From c8a237e87e909bb9fc8105fcad01317901f08c45 Mon Sep 17 00:00:00 2001 +From: Lionel Elie Mamane +Date: Sat, 14 Dec 2013 06:00:18 +0100 +Subject: [PATCH 066/109] odbc DBMetaData: NULL pattern equivalent to "%", not + "%foo" + +Change-Id: Ief475a1bf6e65b4786e8ee9c025b204f143a30e0 +Reviewed-on: https://gerrit.libreoffice.org/7080 +Reviewed-by: Miklos Vajna +Tested-by: Miklos Vajna +--- + .../drivers/odbcbase/ODatabaseMetaDataResultSet.cxx | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +diff --git a/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx +index fbb1b59..7b524cc 100644 +--- a/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx ++++ b/connectivity/source/drivers/odbcbase/ODatabaseMetaDataResultSet.cxx +@@ -849,7 +849,7 @@ void ODatabaseMetaDataResultSet::openTables(const Any& catalog, const OUString& + OString aPKQ,aPKO,aPKN,aCOL; + const OUString *pSchemaPat = NULL; + +- if(schemaPattern.toChar() != '%') ++ if(schemaPattern != "%") + pSchemaPat = &schemaPattern; + else + pSchemaPat = NULL; +@@ -946,7 +946,7 @@ void ODatabaseMetaDataResultSet::openColumnPrivileges( const Any& catalog, cons + { + const OUString *pSchemaPat = NULL; + +- if(schema.toChar() != '%') ++ if(schema != "%") + pSchemaPat = &schema; + else + pSchemaPat = NULL; +@@ -981,7 +981,7 @@ void ODatabaseMetaDataResultSet::openColumns( const Any& catalog, + { + const OUString *pSchemaPat = NULL; + +- if(schemaPattern.toChar() != '%') ++ if(schemaPattern != "%") + pSchemaPat = &schemaPattern; + else + pSchemaPat = NULL; +@@ -1049,7 +1049,7 @@ void ODatabaseMetaDataResultSet::openProcedureColumns( const Any& catalog, + { + const OUString *pSchemaPat = NULL; + +- if(schemaPattern.toChar() != '%') ++ if(schemaPattern != "%") + pSchemaPat = &schemaPattern; + else + pSchemaPat = NULL; +@@ -1083,7 +1083,7 @@ void ODatabaseMetaDataResultSet::openProcedures(const Any& catalog, const OUStri + { + const OUString *pSchemaPat = NULL; + +- if(schemaPattern.toChar() != '%') ++ if(schemaPattern != "%") + pSchemaPat = &schemaPattern; + else + pSchemaPat = NULL; +@@ -1127,7 +1127,7 @@ void ODatabaseMetaDataResultSet::openSpecialColumns(sal_Bool _bRowVer,const Any& + + const OUString *pSchemaPat = NULL; + +- if(schema.toChar() != '%') ++ if(schema != "%") + pSchemaPat = &schema; + else + pSchemaPat = NULL; +@@ -1214,7 +1214,7 @@ void ODatabaseMetaDataResultSet::openPrimaryKeys(const Any& catalog, const OUStr + { + const OUString *pSchemaPat = NULL; + +- if(schema.toChar() != '%') ++ if(schema != "%") + pSchemaPat = &schema; + else + pSchemaPat = NULL; +@@ -1243,7 +1243,7 @@ void ODatabaseMetaDataResultSet::openTablePrivileges(const Any& catalog, const O + { + const OUString *pSchemaPat = NULL; + +- if(schemaPattern.toChar() != '%') ++ if(schemaPattern != "%") + pSchemaPat = &schemaPattern; + else + pSchemaPat = NULL; +@@ -1273,7 +1273,7 @@ void ODatabaseMetaDataResultSet::openIndexInfo( const Any& catalog, const OUStri + { + const OUString *pSchemaPat = NULL; + +- if(schema.toChar() != '%') ++ if(schema != "%") + pSchemaPat = &schema; + else + pSchemaPat = NULL; +-- +1.8.4.2 + diff --git a/SOURCES/0067-fdo-72697-actually-write-this-only-in-ODF-1.2-extend.patch b/SOURCES/0067-fdo-72697-actually-write-this-only-in-ODF-1.2-extend.patch new file mode 100644 index 0000000..e781b00 --- /dev/null +++ b/SOURCES/0067-fdo-72697-actually-write-this-only-in-ODF-1.2-extend.patch @@ -0,0 +1,80 @@ +From c062276a068a14df530fa21e9099a489a26b2096 Mon Sep 17 00:00:00 2001 +From: Eike Rathke +Date: Fri, 13 Dec 2013 23:30:34 +0100 +Subject: [PATCH 067/109] fdo#72697 actually write this only in ODF 1.2 + extended + +(cherry picked from commit 49f9694e34d07468cff4a7e4de332f11be3e0dd8) + +Conflicts: + xmloff/source/text/txtflde.cxx + +Change-Id: I32097cc4b8a67615b0b6d6172cafd0edad7469b6 +(cherry picked from commit 4031765b004dded31f04c54f9a055b7a3d0053f2) +Reviewed-on: https://gerrit.libreoffice.org/7078 +Reviewed-by: Miklos Vajna +Tested-by: Miklos Vajna +--- + xmloff/source/text/txtflde.cxx | 38 +++++++++++++++++++++++++++----------- + 1 file changed, 27 insertions(+), 11 deletions(-) + +diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx +index 0ad8fcb..6855a3b 100644 +--- a/xmloff/source/text/txtflde.cxx ++++ b/xmloff/source/text/txtflde.cxx +@@ -1752,14 +1752,17 @@ void XMLTextFieldExport::ExportFieldHelper( + GetExport().Characters(aBuffer.makeStringAndClear()); + } + +- // initials +- OUString aInitials( GetStringProperty(sPropertyInitials, rPropSet) ); +- if( !aInitials.isEmpty() ) ++ if (SvtSaveOptions().GetODFDefaultVersion() > SvtSaveOptions::ODFVER_012) + { +- SvXMLElementExport aCreatorElem( GetExport(), XML_NAMESPACE_TEXT, +- XML_SENDER_INITIALS, sal_True, +- sal_False ); +- GetExport().Characters(aInitials); ++ // initials ++ OUString aInitials( GetStringProperty(sPropertyInitials, rPropSet) ); ++ if( !aInitials.isEmpty() ) ++ { ++ SvXMLElementExport aCreatorElem( GetExport(), XML_NAMESPACE_TEXT, ++ XML_SENDER_INITIALS, sal_True, ++ sal_False ); ++ GetExport().Characters(aInitials); ++ } + } + + com::sun::star::uno::Reference < com::sun::star::text::XText > xText; +@@ -2226,10 +2229,23 @@ void XMLTextFieldExport::ExportElement(enum XMLTokenEnum eElementName, + if (eElementName != XML_TOKEN_INVALID) + { + // Element +- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, +- eElementName, bAddSpace, bAddSpace ); +- // export content +- GetExport().Characters(sContent); ++ if (eElementName == XML_SENDER_INITIALS) ++ { ++ if (SvtSaveOptions().GetODFDefaultVersion() > SvtSaveOptions::ODFVER_012) ++ { ++ SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, ++ eElementName, bAddSpace, bAddSpace ); ++ // export content ++ GetExport().Characters(sContent); ++ } ++ } ++ else ++ { ++ SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT, ++ eElementName, bAddSpace, bAddSpace ); ++ // export content ++ GetExport().Characters(sContent); ++ } + } else { + // always export content + GetExport().Characters(sContent); +-- +1.8.4.2 + diff --git a/SOURCES/0068-fdo-72163-fix-safer-way.patch b/SOURCES/0068-fdo-72163-fix-safer-way.patch new file mode 100644 index 0000000..2ac4e52 --- /dev/null +++ b/SOURCES/0068-fdo-72163-fix-safer-way.patch @@ -0,0 +1,30 @@ +From 4f93ef75127d32da84bbf0275e679a0c9ce7b98d Mon Sep 17 00:00:00 2001 +From: Lionel Elie Mamane +Date: Mon, 2 Dec 2013 23:55:43 +0100 +Subject: [PATCH 068/109] fdo#72163: fix safer way + +Do not dispose m_xComposer, might still be used by our m_pCache. + +Change-Id: I6540c035c9159017c694b36e676721ec3e42db51 +Reviewed-on: https://gerrit.libreoffice.org/7094 +Reviewed-by: Miklos Vajna +Tested-by: Miklos Vajna +--- + dbaccess/source/core/api/RowSet.cxx | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx +index 6002747..6a3ba0a 100644 +--- a/dbaccess/source/core/api/RowSet.cxx ++++ b/dbaccess/source/core/api/RowSet.cxx +@@ -2260,7 +2260,6 @@ sal_Bool ORowSet::impl_initComposer_throw( OUString& _out_rCommandToExecute ) + { + try + { +- ::comphelper::disposeComponent( m_xComposer ); + m_xComposer.set( xFactory->createInstance( SERVICE_NAME_SINGLESELECTQUERYCOMPOSER ), UNO_QUERY_THROW ); + } + catch (const Exception& ) { m_xComposer = NULL; } +-- +1.8.4.2 + diff --git a/SOURCES/0071-Do-not-use-Boost-in-SDK-examples.patch b/SOURCES/0071-Do-not-use-Boost-in-SDK-examples.patch new file mode 100644 index 0000000..3d15338 --- /dev/null +++ b/SOURCES/0071-Do-not-use-Boost-in-SDK-examples.patch @@ -0,0 +1,48 @@ +From 4d678d76b51a14e81b0a29c7e96a338bd058526a Mon Sep 17 00:00:00 2001 +From: Stephan Bergmann +Date: Tue, 17 Dec 2013 10:52:48 +0100 +Subject: [PATCH 071/109] Do not use Boost in SDK examples + +Change-Id: I8b2af447fe3ee29261e538a53b4624ff8b6c4d1e +(cherry picked from commit ca4065680a402e3d0ff43e41744b24a9c980b2ef) +Reviewed-on: https://gerrit.libreoffice.org/7118 +Reviewed-by: Michael Stahl +Tested-by: Michael Stahl +--- + odk/examples/cpp/complextoolbarcontrols/ListenerHelper.h | 9 +++------ + 1 file changed, 3 insertions(+), 6 deletions(-) + +diff --git a/odk/examples/cpp/complextoolbarcontrols/ListenerHelper.h b/odk/examples/cpp/complextoolbarcontrols/ListenerHelper.h +index a1e633e..0fe4bd0 100644 +--- a/odk/examples/cpp/complextoolbarcontrols/ListenerHelper.h ++++ b/odk/examples/cpp/complextoolbarcontrols/ListenerHelper.h +@@ -17,8 +17,8 @@ + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + ++#include + #include +-#include + + #include + #include +@@ -29,14 +29,11 @@ + + typedef std::vector < com::sun::star::uno::Reference < com::sun::star::frame::XStatusListener > > StatusListeners; + +-typedef boost::unordered_map < ::rtl::OUString, +- StatusListeners, +- rtl::OUStringHash, +- std::equal_to< rtl::OUString > > ListenerMap; ++typedef std::map < ::rtl::OUString, StatusListeners > ListenerMap; + + // For every frame there is *one* Dispatch object for all possible commands + // this struct contains an array of listeners for every supported command +-// these arrays are accessed by a boost::unordered_map (with the command string as index) ++// these arrays are accessed by a std::map (with the command string as index) + struct ListenerItem + { + ListenerMap aContainer; +-- +1.8.4.2 + diff --git a/SOURCES/0072-Keep-using-component_getImplementationEnvironment-in.patch b/SOURCES/0072-Keep-using-component_getImplementationEnvironment-in.patch new file mode 100644 index 0000000..0b8f005 --- /dev/null +++ b/SOURCES/0072-Keep-using-component_getImplementationEnvironment-in.patch @@ -0,0 +1,354 @@ +From 8071d87b62ab87b2a825394847e9313ea8ddfcb4 Mon Sep 17 00:00:00 2001 +From: Stephan Bergmann +Date: Tue, 17 Dec 2013 10:53:29 +0100 +Subject: [PATCH 072/109] Keep using component_getImplementationEnvironment in + extensions + +...instead of relying on the implicit CPPU_CURRENT_LANGUAGE_BINDING_NAME +convention. Keeping that convention an implementation detail makes it easier to +do improvements in the future. (Theoretically, the bundled extension in mysqlc +could be considered internal code and not adapted, but just be safe.) + +(cherry picked from commit fa2a7c1c95f78d20ed572091e12700fd4d852835) +Conflicts: + desktop/test/deployment/active/active_native.cxx + odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/component.cxx + odk/examples/cpp/counter/counter.cxx + +Change-Id: Iae41a6e072dabc2bf7c1481ba6cfed61680edf37 +Reviewed-on: https://gerrit.libreoffice.org/7119 +Reviewed-by: Michael Stahl +Tested-by: Michael Stahl +--- + desktop/test/deployment/active/active_native.cxx | 7 +++++++ + desktop/test/deployment/passive/passive_native.cxx | 7 +++++++ + mysqlc/source/mysqlc_services.cxx | 7 +++++++ + .../Components/Addons/ProtocolHandlerAddon_cpp/component.cxx | 8 ++++++++ + .../DevelopersGuide/Components/CppComponent/service2_impl.cxx | 7 +++++++ + .../DevelopersGuide/Database/DriverSkeleton/SServices.cxx | 7 +++++++ + .../OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx | 7 +++++++ + .../OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx | 7 +++++++ + odk/examples/DevelopersGuide/examples.html | 4 ++-- + odk/examples/cpp/complextoolbarcontrols/exports.cxx | 7 +++++++ + odk/examples/cpp/counter/counter.cxx | 8 ++++++++ + odk/examples/cpp/custompanel/ctp_services.cxx | 8 ++++++++ + odk/examples/cpp/remoteclient/remoteclient.cxx | 8 ++++++++ + odk/settings/component.uno.def | 1 + + 14 files changed, 91 insertions(+), 2 deletions(-) + +diff --git a/desktop/test/deployment/active/active_native.cxx b/desktop/test/deployment/active/active_native.cxx +index 3afc099..0e0b1e6 100644 +--- a/desktop/test/deployment/active/active_native.cxx ++++ b/desktop/test/deployment/active/active_native.cxx +@@ -252,6 +252,13 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( + pImplName, pServiceManager, pRegistryKey, services); + } + ++extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL ++component_getImplementationEnvironment( ++ char const ** ppEnvTypeName, uno_Environment **) ++{ ++ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; ++} ++ + extern "C" sal_Bool SAL_CALL component_writeInfo( + void * pServiceManager, void * pRegistryKey) + { +diff --git a/desktop/test/deployment/passive/passive_native.cxx b/desktop/test/deployment/passive/passive_native.cxx +index 819f6ab..22586a4 100644 +--- a/desktop/test/deployment/passive/passive_native.cxx ++++ b/desktop/test/deployment/passive/passive_native.cxx +@@ -249,4 +249,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( + pImplName, pServiceManager, pRegistryKey, services); + } + ++extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL ++component_getImplementationEnvironment( ++ char const ** ppEnvTypeName, uno_Environment **) ++{ ++ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; ++} ++ + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/mysqlc/source/mysqlc_services.cxx b/mysqlc/source/mysqlc_services.cxx +index af1cabe..0ffe9cd 100644 +--- a/mysqlc/source/mysqlc_services.cxx ++++ b/mysqlc/source/mysqlc_services.cxx +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + + using namespace connectivity::mysqlc; + using ::com::sun::star::uno::Reference; +@@ -102,6 +103,12 @@ extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( + }; + /* }}} */ + ++extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL ++component_getImplementationEnvironment( ++ char const ** ppEnvTypeName, uno_Environment **) ++{ ++ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; ++} + + /* + * Local variables: +diff --git a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/component.cxx b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/component.cxx +index 20c2628..b71c694 100644 +--- a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/component.cxx ++++ b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_cpp/component.cxx +@@ -35,6 +35,7 @@ + + #include + #include ++#include + #include // helper for queryInterface() impl + #include // helper for component factory + // generated c++ interfaces +@@ -85,4 +86,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(const sal_C + return pRet; + } + ++extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL ++component_getImplementationEnvironment( ++ char const ** ppEnvTypeName, uno_Environment **) ++{ ++ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; ++} ++ + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx b/odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx +index ac86ea1..fa6d875 100644 +--- a/odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx ++++ b/odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx +@@ -36,6 +36,7 @@ + #include // "3" implementing three interfaces + #include + #include ++#include + + #include + #include +@@ -206,6 +207,12 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( + implName, xMgr, xRegistry, ::my_sc_impl::s_component_entries ); + } + ++SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( ++ char const ** ppEnvTypeName, uno_Environment **) ++{ ++ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; ++} ++ + } + + +diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SServices.cxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SServices.cxx +index 9e8fa4c..4873522 100644 +--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SServices.cxx ++++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SServices.cxx +@@ -37,6 +37,7 @@ + #include "SDriver.hxx" + #include + #include ++#include + + using namespace connectivity::skeleton; + using ::rtl::OUString; +@@ -143,5 +144,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( + return pRet; + }; + ++extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL ++component_getImplementationEnvironment( ++ char const ** ppEnvTypeName, uno_Environment **) ++{ ++ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; ++} + + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx +index e6b7885..9d234e9 100644 +--- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx ++++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx +@@ -37,6 +37,7 @@ + + #include + #include ++#include + #include + #include + +@@ -72,6 +73,12 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( + return pRet; + } + ++SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( ++ char const ** ppEnvTypeName, uno_Environment **) ++{ ++ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; ++} ++ + } + + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx +index 5cfe660..9dd347d 100644 +--- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx ++++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + + #include + +@@ -339,6 +340,12 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( + return pRet; + } + ++SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( ++ char const ** ppEnvTypeName, uno_Environment **) ++{ ++ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; ++} ++ + } // extern "C" + + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/odk/examples/DevelopersGuide/examples.html b/odk/examples/DevelopersGuide/examples.html +index b33b16e..17db8e1 100644 +--- a/odk/examples/DevelopersGuide/examples.html ++++ b/odk/examples/DevelopersGuide/examples.html +@@ -573,7 +573,7 @@ the c++ ProtocolHandler example. + href="./Components/Addons/ProtocolHandlerAddon_cpp/component.cxx" + title="link to Components/Addons/ProtocolHandlerAddon_cpp/component.cxx">component.cxx + Implements the administrative +-component functions (component_writeInfo, component_getFactory). ++component functions (component_writeInfo, component_getFactory, component_getImplementationEnvironment). + + + + href="./OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx" + title="link to OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx">fdcomp.cxx + Implements the administrative +-component functions (component_writeInfo, component_getFactory). ++component functions (component_writeInfo, component_getFactory, component_getImplementationEnvironment). + + + ++#include + + #include "MyProtocolHandler.h" + #include "MyListener.h" +@@ -56,6 +57,12 @@ SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(const sal_Char* pImplNa + return xFactory.get(); + } + ++SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( ++ char const ** ppEnvTypeName, uno_Environment **) ++{ ++ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; ++} ++ + } // extern C + + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/odk/examples/cpp/counter/counter.cxx b/odk/examples/cpp/counter/counter.cxx +index 6f65f5c..0773d60 100644 +--- a/odk/examples/cpp/counter/counter.cxx ++++ b/odk/examples/cpp/counter/counter.cxx +@@ -46,6 +46,7 @@ + + #include + #include ++#include + #include // helper for queryInterface() impl + #include // helper for component factory + // generated c++ interfaces +@@ -194,4 +195,11 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(const sal_C + return pRet; + } + ++extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL ++component_getImplementationEnvironment( ++ char const ** ppEnvTypeName, uno_Environment **) ++{ ++ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; ++} ++ + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/odk/examples/cpp/custompanel/ctp_services.cxx b/odk/examples/cpp/custompanel/ctp_services.cxx +index c096a7b..a8f5702 100644 +--- a/odk/examples/cpp/custompanel/ctp_services.cxx ++++ b/odk/examples/cpp/custompanel/ctp_services.cxx +@@ -20,6 +20,7 @@ + #include "ctp_factory.hxx" + + #include ++#include + + //...................................................................................................................... + namespace sd { namespace colortoolpanel +@@ -52,6 +53,13 @@ extern "C" + { + return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey , ::sd::colortoolpanel::s_aServiceEntries ); + } ++ ++SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( ++ char const ** ppEnvTypeName, uno_Environment **) ++{ ++ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; ++} ++ + } + + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/odk/examples/cpp/remoteclient/remoteclient.cxx b/odk/examples/cpp/remoteclient/remoteclient.cxx +index c8886b0..037814b 100644 +--- a/odk/examples/cpp/remoteclient/remoteclient.cxx ++++ b/odk/examples/cpp/remoteclient/remoteclient.cxx +@@ -35,6 +35,7 @@ + + #include + #include ++#include + #include + + #include +@@ -245,6 +246,13 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( + + return pRet; + } ++ ++SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( ++ char const ** ppEnvTypeName, uno_Environment **) ++{ ++ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; ++} ++ + } + + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/odk/settings/component.uno.def b/odk/settings/component.uno.def +index 0c35f9a..1ca480a 100644 +--- a/odk/settings/component.uno.def ++++ b/odk/settings/component.uno.def +@@ -1,2 +1,3 @@ + EXPORTS + component_getFactory ++component_getImplementationEnvironment +-- +1.8.4.2 + diff --git a/SOURCES/0073-Avoid-inaccurate-floating-point-computations.patch b/SOURCES/0073-Avoid-inaccurate-floating-point-computations.patch new file mode 100644 index 0000000..03f3575 --- /dev/null +++ b/SOURCES/0073-Avoid-inaccurate-floating-point-computations.patch @@ -0,0 +1,47 @@ +From 7a3eed5eb60d97fec397d3ad5c0bf62c703f8cf9 Mon Sep 17 00:00:00 2001 +From: Stephan Bergmann +Date: Tue, 17 Dec 2013 16:46:17 +0100 +Subject: [PATCH 073/109] Avoid inaccurate floating-point computations + +...otherwise at least my --disable-dbgutil --disable-debug Linux x86_64 build +failed the CppunitTest_sax_cpputest with 8999999 vs. 9000000 nanoseconds. + +(cherry picked from commit 695671eb18674ea58103093b9cf31a31afe8d2fd, +incorporating follow-up fixes 71448690d7c5904df45bf98243c5bb05a99245e5 +"readUnsignedNumberMaxDigits can read more than maxDigits chars" and +b9bcc9c5c10841dcdfa9ff5814344ce667678df3 "...and nDigits > 9 is harmless in +following for loop and need not be capped") + +Change-Id: I05e0febf413f9f9e01227a0cc4e0f46a5243fe61 +(cherry picked from commit 5bffe4dffd7496057c1fd70e46af800396f5b346) +Reviewed-on: https://gerrit.libreoffice.org/7122 +Reviewed-by: Michael Stahl +Tested-by: Michael Stahl +--- + sax/source/tools/converter.cxx | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx +index bc8b0c1..429f5e4 100644 +--- a/sax/source/tools/converter.cxx ++++ b/sax/source/tools/converter.cxx +@@ -1120,9 +1120,13 @@ bool Converter::convertDuration(util::Duration& rDuration, + { + if (-1 != nTemp) + { +- const sal_Int32 nDigits = std::min(nPos - nStart, 9); +- OSL_ENSURE(nDigits > 0, "bad code monkey: negative digits"); +- nNanoSeconds=static_cast(nTemp)*(1000000000.0/pow(10.0,nDigits)); ++ nNanoSeconds = nTemp; ++ sal_Int32 nDigits = nPos - nStart; ++ assert(nDigits >= 0); ++ for (; nDigits < 9; ++nDigits) ++ { ++ nNanoSeconds *= 10; ++ } + nTemp=-1; + if (sal_Unicode('S') == string[nPos]) + { +-- +1.8.4.2 + diff --git a/SOURCES/0074-fdo-72850-ODF-export-don-t-export-spurious-style-dis.patch b/SOURCES/0074-fdo-72850-ODF-export-don-t-export-spurious-style-dis.patch new file mode 100644 index 0000000..cb7763b --- /dev/null +++ b/SOURCES/0074-fdo-72850-ODF-export-don-t-export-spurious-style-dis.patch @@ -0,0 +1,122 @@ +From 854866140bff2ae4c587c7adc9b3170f06135437 Mon Sep 17 00:00:00 2001 +From: Michael Stahl +Date: Wed, 18 Dec 2013 23:34:54 +0100 +Subject: [PATCH 074/109] fdo#72850: ODF export: don't export spurious + style:display="false" + +... on style:header-left, style:header-first, style:footer-left, +style:footer-first. + +(regression from d92345561c998f7382cf9ef0fdcd29096f978435) + +Change-Id: I48c51fcd2b07ae8b0e3ec2c1087a388c6900b366 +(cherry picked from commit 8f73c7615ebe60ef71d6e8b49a0f19ddac6f03a0) +Reviewed-on: https://gerrit.libreoffice.org/7141 +Reviewed-by: Miklos Vajna +Tested-by: Miklos Vajna +--- + xmloff/source/text/XMLTextHeaderFooterContext.cxx | 1 + + xmloff/source/text/XMLTextMasterPageExport.cxx | 24 +++++++++++------------ + 2 files changed, 13 insertions(+), 12 deletions(-) + +diff --git a/xmloff/source/text/XMLTextHeaderFooterContext.cxx b/xmloff/source/text/XMLTextHeaderFooterContext.cxx +index ba423dc..335d95b 100644 +--- a/xmloff/source/text/XMLTextHeaderFooterContext.cxx ++++ b/xmloff/source/text/XMLTextHeaderFooterContext.cxx +@@ -54,6 +54,7 @@ XMLTextHeaderFooterContext::XMLTextHeaderFooterContext( SvXMLImport& rImport, sa + bLeft( bLft ), + bFirst( bFrst ) + { ++ // NOTE: if this ever handles XML_DISPLAY attr then beware of fdo#72850 ! + if( bLeft || bFirst ) + { + Any aAny; +diff --git a/xmloff/source/text/XMLTextMasterPageExport.cxx b/xmloff/source/text/XMLTextMasterPageExport.cxx +index aafe94a..cb3b2f5 100644 +--- a/xmloff/source/text/XMLTextMasterPageExport.cxx ++++ b/xmloff/source/text/XMLTextMasterPageExport.cxx +@@ -128,18 +128,18 @@ void XMLTextMasterPageExport::exportMasterPageContent( + sal_Bool bHeader = sal_False; + aAny >>= bHeader; + +- sal_Bool bHeaderFirst = sal_False; ++ sal_Bool bHeaderFirstShared = sal_False; + if( bHeader ) + { + aAny = rPropSet->getPropertyValue( sFirstShareContent ); +- aAny >>= bHeaderFirst; ++ aAny >>= bHeaderFirstShared; + } + +- sal_Bool bHeaderLeft = sal_False; ++ sal_Bool bHeaderLeftShared = sal_False; + if( bHeader ) + { + aAny = rPropSet->getPropertyValue( sHeaderShareContent ); +- aAny >>= bHeaderLeft; ++ aAny >>= bHeaderLeftShared; + } + + if( xHeaderText.is() ) +@@ -154,7 +154,7 @@ void XMLTextMasterPageExport::exportMasterPageContent( + + if( xHeaderTextFirst.is() && xHeaderTextFirst != xHeaderText ) + { +- if( !bHeaderFirst ) ++ if (bHeaderFirstShared) + GetExport().AddAttribute( XML_NAMESPACE_STYLE, + XML_DISPLAY, XML_FALSE ); + SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE, +@@ -164,7 +164,7 @@ void XMLTextMasterPageExport::exportMasterPageContent( + + if( xHeaderTextLeft.is() && xHeaderTextLeft != xHeaderText ) + { +- if( !bHeaderLeft ) ++ if (bHeaderLeftShared) + GetExport().AddAttribute( XML_NAMESPACE_STYLE, + XML_DISPLAY, XML_FALSE ); + SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE, +@@ -176,18 +176,18 @@ void XMLTextMasterPageExport::exportMasterPageContent( + sal_Bool bFooter = sal_False; + aAny >>= bFooter; + +- sal_Bool bFooterFirst = sal_False; ++ sal_Bool bFooterFirstShared = sal_False; + if( bFooter ) + { + aAny = rPropSet->getPropertyValue( sFirstShareContent ); +- aAny >>= bFooterFirst; ++ aAny >>= bFooterFirstShared; + } + +- sal_Bool bFooterLeft = sal_False; ++ sal_Bool bFooterLeftShared = sal_False; + if( bFooter ) + { + aAny = rPropSet->getPropertyValue( sFooterShareContent ); +- aAny >>= bFooterLeft; ++ aAny >>= bFooterLeftShared; + } + + if( xFooterText.is() ) +@@ -202,7 +202,7 @@ void XMLTextMasterPageExport::exportMasterPageContent( + + if( xFooterTextFirst.is() && xFooterTextFirst != xFooterText ) + { +- if( !bFooterFirst ) ++ if (bFooterFirstShared) + GetExport().AddAttribute( XML_NAMESPACE_STYLE, + XML_DISPLAY, XML_FALSE ); + SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE, +@@ -212,7 +212,7 @@ void XMLTextMasterPageExport::exportMasterPageContent( + + if( xFooterTextLeft.is() && xFooterTextLeft != xFooterText ) + { +- if( !bFooterLeft ) ++ if (bFooterLeftShared) + GetExport().AddAttribute( XML_NAMESPACE_STYLE, + XML_DISPLAY, XML_FALSE ); + SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_STYLE, +-- +1.8.4.2 + diff --git a/SOURCES/0075-m_bHasActive-must-be-false-after-last-visible-entry-.patch b/SOURCES/0075-m_bHasActive-must-be-false-after-last-visible-entry-.patch new file mode 100644 index 0000000..84f16a8 --- /dev/null +++ b/SOURCES/0075-m_bHasActive-must-be-false-after-last-visible-entry-.patch @@ -0,0 +1,42 @@ +From f232b831d439bac53a662c32032c7a0abd430d5e Mon Sep 17 00:00:00 2001 +From: Stephan Bergmann +Date: Mon, 16 Dec 2013 13:53:30 +0100 +Subject: [PATCH 075/109] m_bHasActive must be false after last visible entry + is removed +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +...otherwise, ExtensionBox_Impl::RecalcAll would crash in CalcActiveHeight(-1). + +Change-Id: If399825951c79b821ed44ebefa19d1032ab4f850 +(cherry picked from commit 661f7bdefc8215f742951727b93395d47293cf0e) +Reviewed-on: https://gerrit.libreoffice.org/7097 +Reviewed-by: Norbert Thiebaud +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +--- + desktop/source/deployment/gui/dp_gui_extlistbox.cxx | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx +index 19d2749..0d48d55 100644 +--- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx ++++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx +@@ -1224,7 +1224,13 @@ void ExtensionBox_Impl::checkEntries() + if ( nPos < m_nActive ) + m_nActive -= 1; + else if ( ( nPos == m_nActive ) && ( nPos == (long) m_vEntries.size() - 1 ) ) ++ { + m_nActive -= 1; ++ if (m_nActive == -1) ++ { ++ m_bHasActive = false; ++ } ++ } + m_vRemovedEntries.push_back( *iIndex ); + m_vEntries.erase( iIndex ); + iIndex = m_vEntries.begin() + nPos; +-- +1.8.4.2 + diff --git a/SOURCES/0076-fdo-60705-Don-t-discard-valid-printing-options.patch b/SOURCES/0076-fdo-60705-Don-t-discard-valid-printing-options.patch new file mode 100644 index 0000000..20a8122 --- /dev/null +++ b/SOURCES/0076-fdo-60705-Don-t-discard-valid-printing-options.patch @@ -0,0 +1,50 @@ +From 23e8d0417c664fcb9b3f281f60629521153d6e55 Mon Sep 17 00:00:00 2001 +From: Andrzej Hunt +Date: Fri, 6 Dec 2013 20:43:24 +0000 +Subject: [PATCH 076/109] fdo#60705 Don't discard valid printing options. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +PPDValue::m_aValue is simply an optional parameter description, whereas +m_aOption is the actual option being passed to cups. + +For example, for the key "PageSize" (which was previously passed +without problem), a typical PPDValue could be: +m_aOption = "A4" +m_aValue = "<>setpagedevice" + +However for the key "InputSlot" (which was previously not passed +to the printer), a typical PPDValue could be: +m_aOption = "RearPaperFeedSlot" +m_aValue = "" + +(cherry picked from commit 4c160e3d54ec1c6c04bc80c6cec7ee58e20af3bb) + +Conflicts: + vcl/unx/generic/printer/cupsmgr.cxx + +Change-Id: I7959317c9f9d67bfafd911e710927a70edfa8792 +Reviewed-on: https://gerrit.libreoffice.org/6963 +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +--- + vcl/unx/generic/printer/cupsmgr.cxx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/vcl/unx/generic/printer/cupsmgr.cxx b/vcl/unx/generic/printer/cupsmgr.cxx +index fe163bb..6b06596 100644 +--- a/vcl/unx/generic/printer/cupsmgr.cxx ++++ b/vcl/unx/generic/printer/cupsmgr.cxx +@@ -618,7 +618,7 @@ void CUPSManager::getOptionsFromDocumentSetup( const JobData& rJob, bool bBanner + { + const PPDKey* pKey = aKeys[i]; + const PPDValue* pValue = rJob.m_aContext.getValue( pKey ); +- if(pValue && pValue->m_eType == eInvocation && pValue->m_aValue.Len() ) ++ if(pValue && pValue->m_eType == eInvocation && pValue->m_aOption.Len() ) + { + OString aKey = OUStringToOString( pKey->getKey(), RTL_TEXTENCODING_ASCII_US ); + OString aValue = OUStringToOString( pValue->m_aOption, RTL_TEXTENCODING_ASCII_US ); +-- +1.8.4.2 + diff --git a/SOURCES/0077-fdo-70232-sw-brown-paper-bag-fix-for-header-sharing-.patch b/SOURCES/0077-fdo-70232-sw-brown-paper-bag-fix-for-header-sharing-.patch new file mode 100644 index 0000000..7258f71 --- /dev/null +++ b/SOURCES/0077-fdo-70232-sw-brown-paper-bag-fix-for-header-sharing-.patch @@ -0,0 +1,36 @@ +From e839c779a1a6b5a80d5e7368c457ba9620ecd6bb Mon Sep 17 00:00:00 2001 +From: Michael Stahl +Date: Fri, 20 Dec 2013 11:24:48 +0100 +Subject: [PATCH 077/109] fdo#70232: sw: brown paper-bag fix for header sharing + mangling footers + +Stupid copy/paste error in SwDoc::CopyMasterFooter() checks +IsHeaderShared(). + +(regression from e1a9a348a519a69f898c9c1e6d87a5837b8267f9) + +Change-Id: I0c0bc16a8c581cd05ed206a0de79c7983204165b +(cherry picked from commit 94c772adc2e8d8af468f3996527c84bf7704103f) +Reviewed-on: https://gerrit.libreoffice.org/7154 +Reviewed-by: Miklos Vajna +Tested-by: Miklos Vajna +--- + sw/source/core/doc/docdesc.cxx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx +index bb1d78f..7bbecfa 100644 +--- a/sw/source/core/doc/docdesc.cxx ++++ b/sw/source/core/doc/docdesc.cxx +@@ -259,7 +259,7 @@ void SwDoc::CopyMasterFooter(const SwPageDesc &rChged, const SwFmtFooter &rFoot, + // The CntntIdx is _always_ different when called from + // SwDocStyleSheet::SetItemSet, because it deep-copies the + // PageDesc. So check if it was previously shared. +- ((bLeft) ? pDesc->IsHeaderShared() : pDesc->IsFirstShared())) ++ ((bLeft) ? pDesc->IsFooterShared() : pDesc->IsFirstShared())) + { + SwFrmFmt *pFmt = new SwFrmFmt( GetAttrPool(), (bLeft ? "Left footer" : "First footer"), + GetDfltFrmFmt() ); +-- +1.8.4.2 + diff --git a/SOURCES/0078-fdo-69065-sw-fix-mirrored-page-style-with-first-page.patch b/SOURCES/0078-fdo-69065-sw-fix-mirrored-page-style-with-first-page.patch new file mode 100644 index 0000000..8474448 --- /dev/null +++ b/SOURCES/0078-fdo-69065-sw-fix-mirrored-page-style-with-first-page.patch @@ -0,0 +1,596 @@ +From 283b76abeafe28c335de2d7cdc2fde04a55d4192 Mon Sep 17 00:00:00 2001 +From: Michael Stahl +Date: Fri, 20 Dec 2013 17:58:12 +0100 +Subject: [PATCH 078/109] fdo#69065: sw: fix mirrored page style with + first-page + +If a mirrored page style is used with first-page on both a right page +and a left page the current design cannot work because the margins in +the SwPageDesc::aFirst cannot be right for both cases. + +So split that up so we get a first-master and first-left format and +copy the headers/footers and margins as appropriate... which is really +adding epicycles to a flawed design; probably this would be better with +just a single SwFrmFmt that has different items for master/left/first +headers. + +(cherry picked from commit e936ecc92a7e362f57ce72a955697840920636b8) + +Conflicts: + sw/source/core/doc/docdesc.cxx + sw/source/core/doc/poolfmt.cxx + +Change-Id: I0889a4ab5959b5a71172203bb64d185960a07d73 +Reviewed-on: https://gerrit.libreoffice.org/7158 +Reviewed-by: Miklos Vajna +Tested-by: Miklos Vajna +--- + sw/inc/doc.hxx | 4 +- + sw/inc/pagedesc.hxx | 10 ++-- + sw/source/core/doc/docdesc.cxx | 97 ++++++++++++++++++++++++++-------- + sw/source/core/doc/docfmt.cxx | 20 +++++-- + sw/source/core/doc/poolfmt.cxx | 5 +- + sw/source/core/layout/frmtool.cxx | 13 ++--- + sw/source/core/layout/pagedesc.cxx | 23 +++++--- + sw/source/core/undo/SwUndoPageDesc.cxx | 4 +- + sw/source/core/unocore/unostyle.cxx | 4 +- + sw/source/filter/ww8/wrtw8sty.cxx | 2 +- + sw/source/filter/ww8/ww8atr.cxx | 2 +- + sw/source/filter/ww8/ww8par.cxx | 8 +-- + sw/source/filter/ww8/ww8par6.cxx | 8 +-- + 13 files changed, 142 insertions(+), 58 deletions(-) + +diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx +index 12ab476..ff372aa 100644 +--- a/sw/inc/doc.hxx ++++ b/sw/inc/doc.hxx +@@ -2080,9 +2080,9 @@ private: + /// method to set new graphics pool defaults, must only be called by SetDrawDefaults! + void UpdateDrawDefaults(); + /// Copies master header to left / first one, if necessary - used by ChgPageDesc(). +- void CopyMasterHeader(const SwPageDesc &rChged, const SwFmtHeader &rHead, SwPageDesc *pDesc, bool bLeft); ++ void CopyMasterHeader(const SwPageDesc &rChged, const SwFmtHeader &rHead, SwPageDesc *pDesc, bool bLeft, bool bFirst); + /// Copies master footer to left / first one, if necessary - used by ChgPageDesc(). +- void CopyMasterFooter(const SwPageDesc &rChged, const SwFmtFooter &rFoot, SwPageDesc *pDesc, bool bLeft); ++ void CopyMasterFooter(const SwPageDesc &rChged, const SwFmtFooter &rFoot, SwPageDesc *pDesc, bool bLeft, bool bFirst); + + /** continue computing a chunk of document statistics + * \param nChars number of characters to count before exiting +diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx +index 45ca5df..a4a74a2 100644 +--- a/sw/inc/pagedesc.hxx ++++ b/sw/inc/pagedesc.hxx +@@ -136,7 +136,9 @@ class SW_DLLPUBLIC SwPageDesc : public SwModify + SvxNumberType aNumType; + SwFrmFmt aMaster; + SwFrmFmt aLeft; +- SwFrmFmt aFirst; ++ // FIXME epicycles growing here - page margins need to be stored differently ++ SwFrmFmt m_FirstMaster; ++ SwFrmFmt m_FirstLeft; + SwDepend aDepend; ///< Because of grid alignment (Registerhaltigkeit). + SwPageDesc *pFollow; + sal_uInt16 nRegHeight; ///< Sentence spacing and fontascent of style. +@@ -191,10 +193,12 @@ public: + + SwFrmFmt &GetMaster() { return aMaster; } + SwFrmFmt &GetLeft() { return aLeft; } +- SwFrmFmt &GetFirst() { return aFirst; } ++ SwFrmFmt &GetFirstMaster() { return m_FirstMaster; } ++ SwFrmFmt &GetFirstLeft() { return m_FirstLeft; } + const SwFrmFmt &GetMaster() const { return aMaster; } + const SwFrmFmt &GetLeft() const { return aLeft; } +- const SwFrmFmt &GetFirst() const { return aFirst; } ++ const SwFrmFmt &GetFirstMaster() const { return m_FirstMaster; } ++ const SwFrmFmt &GetFirstLeft() const { return m_FirstLeft; } + + /** Reset all attrs of the format but keep the ones a pagedesc + cannot live without. */ +diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx +index 7bbecfa..9694337 100644 +--- a/sw/source/core/doc/docdesc.cxx ++++ b/sw/source/core/doc/docdesc.cxx +@@ -59,7 +59,8 @@ using namespace com::sun::star; + static void lcl_DefaultPageFmt( sal_uInt16 nPoolFmtId, + SwFrmFmt &rFmt1, + SwFrmFmt &rFmt2, +- SwFrmFmt &rFmt3 ) ++ SwFrmFmt &rFmt3, ++ SwFrmFmt &rFmt4) + { + // --> #i41075# Printer on demand + // This function does not require a printer anymore. +@@ -115,6 +116,10 @@ static void lcl_DefaultPageFmt( sal_uInt16 nPoolFmtId, + rFmt3.SetFmtAttr( aFrmSize ); + rFmt3.SetFmtAttr( aLR ); + rFmt3.SetFmtAttr( aUL ); ++ ++ rFmt4.SetFmtAttr( aFrmSize ); ++ rFmt4.SetFmtAttr( aLR ); ++ rFmt4.SetFmtAttr( aUL ); + } + + static void lcl_DescSetAttr( const SwFrmFmt &rSource, SwFrmFmt &rDest, +@@ -163,10 +168,21 @@ static void lcl_DescSetAttr( const SwFrmFmt &rSource, SwFrmFmt &rDest, + rDest.SetPoolHlpFileId( rSource.GetPoolHlpFileId() ); + } + +-void SwDoc::CopyMasterHeader(const SwPageDesc &rChged, const SwFmtHeader &rHead, SwPageDesc *pDesc, bool bLeft) ++void SwDoc::CopyMasterHeader(const SwPageDesc &rChged, const SwFmtHeader &rHead, SwPageDesc *pDesc, bool bLeft, bool bFirst) + { +- SwFrmFmt& rDescFrmFmt = (bLeft ? pDesc->GetLeft() : pDesc->GetFirst()); +- if ( (bLeft ? rChged.IsHeaderShared() : rChged.IsFirstShared() ) || !rHead.IsActive() ) ++ assert(bLeft || bFirst); ++ SwFrmFmt& rDescFrmFmt = (bFirst) ++ ? (bLeft) ? pDesc->GetFirstLeft() : pDesc->GetFirstMaster() ++ : pDesc->GetLeft(); ++ if (bFirst && bLeft) ++ { ++ // special case: always shared with something ++ rDescFrmFmt.SetFmtAttr( rChged.IsFirstShared() ++ ? pDesc->GetLeft().GetHeader() ++ : pDesc->GetFirstMaster().GetHeader()); ++ } ++ else if ((bFirst ? rChged.IsFirstShared() : rChged.IsHeaderShared()) ++ || !rHead.IsActive()) + { + // Left or first shares the header with the Master. + rDescFrmFmt.SetFmtAttr( pDesc->GetMaster().GetHeader() ); +@@ -191,16 +207,19 @@ void SwDoc::CopyMasterHeader(const SwPageDesc &rChged, const SwFmtHeader &rHead, + const SwFmtCntnt &aCnt = rFmtHead.GetHeaderFmt()->GetCntnt(); + if( !aCnt.GetCntntIdx() ) + { +- const SwFrmFmt& rChgedFrmFmt = (bLeft ? rChged.GetLeft() : rChged.GetFirst()); ++ const SwFrmFmt& rChgedFrmFmt = (bFirst) ++ ? (bLeft) ? rChged.GetFirstLeft() : rChged.GetFirstMaster() ++ : rChged.GetLeft(); + rDescFrmFmt.SetFmtAttr( rChgedFrmFmt.GetHeader() ); + } + else if ((*aRCnt.GetCntntIdx() == *aCnt.GetCntntIdx()) || + // The CntntIdx is _always_ different when called from + // SwDocStyleSheet::SetItemSet, because it deep-copies the + // PageDesc. So check if it was previously shared. +- ((bLeft) ? pDesc->IsHeaderShared() : pDesc->IsFirstShared())) ++ ((bFirst) ? pDesc->IsFirstShared() : pDesc->IsHeaderShared())) + { +- SwFrmFmt *pFmt = new SwFrmFmt( GetAttrPool(), (bLeft ? "Left header" : "First header"), ++ SwFrmFmt *pFmt = new SwFrmFmt( GetAttrPool(), ++ (bFirst) ? "First header" : "Left header", + GetDfltFrmFmt() ); + ::lcl_DescSetAttr( *pRight, *pFmt, false ); + // The section which the right header attribute is pointing +@@ -226,12 +245,25 @@ void SwDoc::CopyMasterHeader(const SwPageDesc &rChged, const SwFmtHeader &rHead, + } + } + +-void SwDoc::CopyMasterFooter(const SwPageDesc &rChged, const SwFmtFooter &rFoot, SwPageDesc *pDesc, bool bLeft) ++void SwDoc::CopyMasterFooter(const SwPageDesc &rChged, const SwFmtFooter &rFoot, SwPageDesc *pDesc, bool bLeft, bool bFirst) + { +- SwFrmFmt& rDescFrmFmt = (bLeft ? pDesc->GetLeft() : pDesc->GetFirst()); +- if ( (bLeft ? rChged.IsFooterShared() : rChged.IsFirstShared() ) || !rFoot.IsActive() ) ++ assert(bLeft || bFirst); ++ SwFrmFmt& rDescFrmFmt = (bFirst) ++ ? (bLeft) ? pDesc->GetFirstLeft() : pDesc->GetFirstMaster() ++ : pDesc->GetLeft(); ++ if (bFirst && bLeft) ++ { ++ // special case: always shared with something ++ rDescFrmFmt.SetFmtAttr( rChged.IsFirstShared() ++ ? pDesc->GetLeft().GetFooter() ++ : pDesc->GetFirstMaster().GetFooter()); ++ } ++ else if ((bFirst ? rChged.IsFirstShared() : rChged.IsFooterShared()) ++ || !rFoot.IsActive()) ++ { + // Left or first shares the Header with the Master. + rDescFrmFmt.SetFmtAttr( pDesc->GetMaster().GetFooter() ); ++ } + else if ( rFoot.IsActive() ) + { // Left or first gets its own Footer if the Format does not already have one. + // If the Format already has a Footer and it points to the same section as the Right one, +@@ -252,16 +284,19 @@ void SwDoc::CopyMasterFooter(const SwPageDesc &rChged, const SwFmtFooter &rFoot, + const SwFmtCntnt &aLCnt = rFmtFoot.GetFooterFmt()->GetCntnt(); + if( !aLCnt.GetCntntIdx() ) + { +- const SwFrmFmt& rChgedFrmFmt = (bLeft ? rChged.GetLeft() : rChged.GetFirst()); ++ const SwFrmFmt& rChgedFrmFmt = (bFirst) ++ ? (bLeft) ? rChged.GetFirstLeft() : rChged.GetFirstMaster() ++ : rChged.GetLeft(); + rDescFrmFmt.SetFmtAttr( rChgedFrmFmt.GetFooter() ); + } + else if ((*aRCnt.GetCntntIdx() == *aLCnt.GetCntntIdx()) || + // The CntntIdx is _always_ different when called from + // SwDocStyleSheet::SetItemSet, because it deep-copies the + // PageDesc. So check if it was previously shared. +- ((bLeft) ? pDesc->IsFooterShared() : pDesc->IsFirstShared())) ++ ((bFirst) ? pDesc->IsFirstShared() : pDesc->IsFooterShared())) + { +- SwFrmFmt *pFmt = new SwFrmFmt( GetAttrPool(), (bLeft ? "Left footer" : "First footer"), ++ SwFrmFmt *pFmt = new SwFrmFmt( GetAttrPool(), ++ (bFirst) ? "First footer" : "Left footer", + GetDfltFrmFmt() ); + ::lcl_DescSetAttr( *pRight, *pFmt, false ); + // The section to which the right footer attribute is pointing +@@ -310,7 +345,9 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged ) + const_cast(rChged).GetLeft()); + } + ::lcl_DescSetAttr(rChged.GetMaster(), +- const_cast(rChged).GetFirst()); ++ const_cast(rChged).GetFirstMaster()); ++ ::lcl_DescSetAttr(rChged.GetLeft(), ++ const_cast(rChged).GetFirstLeft()); + + // Take over NumType. + if( rChged.GetNumType().GetNumberingType() != pDesc->GetNumType().GetNumberingType() ) +@@ -350,8 +387,9 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged ) + rChged.IsFirstShared() != pDesc->IsFirstShared() ); + } + pDesc->GetMaster().SetFmtAttr( rHead ); +- CopyMasterHeader(rChged, rHead, pDesc, true); // Copy left header +- CopyMasterHeader(rChged, rHead, pDesc, false); // Copy first header ++ CopyMasterHeader(rChged, rHead, pDesc, true, false); // Copy left header ++ CopyMasterHeader(rChged, rHead, pDesc, false, true); // Copy first master ++ CopyMasterHeader(rChged, rHead, pDesc, true, true); // Copy first left + pDesc->ChgHeaderShare( rChged.IsHeaderShared() ); + + // Synch Footer. +@@ -366,8 +404,9 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged ) + rChged.IsFooterShared() != pDesc->IsFooterShared() ); + } + pDesc->GetMaster().SetFmtAttr( rFoot ); +- CopyMasterFooter(rChged, rFoot, pDesc, true); // Copy left footer +- CopyMasterFooter(rChged, rFoot, pDesc, false); // Copy first footer ++ CopyMasterFooter(rChged, rFoot, pDesc, true, false); // Copy left footer ++ CopyMasterFooter(rChged, rFoot, pDesc, false, true); // Copy first master ++ CopyMasterFooter(rChged, rFoot, pDesc, true, true); // Copy first left + pDesc->ChgFooterShare( rChged.IsFooterShared() ); + // there is just one first shared flag for both header and footer? + pDesc->ChgFirstShare( rChged.IsFirstShared() ); +@@ -408,7 +447,8 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged ) + // Take over the page attributes. + ::lcl_DescSetAttr( rChged.GetMaster(), pDesc->GetMaster() ); + ::lcl_DescSetAttr( rChged.GetLeft(), pDesc->GetLeft() ); +- ::lcl_DescSetAttr( rChged.GetFirst(), pDesc->GetFirst() ); ++ ::lcl_DescSetAttr( rChged.GetFirstMaster(), pDesc->GetFirstMaster() ); ++ ::lcl_DescSetAttr( rChged.GetFirstLeft(), pDesc->GetFirstLeft() ); + + // If the FootnoteInfo changes, the pages are triggered. + if( !(pDesc->GetFtnInfo() == rChged.GetFtnInfo()) ) +@@ -422,7 +462,10 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged ) + pDesc->GetLeft().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) ); + } + { +- pDesc->GetFirst().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) ); ++ pDesc->GetFirstMaster().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) ); ++ } ++ { ++ pDesc->GetFirstLeft().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) ); + } + } + SetModified(); +@@ -444,6 +487,13 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged ) + pBindings->Invalidate( SID_ATTR_PAGE_LRSPACE ); + } + ++ //h/f of first-left page must not be unique but same as first master or left ++ assert((pDesc->IsFirstShared()) ++ ? pDesc->GetFirstLeft().GetHeader().GetHeaderFmt() == pDesc->GetLeft().GetHeader().GetHeaderFmt() ++ : pDesc->GetFirstLeft().GetHeader().GetHeaderFmt() == pDesc->GetFirstMaster().GetHeader().GetHeaderFmt()); ++ assert((pDesc->IsFirstShared()) ++ ? pDesc->GetFirstLeft().GetFooter().GetFooterFmt() == pDesc->GetLeft().GetFooter().GetFooterFmt() ++ : pDesc->GetFirstLeft().GetFooter().GetFooterFmt() == pDesc->GetFirstMaster().GetFooter().GetFooterFmt()); + } + + /// All descriptors whose Follow point to the to-be-deleted have to be adapted. +@@ -554,7 +604,7 @@ sal_uInt16 SwDoc::MakePageDesc( const String &rName, const SwPageDesc *pCpy, + { + pNew = new SwPageDesc( rName, GetDfltFrmFmt(), this ); + // Set the default page format. +- lcl_DefaultPageFmt( USHRT_MAX, pNew->GetMaster(), pNew->GetLeft(), pNew->GetFirst() ); ++ lcl_DefaultPageFmt( USHRT_MAX, pNew->GetMaster(), pNew->GetLeft(), pNew->GetFirstMaster(), pNew->GetFirstLeft() ); + + SvxFrameDirection aFrameDirection = bRegardLanguage ? + GetDefaultFrameDirection(GetAppLanguage()) +@@ -562,7 +612,8 @@ sal_uInt16 SwDoc::MakePageDesc( const String &rName, const SwPageDesc *pCpy, + + pNew->GetMaster().SetFmtAttr( SvxFrameDirectionItem(aFrameDirection, RES_FRAMEDIR) ); + pNew->GetLeft().SetFmtAttr( SvxFrameDirectionItem(aFrameDirection, RES_FRAMEDIR) ); +- pNew->GetFirst().SetFmtAttr( SvxFrameDirectionItem(aFrameDirection, RES_FRAMEDIR) ); ++ pNew->GetFirstMaster().SetFmtAttr( SvxFrameDirectionItem(aFrameDirection, RES_FRAMEDIR) ); ++ pNew->GetFirstLeft().SetFmtAttr( SvxFrameDirectionItem(aFrameDirection, RES_FRAMEDIR) ); + } + maPageDescs.push_back( pNew ); + +@@ -855,7 +906,7 @@ void SwDoc::CheckDefaultPageFmt() + LONG_MAX == rLeftSize.GetHeight(); + + if ( bSetSize ) +- lcl_DefaultPageFmt( rDesc.GetPoolFmtId(), rDesc.GetMaster(), rDesc.GetLeft(), rDesc.GetFirst() ); ++ lcl_DefaultPageFmt( rDesc.GetPoolFmtId(), rDesc.GetMaster(), rDesc.GetLeft(), rDesc.GetFirstMaster(), rDesc.GetFirstLeft() ); + } + } + +diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx +index c94b913..78e347b 100644 +--- a/sw/source/core/doc/docfmt.cxx ++++ b/sw/source/core/doc/docfmt.cxx +@@ -2156,18 +2156,30 @@ void SwDoc::CopyPageDesc( const SwPageDesc& rSrcDesc, SwPageDesc& rDstDesc, + else + rDstDesc.GetLeft().SetFmtAttr( rDstDesc.GetMaster().GetHeader() ); + if( !rDstDesc.IsFirstShared() ) +- CopyHeader( rSrcDesc.GetFirst(), rDstDesc.GetFirst() ); ++ { ++ CopyHeader( rSrcDesc.GetFirstMaster(), rDstDesc.GetFirstMaster() ); ++ rDstDesc.GetFirstLeft().SetFmtAttr(rDstDesc.GetFirstMaster().GetHeader()); ++ } + else +- rDstDesc.GetFirst().SetFmtAttr( rDstDesc.GetMaster().GetHeader() ); ++ { ++ rDstDesc.GetFirstMaster().SetFmtAttr( rDstDesc.GetMaster().GetHeader() ); ++ rDstDesc.GetFirstLeft().SetFmtAttr(rDstDesc.GetLeft().GetHeader()); ++ } + + if( !rDstDesc.IsFooterShared() ) + CopyFooter( rSrcDesc.GetLeft(), rDstDesc.GetLeft() ); + else + rDstDesc.GetLeft().SetFmtAttr( rDstDesc.GetMaster().GetFooter() ); + if( !rDstDesc.IsFirstShared() ) +- CopyFooter( rSrcDesc.GetFirst(), rDstDesc.GetFirst() ); ++ { ++ CopyFooter( rSrcDesc.GetFirstMaster(), rDstDesc.GetFirstMaster() ); ++ rDstDesc.GetFirstLeft().SetFmtAttr(rDstDesc.GetFirstMaster().GetFooter()); ++ } + else +- rDstDesc.GetFirst().SetFmtAttr( rDstDesc.GetMaster().GetFooter() ); ++ { ++ rDstDesc.GetFirstMaster().SetFmtAttr( rDstDesc.GetMaster().GetFooter() ); ++ rDstDesc.GetFirstLeft().SetFmtAttr(rDstDesc.GetLeft().GetFooter()); ++ } + + if( bNotifyLayout && pTmpRoot ) + { +diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx +index f0ee570..b6494f5 100644 +--- a/sw/source/core/doc/poolfmt.cxx ++++ b/sw/source/core/doc/poolfmt.cxx +@@ -1591,9 +1591,12 @@ SwPageDesc* SwDoc::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage ) + { + { + if( bSetLeft ) ++ { + pNewPgDsc->GetLeft().SetFmtAttr( aSet ); ++ pNewPgDsc->GetFirstLeft().SetFmtAttr( aSet ); ++ } + pNewPgDsc->GetMaster().SetFmtAttr( aSet ); +- pNewPgDsc->GetFirst().SetFmtAttr( aSet ); ++ pNewPgDsc->GetFirstMaster().SetFmtAttr( aSet ); + } + } + return pNewPgDsc; +diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx +index 06dc22c..8245f14 100644 +--- a/sw/source/core/layout/frmtool.cxx ++++ b/sw/source/core/layout/frmtool.cxx +@@ -2719,18 +2719,19 @@ SwPageFrm * InsertNewPage( SwPageDesc &rDesc, SwFrm *pUpper, + if (rDesc.IsFirstShared()) + { + // We need to fallback to left or right page format, decide it now. ++ // FIXME: is this still needed? + if (bOdd) + { +- rDesc.GetFirst().SetFmtAttr( rDesc.GetMaster().GetHeader() ); +- rDesc.GetFirst().SetFmtAttr( rDesc.GetMaster().GetFooter() ); ++ rDesc.GetFirstMaster().SetFmtAttr( rDesc.GetMaster().GetHeader() ); ++ rDesc.GetFirstMaster().SetFmtAttr( rDesc.GetMaster().GetFooter() ); + // fdo#60250 copy margins for mirrored pages +- rDesc.GetFirst().SetFmtAttr( rDesc.GetMaster().GetLRSpace() ); ++ rDesc.GetFirstMaster().SetFmtAttr( rDesc.GetMaster().GetLRSpace() ); + } + else + { +- rDesc.GetFirst().SetFmtAttr( rDesc.GetLeft().GetHeader() ); +- rDesc.GetFirst().SetFmtAttr( rDesc.GetLeft().GetFooter() ); +- rDesc.GetFirst().SetFmtAttr( rDesc.GetLeft().GetLRSpace() ); ++ rDesc.GetFirstLeft().SetFmtAttr( rDesc.GetLeft().GetHeader() ); ++ rDesc.GetFirstLeft().SetFmtAttr( rDesc.GetLeft().GetFooter() ); ++ rDesc.GetFirstLeft().SetFmtAttr( rDesc.GetLeft().GetLRSpace() ); + } + } + } +diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx +index 1b248f1..05a24d1 100644 +--- a/sw/source/core/layout/pagedesc.cxx ++++ b/sw/source/core/layout/pagedesc.cxx +@@ -49,7 +49,8 @@ SwPageDesc::SwPageDesc( const String& rName, SwFrmFmt *pFmt, SwDoc *pDc ) : + aDescName( rName ), + aMaster( pDc->GetAttrPool(), rName, pFmt ), + aLeft( pDc->GetAttrPool(), rName, pFmt ), +- aFirst( pDc->GetAttrPool(), rName, pFmt ), ++ m_FirstMaster( pDc->GetAttrPool(), rName, pFmt ), ++ m_FirstLeft( pDc->GetAttrPool(), rName, pFmt ), + aDepend( this, 0 ), + pFollow( this ), + nRegHeight( 0 ), +@@ -67,7 +68,8 @@ SwPageDesc::SwPageDesc( const SwPageDesc &rCpy ) : + aNumType( rCpy.GetNumType() ), + aMaster( rCpy.GetMaster() ), + aLeft( rCpy.GetLeft() ), +- aFirst( rCpy.GetFirst() ), ++ m_FirstMaster( rCpy.GetFirstMaster() ), ++ m_FirstLeft( rCpy.GetFirstLeft() ), + aDepend( this, (SwModify*)rCpy.aDepend.GetRegisteredIn() ), + pFollow( rCpy.pFollow ), + nRegHeight( rCpy.GetRegHeight() ), +@@ -85,7 +87,8 @@ SwPageDesc & SwPageDesc::operator = (const SwPageDesc & rSrc) + aNumType = rSrc.aNumType; + aMaster = rSrc.aMaster; + aLeft = rSrc.aLeft; +- aFirst = rSrc.aFirst; ++ m_FirstMaster = rSrc.m_FirstMaster; ++ m_FirstLeft = rSrc.m_FirstLeft; + + if (rSrc.pFollow == &rSrc) + pFollow = this; +@@ -243,7 +246,15 @@ void SwPageDesc::RegisterChange() + } + } + { +- SwIterator aIter( GetFirst() ); ++ SwIterator aIter( GetFirstMaster() ); ++ for( SwFrm* pLast = aIter.First(); pLast; pLast = aIter.Next() ) ++ { ++ if( pLast->IsPageFrm() ) ++ ((SwPageFrm*)pLast)->PrepareRegisterChg(); ++ } ++ } ++ { ++ SwIterator aIter( GetFirstLeft() ); + for( SwFrm* pLast = aIter.First(); pLast; pLast = aIter.Next() ) + { + if( pLast->IsPageFrm() ) +@@ -348,14 +359,14 @@ sal_Bool SwPageDesc::IsFollowNextPageOfNode( const SwNode& rNd ) const + SwFrmFmt *SwPageDesc::GetLeftFmt(bool const bFirst) + { + return (nsUseOnPage::PD_LEFT & eUse) +- ? ((bFirst) ? &aFirst : &aLeft) ++ ? ((bFirst) ? &m_FirstLeft : &aLeft) + : 0; + } + + SwFrmFmt *SwPageDesc::GetRightFmt(bool const bFirst) + { + return (nsUseOnPage::PD_RIGHT & eUse) +- ? ((bFirst) ? &aFirst : &aMaster) ++ ? ((bFirst) ? &m_FirstMaster : &aMaster) + : 0; + } + +diff --git a/sw/source/core/undo/SwUndoPageDesc.cxx b/sw/source/core/undo/SwUndoPageDesc.cxx +index 6962684..b60c18b 100644 +--- a/sw/source/core/undo/SwUndoPageDesc.cxx ++++ b/sw/source/core/undo/SwUndoPageDesc.cxx +@@ -157,7 +157,7 @@ SwUndoPageDesc::SwUndoPageDesc(const SwPageDesc & _aOld, + } + if( !rNewDesc.IsFirstShared() ) + { +- pFormat = new SwFrmFmt( *rNewDesc.GetFirst().GetHeader().GetHeaderFmt() ); ++ pFormat = new SwFrmFmt( *rNewDesc.GetFirstMaster().GetHeader().GetHeaderFmt() ); + // The Ctor of this object will remove the duplicate! + SwFmtHeader aFormatHeader( pFormat ); + } +@@ -176,7 +176,7 @@ SwUndoPageDesc::SwUndoPageDesc(const SwPageDesc & _aOld, + } + if( !rNewDesc.IsFirstShared() ) + { +- pFormat = new SwFrmFmt( *rNewDesc.GetFirst().GetFooter().GetFooterFmt() ); ++ pFormat = new SwFrmFmt( *rNewDesc.GetFirstMaster().GetFooter().GetFooterFmt() ); + // The Ctor of this object will remove the duplicate! + SwFmtFooter aFormatFooter( pFormat ); + } +diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx +index a7d3b17..0e090be 100644 +--- a/sw/source/core/unocore/unostyle.cxx ++++ b/sw/source/core/unocore/unostyle.cxx +@@ -3411,7 +3411,9 @@ MakeObject: + } + else if (bFirst && !bShareFirst) + { +- pFrmFmt = &rDesc.GetFirst(); ++ pFrmFmt = &rDesc.GetFirstMaster(); ++ // no need to make GetFirstLeft() accessible ++ // since it is always shared + } + else + { +diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx +index 097a8a7..bc08a72 100644 +--- a/sw/source/filter/ww8/wrtw8sty.cxx ++++ b/sw/source/filter/ww8/wrtw8sty.cxx +@@ -1614,7 +1614,7 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt + // The latter method was previously used by the doc/docx import filter. + // In both of these cases, we emit a single Word section with different + // first page header/footer. +- const SwFrmFmt* pPdFirstPgFmt = &pPd->GetFirst(); ++ const SwFrmFmt* pPdFirstPgFmt = &pPd->GetFirstMaster(); + bool titlePage = !pPd->IsFirstShared(); + if ( bOutPgDscSet ) + { +diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx +index d2dae7c..d211344 100644 +--- a/sw/source/filter/ww8/ww8atr.cxx ++++ b/sw/source/filter/ww8/ww8atr.cxx +@@ -371,7 +371,7 @@ bool MSWordExportBase::SetAktPageDescFromNode(const SwNode &rNd) + bNewPageDesc = true; + else + { +- const SwFrmFmt& rTitleFmt = pAktPageDesc->GetFirst(); ++ const SwFrmFmt& rTitleFmt = pAktPageDesc->GetFirstMaster(); + const SwFrmFmt& rFollowFmt = pCurrent->GetMaster(); + + bNewPageDesc = !IsPlausableSingleWordSection(rTitleFmt, +diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx +index 223de68..b34b966 100644 +--- a/sw/source/filter/ww8/ww8par.cxx ++++ b/sw/source/filter/ww8/ww8par.cxx +@@ -2001,7 +2001,7 @@ void SwWW8ImplReader::Read_HdFt(int nSect, const SwPageDesc *pPrev, + = (nI & ( WW8_FOOTER_EVEN | WW8_FOOTER_ODD | WW8_FOOTER_FIRST )) ? true: false; + + SwFrmFmt& rFmt = bUseLeft ? pPD->GetLeft() +- : bUseFirst ? pPD->GetFirst() ++ : bUseFirst ? pPD->GetFirstMaster() + : pPD->GetMaster(); + + SwFrmFmt* pHdFtFmt; +@@ -2016,7 +2016,7 @@ void SwWW8ImplReader::Read_HdFt(int nSect, const SwPageDesc *pPrev, + if (bUseLeft) + pPD->GetLeft().SetFmtAttr(SwFmtFooter(true)); + if (bUseFirst || (rSection.maSep.fTitlePage && bNoFirst)) +- pPD->GetFirst().SetFmtAttr(SwFmtFooter(true)); ++ pPD->GetFirstMaster().SetFmtAttr(SwFmtFooter(true)); + pHdFtFmt = const_cast(rFmt.GetFooter().GetFooterFmt()); + } + else +@@ -2028,7 +2028,7 @@ void SwWW8ImplReader::Read_HdFt(int nSect, const SwPageDesc *pPrev, + if (bUseLeft) + pPD->GetLeft().SetFmtAttr(SwFmtHeader(true)); + if (bUseFirst || (rSection.maSep.fTitlePage && bNoFirst)) +- pPD->GetFirst().SetFmtAttr(SwFmtHeader(true)); ++ pPD->GetFirstMaster().SetFmtAttr(SwFmtHeader(true)); + pHdFtFmt = const_cast(rFmt.GetHeader().GetHeaderFmt()); + } + +@@ -3853,7 +3853,7 @@ void wwSectionManager::SetSegmentToPageDesc(const wwSection &rSection, + if (!(rSection.maSep.pgbApplyTo & 1)) + mrReader.SetPageBorder(rFmt, rSection); + if (!(rSection.maSep.pgbApplyTo & 2)) +- mrReader.SetPageBorder(rPage.GetFirst(), rSection); ++ mrReader.SetPageBorder(rPage.GetFirstMaster(), rSection); + + mrReader.SetDocumentGrid(rFmt, rSection); + } +diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx +index 0d9a638..49fd40e 100644 +--- a/sw/source/filter/ww8/ww8par6.cxx ++++ b/sw/source/filter/ww8/ww8par6.cxx +@@ -1183,14 +1183,14 @@ void SwWW8ImplReader::CopyPageDescHdFt(const SwPageDesc* pOrgPageDesc, + // copy first page header content section + if( nCode & WW8_HEADER_FIRST ) + { +- rDoc.CopyHeader(pOrgPageDesc->GetFirst(), +- pNewPageDesc->GetFirst()); ++ rDoc.CopyHeader(pOrgPageDesc->GetFirstMaster(), ++ pNewPageDesc->GetFirstMaster()); + } + // copy first page footer content section + if( nCode & WW8_FOOTER_FIRST ) + { +- rDoc.CopyFooter(pOrgPageDesc->GetFirst(), +- pNewPageDesc->GetFirst()); ++ rDoc.CopyFooter(pOrgPageDesc->GetFirstMaster(), ++ pNewPageDesc->GetFirstMaster()); + } + } + +-- +1.8.4.2 + diff --git a/SOURCES/0079-fdo-71429-sw-fix-crashes-when-changing-header-first-.patch b/SOURCES/0079-fdo-71429-sw-fix-crashes-when-changing-header-first-.patch new file mode 100644 index 0000000..61d76a2 --- /dev/null +++ b/SOURCES/0079-fdo-71429-sw-fix-crashes-when-changing-header-first-.patch @@ -0,0 +1,83 @@ +From e94ab5aad124b888d524033abeaf212696779067 Mon Sep 17 00:00:00 2001 +From: Michael Stahl +Date: Fri, 20 Dec 2013 21:24:37 +0100 +Subject: [PATCH 079/109] fdo#71429: sw: fix crashes when changing header first + sharing + +Copy some nutso code in SwUndoPageDesc::ExchangeContentNodes() to +work on the un-shared First header/footer too, which apparently avoids +the crash. It's not like Undo of header/footer isn't already a +house of cards anyway. + +Change-Id: Ie6593c4784ce9d368a5098ffb3aa4dec536d250e +(cherry picked from commit 899538a155b0d58f3a864dbc26d0dc7c37386807) +Reviewed-on: https://gerrit.libreoffice.org/7159 +Reviewed-by: Miklos Vajna +Tested-by: Miklos Vajna +--- + sw/source/core/undo/SwUndoPageDesc.cxx | 42 ++++++++++++++++++++++++++++++++++ + 1 file changed, 42 insertions(+) + +diff --git a/sw/source/core/undo/SwUndoPageDesc.cxx b/sw/source/core/undo/SwUndoPageDesc.cxx +index b60c18b..5246c6f 100644 +--- a/sw/source/core/undo/SwUndoPageDesc.cxx ++++ b/sw/source/core/undo/SwUndoPageDesc.cxx +@@ -248,6 +248,27 @@ void SwUndoPageDesc::ExchangeContentNodes( SwPageDesc& rSource, SwPageDesc &rDes + pNewFmt->SetFmtAttr( SwFmtCntnt() ); + delete pNewItem; + } ++ if (!rDest.IsFirstShared()) ++ { ++ // Same procedure for unshared header.. ++ const SwFmtHeader& rSourceFirstMasterHead = rSource.GetFirstMaster().GetHeader(); ++ rDest.GetFirstMaster().GetAttrSet().GetItemState( RES_HEADER, sal_False, &pItem ); ++ pNewItem = pItem->Clone(); ++ pNewFmt = ((SwFmtHeader*)pNewItem)->GetHeaderFmt(); ++#if OSL_DEBUG_LEVEL > 1 ++ const SwFmtCntnt& rSourceCntnt1 = rSourceFirstMasterHead.GetHeaderFmt()->GetCntnt(); ++ (void)rSourceCntnt1; ++ const SwFmtCntnt& rDestCntnt1 = rDest.GetFirstMaster().GetHeader().GetHeaderFmt()->GetCntnt(); ++ (void)rDestCntnt1; ++#endif ++ pNewFmt->SetFmtAttr( rSourceFirstMasterHead.GetHeaderFmt()->GetCntnt() ); ++ delete pNewItem; ++ rSource.GetFirstMaster().GetAttrSet().GetItemState( RES_HEADER, sal_False, &pItem ); ++ pNewItem = pItem->Clone(); ++ pNewFmt = ((SwFmtHeader*)pNewItem)->GetHeaderFmt(); ++ pNewFmt->SetFmtAttr( SwFmtCntnt() ); ++ delete pNewItem; ++ } + } + // Same procedure for footers... + const SwFmtFooter& rDestFoot = rDest.GetMaster().GetFooter(); +@@ -294,6 +315,27 @@ void SwUndoPageDesc::ExchangeContentNodes( SwPageDesc& rSource, SwPageDesc &rDes + pNewFmt->SetFmtAttr( SwFmtCntnt() ); + delete pNewItem; + } ++ if (!rDest.IsFirstShared()) ++ { ++ const SwFmtFooter& rSourceFirstMasterFoot = rSource.GetFirstMaster().GetFooter(); ++#if OSL_DEBUG_LEVEL > 1 ++ const SwFmtCntnt& rFooterSourceCntnt2 = rSourceFirstMasterFoot.GetFooterFmt()->GetCntnt(); ++ const SwFmtCntnt& rFooterDestCntnt2 = ++ rDest.GetFirstMaster().GetFooter().GetFooterFmt()->GetCntnt(); ++ (void)rFooterSourceCntnt2; ++ (void)rFooterDestCntnt2; ++#endif ++ rDest.GetFirstMaster().GetAttrSet().GetItemState( RES_FOOTER, sal_False, &pItem ); ++ pNewItem = pItem->Clone(); ++ pNewFmt = ((SwFmtFooter*)pNewItem)->GetFooterFmt(); ++ pNewFmt->SetFmtAttr( rSourceFirstMasterFoot.GetFooterFmt()->GetCntnt() ); ++ delete pNewItem; ++ rSource.GetFirstMaster().GetAttrSet().GetItemState( RES_FOOTER, sal_False, &pItem ); ++ pNewItem = pItem->Clone(); ++ pNewFmt = ((SwFmtFooter*)pNewItem)->GetFooterFmt(); ++ pNewFmt->SetFmtAttr( SwFmtCntnt() ); ++ delete pNewItem; ++ } + } + } + +-- +1.8.4.2 + diff --git a/SOURCES/0080-XMLPropertyMapEntry-mbImportOnly-and-XMLPropertySetM.patch b/SOURCES/0080-XMLPropertyMapEntry-mbImportOnly-and-XMLPropertySetM.patch new file mode 100644 index 0000000..2005705 --- /dev/null +++ b/SOURCES/0080-XMLPropertyMapEntry-mbImportOnly-and-XMLPropertySetM.patch @@ -0,0 +1,1271 @@ +From 7b44c5e95b07cde11b8b03f940f97e71ea9c7df4 Mon Sep 17 00:00:00 2001 +From: Eike Rathke +Date: Fri, 20 Dec 2013 12:57:15 +0100 +Subject: [PATCH 080/109] XMLPropertyMapEntry::mbImportOnly and + XMLPropertySetMapper bForExport + +Although a rather large change this does not change the property +mappings or import/export behavior yet, but prepares for further +changes that add mappings for generating correct ODF and consuming +both old and new namespace/element/attribute names. + +This is a combination of 4 commits: + +added bool bForExport parameter to XMLPropertySetMapper ctor + +Set to true for export, false for import. If export true, an +XMLPropertyMapEntry with mbImportOnly==true is not added to the +mappings. This to be able to have more than one mappings for import +(for example a current extension namespace and the future namespace +proposed to the ODF-TC, or corrected typos in element or attribute +names), but map only to one entry on export, of course. + +(cherry picked from commit ebc1b2fe50c7ed1002ed8431410b8e2ac6e795b9) + +Conflicts: + dbaccess/source/filter/xml/xmlHelper.cxx + xmloff/source/chart/PropertyMaps.cxx + xmloff/source/draw/sdpropls.cxx + xmloff/source/style/PageMasterPropMapper.cxx + xmloff/source/table/XMLTableImport.cxx + +prepared XMLPropertyMapEntry with mbImportOnly flag + +(cherry picked from commit 9dd7ee88bd9835ae2bae36093100fcd651fd3aeb) + +Conflicts: + dbaccess/source/filter/xml/xmlHelper.cxx + xmloff/source/table/XMLTableExport.cxx + xmloff/source/text/txtprmap.cxx + +just beautify this a little + +(cherry picked from commit 44b4973fbd0f190906f36321b31215d80b363d52) + +reordered member variables for 4 byte alignment + +(cherry picked from commit dd902b8e256867b5d5fed06b52995f14d969f67d) + +Change-Id: I15b03870fd14f110833037b6c0ff934624d72de1 +Reviewed-on: https://gerrit.libreoffice.org/7144 +Reviewed-by: Miklos Vajna +Tested-by: Miklos Vajna +--- + dbaccess/source/filter/xml/xmlExport.cxx | 8 ++--- + dbaccess/source/filter/xml/xmlHelper.cxx | 27 ++++++++-------- + dbaccess/source/filter/xml/xmlHelper.hxx | 8 ++--- + dbaccess/source/filter/xml/xmlfilter.cxx | 6 ++-- + include/xmloff/maptype.hxx | 8 +++++ + include/xmloff/txtprmap.hxx | 2 +- + include/xmloff/xmlprmap.hxx | 26 ++++++++++------ + reportdesign/source/filter/xml/xmlExport.cxx | 12 +++---- + reportdesign/source/filter/xml/xmlHelper.cxx | 16 +++++----- + reportdesign/source/filter/xml/xmlHelper.hxx | 2 +- + reportdesign/source/filter/xml/xmlStyleImport.cxx | 2 +- + reportdesign/source/filter/xml/xmlfilter.cxx | 8 ++--- + sc/source/filter/xml/xmlexprt.cxx | 10 +++--- + sc/source/filter/xml/xmlimprt.cxx | 8 ++--- + sc/source/filter/xml/xmlstyle.cxx | 6 ++-- + xmloff/inc/XMLChartPropertySetMapper.hxx | 4 +-- + xmloff/qa/unit/uxmloff.cxx | 2 +- + xmloff/source/chart/PropertyMap.hxx | 16 +++++----- + xmloff/source/chart/PropertyMaps.cxx | 4 +-- + xmloff/source/chart/SchXMLExport.cxx | 2 +- + xmloff/source/draw/sdpropls.cxx | 11 ++++--- + xmloff/source/draw/sdpropls.hxx | 2 +- + xmloff/source/draw/sdxmlexp.cxx | 4 +-- + xmloff/source/draw/shapeexport.cxx | 4 +-- + xmloff/source/draw/shapeimport.cxx | 8 ++--- + xmloff/source/forms/controlpropertymap.cxx | 8 ++--- + xmloff/source/forms/layerexport.cxx | 2 +- + xmloff/source/style/PageMasterPropMapper.cxx | 9 +++--- + xmloff/source/style/PageMasterPropMapper.hxx | 5 +-- + xmloff/source/style/PageMasterStyleMap.cxx | 4 +-- + xmloff/source/style/XMLPageExport.cxx | 2 +- + xmloff/source/style/xmlprmap.cxx | 38 +++++++++++++++++------ + xmloff/source/style/xmlstyle.cxx | 4 +-- + xmloff/source/table/XMLTableExport.cxx | 8 ++--- + xmloff/source/table/XMLTableImport.cxx | 5 ++- + xmloff/source/text/txtimp.cxx | 22 ++++++------- + xmloff/source/text/txtparae.cxx | 20 ++++++------ + xmloff/source/text/txtprmap.cxx | 22 ++++++------- + xmloff/source/text/txtstyle.cxx | 4 +-- + 39 files changed, 198 insertions(+), 161 deletions(-) + +diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx +index 135ef75..538cfd3 100644 +--- a/dbaccess/source/filter/xml/xmlExport.cxx ++++ b/dbaccess/source/filter/xml/xmlExport.cxx +@@ -232,7 +232,7 @@ ODBExport::ODBExport(const Reference< XComponentContext >& _rxContext,sal_uInt16 + m_xColumnExportHelper = new OSpecialHanldeXMLExportPropertyMapper(GetColumnStylesPropertySetMapper()); + + m_xCellExportHelper = new OSpecialHanldeXMLExportPropertyMapper(GetCellStylesPropertySetMapper()); +- m_xRowExportHelper = new OSpecialHanldeXMLExportPropertyMapper(OXMLHelper::GetRowStylesPropertySetMapper()); ++ m_xRowExportHelper = new OSpecialHanldeXMLExportPropertyMapper(OXMLHelper::GetRowStylesPropertySetMapper( true)); + + GetAutoStylePool()->AddFamily( + XML_STYLE_FAMILY_TABLE_TABLE, +@@ -1401,7 +1401,7 @@ UniReference < XMLPropertySetMapper > ODBExport::GetTableStylesPropertySetMapper + { + if ( !m_xTableStylesPropertySetMapper.is() ) + { +- m_xTableStylesPropertySetMapper = OXMLHelper::GetTableStylesPropertySetMapper(); ++ m_xTableStylesPropertySetMapper = OXMLHelper::GetTableStylesPropertySetMapper( true); + } + return m_xTableStylesPropertySetMapper; + } +@@ -1410,7 +1410,7 @@ UniReference < XMLPropertySetMapper > ODBExport::GetCellStylesPropertySetMapper( + { + if ( !m_xCellStylesPropertySetMapper.is() ) + { +- m_xCellStylesPropertySetMapper = OXMLHelper::GetCellStylesPropertySetMapper(); ++ m_xCellStylesPropertySetMapper = OXMLHelper::GetCellStylesPropertySetMapper( true); + } + return m_xCellStylesPropertySetMapper; + } +@@ -1419,7 +1419,7 @@ UniReference < XMLPropertySetMapper > ODBExport::GetColumnStylesPropertySetMappe + { + if ( !m_xColumnStylesPropertySetMapper.is() ) + { +- m_xColumnStylesPropertySetMapper = OXMLHelper::GetColumnStylesPropertySetMapper(); ++ m_xColumnStylesPropertySetMapper = OXMLHelper::GetColumnStylesPropertySetMapper( true); + } + return m_xColumnStylesPropertySetMapper; + } +diff --git a/dbaccess/source/filter/xml/xmlHelper.cxx b/dbaccess/source/filter/xml/xmlHelper.cxx +index a410f08..921581d 100644 +--- a/dbaccess/source/filter/xml/xmlHelper.cxx ++++ b/dbaccess/source/filter/xml/xmlHelper.cxx +@@ -71,21 +71,20 @@ const XMLPropertyHandler* OPropertyHandlerFactory::GetPropertyHandler(sal_Int32 + return pHandler; + } + // ----------------------------------------------------------------------------- +-#define MAP_END() { NULL, 0, 0, XML_TOKEN_INVALID, 0 , 0, SvtSaveOptions::ODFVER_010} +-// ----------------------------------------------------------------------------- +-UniReference < XMLPropertySetMapper > OXMLHelper::GetTableStylesPropertySetMapper() ++#define MAP_END() { NULL, 0, 0, XML_TOKEN_INVALID, 0 , 0, SvtSaveOptions::ODFVER_010, false} ++UniReference < XMLPropertySetMapper > OXMLHelper::GetTableStylesPropertySetMapper( bool bForExport ) + { + static const XMLPropertyMapEntry s_aTableStylesProperties[] = + { + MAP_END() + }; + UniReference < XMLPropertyHandlerFactory> xFac = new ::xmloff::OControlPropertyHandlerFactory(); +- return new XMLPropertySetMapper((XMLPropertyMapEntry*)s_aTableStylesProperties, xFac); ++ return new XMLPropertySetMapper((XMLPropertyMapEntry*)s_aTableStylesProperties, xFac, bForExport); + } + // ----------------------------------------------------------------------------- +-UniReference < XMLPropertySetMapper > OXMLHelper::GetColumnStylesPropertySetMapper() ++UniReference < XMLPropertySetMapper > OXMLHelper::GetColumnStylesPropertySetMapper( bool bForExport ) + { +-#define MAP_CONST_COLUMN( name, prefix, token, type, context ) { name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_TABLE_COLUMN, context, SvtSaveOptions::ODFVER_010 } ++#define MAP_CONST_COLUMN( name, prefix, token, type, context ) { name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_TABLE_COLUMN, context, SvtSaveOptions::ODFVER_010, false } + static const XMLPropertyMapEntry s_aColumnStylesProperties[] = + { + MAP_CONST_COLUMN( PROPERTY_WIDTH, XML_NAMESPACE_STYLE, XML_COLUMN_WIDTH, XML_TYPE_MEASURE, 0), +@@ -94,13 +93,13 @@ UniReference < XMLPropertySetMapper > OXMLHelper::GetColumnStylesPropertySetMapp + MAP_END() + }; + UniReference < XMLPropertyHandlerFactory> xFac = new OPropertyHandlerFactory(); +- return new XMLPropertySetMapper((XMLPropertyMapEntry*)s_aColumnStylesProperties, xFac); ++ return new XMLPropertySetMapper((XMLPropertyMapEntry*)s_aColumnStylesProperties, xFac, bForExport); + } + // ----------------------------------------------------------------------------- +-UniReference < XMLPropertySetMapper > OXMLHelper::GetCellStylesPropertySetMapper() ++UniReference < XMLPropertySetMapper > OXMLHelper::GetCellStylesPropertySetMapper( bool bForExport ) + { +-#define MAP_CONST_CELL( name, prefix, token, type, context ) { name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_PARAGRAPH, context, SvtSaveOptions::ODFVER_010 } +-#define MAP_CONST_TEXT( name, prefix, token, type, context ) { name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_TEXT, context, SvtSaveOptions::ODFVER_010 } ++#define MAP_CONST_CELL( name, prefix, token, type, context ) { name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_PARAGRAPH, context, SvtSaveOptions::ODFVER_010, false } ++#define MAP_CONST_TEXT( name, prefix, token, type, context ) { name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_TEXT, context, SvtSaveOptions::ODFVER_010, false } + static const XMLPropertyMapEntry s_aCellStylesProperties[] = + { + MAP_CONST_CELL( PROPERTY_ALIGN, XML_NAMESPACE_FO, XML_TEXT_ALIGN, XML_TYPE_TEXT_ALIGN, CTF_DB_COLUMN_TEXT_ALIGN), +@@ -135,19 +134,19 @@ UniReference < XMLPropertySetMapper > OXMLHelper::GetCellStylesPropertySetMapper + MAP_END() + }; + UniReference < XMLPropertyHandlerFactory> xFac = new /*OPropertyHandlerFactory*/::xmloff::OControlPropertyHandlerFactory(); +- return new XMLPropertySetMapper((XMLPropertyMapEntry*)s_aCellStylesProperties, xFac); ++ return new XMLPropertySetMapper((XMLPropertyMapEntry*)s_aCellStylesProperties, xFac, bForExport); + } + // ----------------------------------------------------------------------------- +-UniReference < XMLPropertySetMapper > OXMLHelper::GetRowStylesPropertySetMapper() ++UniReference < XMLPropertySetMapper > OXMLHelper::GetRowStylesPropertySetMapper( bool bForExport ) + { +-#define MAP_CONST_ROW( name, prefix, token, type, context ) { name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_TABLE_ROW, context, SvtSaveOptions::ODFVER_010 } ++#define MAP_CONST_ROW( name, prefix, token, type, context ) { name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_TABLE_ROW, context, SvtSaveOptions::ODFVER_010, false } + static const XMLPropertyMapEntry s_aStylesProperties[] = + { + MAP_CONST_ROW( PROPERTY_ROW_HEIGHT, XML_NAMESPACE_STYLE, XML_ROW_HEIGHT, XML_TYPE_MEASURE, 0), + MAP_END() + }; + UniReference < XMLPropertyHandlerFactory> xFac = new OPropertyHandlerFactory(); +- return new XMLPropertySetMapper((XMLPropertyMapEntry*)s_aStylesProperties, xFac); ++ return new XMLPropertySetMapper((XMLPropertyMapEntry*)s_aStylesProperties, xFac, bForExport); + } + // ----------------------------------------------------------------------------- + } +diff --git a/dbaccess/source/filter/xml/xmlHelper.hxx b/dbaccess/source/filter/xml/xmlHelper.hxx +index aa7a76e..a9ec5fd 100644 +--- a/dbaccess/source/filter/xml/xmlHelper.hxx ++++ b/dbaccess/source/filter/xml/xmlHelper.hxx +@@ -50,10 +50,10 @@ namespace dbaxml + class OXMLHelper + { + public: +- static UniReference < XMLPropertySetMapper > GetTableStylesPropertySetMapper(); +- static UniReference < XMLPropertySetMapper > GetColumnStylesPropertySetMapper(); +- static UniReference < XMLPropertySetMapper > GetCellStylesPropertySetMapper(); +- static UniReference < XMLPropertySetMapper > GetRowStylesPropertySetMapper(); ++ static UniReference < XMLPropertySetMapper > GetTableStylesPropertySetMapper( bool bForExport ); ++ static UniReference < XMLPropertySetMapper > GetColumnStylesPropertySetMapper( bool bForExport ); ++ static UniReference < XMLPropertySetMapper > GetCellStylesPropertySetMapper( bool bForExport ); ++ static UniReference < XMLPropertySetMapper > GetRowStylesPropertySetMapper( bool bForExport ); + }; + // ----------------------------------------------------------------------------- + } // dbaxml +diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx +index 96ea9ed..d8186fb 100644 +--- a/dbaccess/source/filter/xml/xmlfilter.cxx ++++ b/dbaccess/source/filter/xml/xmlfilter.cxx +@@ -858,7 +858,7 @@ UniReference < XMLPropertySetMapper > ODBFilter::GetTableStylesPropertySetMapper + { + if ( !m_xTableStylesPropertySetMapper.is() ) + { +- m_xTableStylesPropertySetMapper = OXMLHelper::GetTableStylesPropertySetMapper(); ++ m_xTableStylesPropertySetMapper = OXMLHelper::GetTableStylesPropertySetMapper( false); + } + return m_xTableStylesPropertySetMapper; + } +@@ -867,7 +867,7 @@ UniReference < XMLPropertySetMapper > ODBFilter::GetColumnStylesPropertySetMappe + { + if ( !m_xColumnStylesPropertySetMapper.is() ) + { +- m_xColumnStylesPropertySetMapper = OXMLHelper::GetColumnStylesPropertySetMapper(); ++ m_xColumnStylesPropertySetMapper = OXMLHelper::GetColumnStylesPropertySetMapper( false); + } + return m_xColumnStylesPropertySetMapper; + } +@@ -876,7 +876,7 @@ UniReference < XMLPropertySetMapper > ODBFilter::GetCellStylesPropertySetMapper( + { + if ( !m_xCellStylesPropertySetMapper.is() ) + { +- m_xCellStylesPropertySetMapper = OXMLHelper::GetCellStylesPropertySetMapper(); ++ m_xCellStylesPropertySetMapper = OXMLHelper::GetCellStylesPropertySetMapper( false); + } + return m_xCellStylesPropertySetMapper; + } +diff --git a/include/xmloff/maptype.hxx b/include/xmloff/maptype.hxx +index bfd0463..756238f 100644 +--- a/include/xmloff/maptype.hxx ++++ b/include/xmloff/maptype.hxx +@@ -43,6 +43,14 @@ struct XMLPropertyMapEntry + to im/export the porperty */ + sal_Int16 mnContextId; /// User defined id for context filtering + SvtSaveOptions::ODFDefaultVersion mnEarliestODFVersionForExport;// no export when the used ODF version is lower than this ++ ++ /** Flag to specify whether entry is only used during import. ++ ++ Allows to handle more than one Namespace/XML-Name to Property-Name ++ mapping, i.e. for extensions. If several entries for the same ++ Property-Name exist, all except one must have this flag set. ++ */ ++ bool mbImportOnly; + }; + + /////////////////////////////////////////////////////////////////////////// +diff --git a/include/xmloff/txtprmap.hxx b/include/xmloff/txtprmap.hxx +index 92285911..fe5f80d 100644 +--- a/include/xmloff/txtprmap.hxx ++++ b/include/xmloff/txtprmap.hxx +@@ -193,7 +193,7 @@ + class XMLOFF_DLLPUBLIC XMLTextPropertySetMapper : public XMLPropertySetMapper + { + public: +- XMLTextPropertySetMapper( sal_uInt16 nType ); ++ XMLTextPropertySetMapper( sal_uInt16 nType, bool bForExport ); + virtual ~XMLTextPropertySetMapper(); + + static const XMLPropertyMapEntry* getPropertyMapForType( sal_uInt16 _nType ); +diff --git a/include/xmloff/xmlprmap.hxx b/include/xmloff/xmlprmap.hxx +index 2105d6f..ad04bce 100644 +--- a/include/xmloff/xmlprmap.hxx ++++ b/include/xmloff/xmlprmap.hxx +@@ -53,13 +53,14 @@ class XMLPropertyHandler; + */ + struct XMLPropertySetMapperEntry_Impl + { +- OUString sXMLAttributeName; +- OUString sAPIPropertyName; +- sal_uInt16 nXMLNameSpace; +- sal_Int32 nType; +- sal_Int16 nContextId; +- SvtSaveOptions::ODFDefaultVersion nEarliestODFVersionForExport; +- const XMLPropertyHandler *pHdl; ++ OUString sXMLAttributeName; ++ OUString sAPIPropertyName; ++ sal_Int32 nType; ++ sal_uInt16 nXMLNameSpace; ++ sal_Int16 nContextId; ++ SvtSaveOptions::ODFDefaultVersion nEarliestODFVersionForExport; ++ bool bImportOnly; ++ const XMLPropertyHandler *pHdl; + + XMLPropertySetMapperEntry_Impl( + const XMLPropertyMapEntry& rMapEntry, +@@ -75,12 +76,19 @@ class XMLOFF_DLLPUBLIC XMLPropertySetMapper : public UniRefBase + { + ::std::vector< XMLPropertySetMapperEntry_Impl > aMapEntries; + ::std::vector< UniReference < XMLPropertyHandlerFactory > > aHdlFactories; ++ bool mbOnlyExportMappings; + + public: +- /** The last element of the XMLPropertyMapEntry-array must contain NULL-values */ ++ /** The last element of the XMLPropertyMapEntry-array must contain NULL-values. ++ ++ @param bForExport ++ If TRUE, only entries that have the mbImportOnly flag not set ++ will be in the mappings. ++ */ + XMLPropertySetMapper( + const XMLPropertyMapEntry* pEntries, +- const UniReference< XMLPropertyHandlerFactory >& rFactory ); ++ const UniReference< XMLPropertyHandlerFactory >& rFactory, ++ bool bForExport ); + virtual ~XMLPropertySetMapper(); + + void AddMapperEntry( const UniReference < XMLPropertySetMapper >& rMapper ); +diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx +index 1b17eec..96efbf3 100644 +--- a/reportdesign/source/filter/xml/xmlExport.cxx ++++ b/reportdesign/source/filter/xml/xmlExport.cxx +@@ -270,23 +270,23 @@ ORptExport::ORptExport(const Reference< XComponentContext >& _rxContext,sal_uInt + + m_xPropHdlFactory = new OXMLRptPropHdlFactory(); + UniReference < XMLPropertyHandlerFactory> xFac = new ::xmloff::OControlPropertyHandlerFactory(); +- UniReference < XMLPropertySetMapper > xTableStylesPropertySetMapper1 = new XMLPropertySetMapper(OXMLHelper::GetTableStyleProps(),xFac); +- UniReference < XMLPropertySetMapper > xTableStylesPropertySetMapper2 = new XMLTextPropertySetMapper(TEXT_PROP_MAP_TABLE_DEFAULTS ); ++ UniReference < XMLPropertySetMapper > xTableStylesPropertySetMapper1 = new XMLPropertySetMapper(OXMLHelper::GetTableStyleProps(),xFac, true); ++ UniReference < XMLPropertySetMapper > xTableStylesPropertySetMapper2 = new XMLTextPropertySetMapper(TEXT_PROP_MAP_TABLE_DEFAULTS, true ); + xTableStylesPropertySetMapper1->AddMapperEntry(xTableStylesPropertySetMapper2); + + m_xTableStylesExportPropertySetMapper = new SvXMLExportPropertyMapper(xTableStylesPropertySetMapper1); + +- m_xCellStylesPropertySetMapper = OXMLHelper::GetCellStylePropertyMap(); ++ m_xCellStylesPropertySetMapper = OXMLHelper::GetCellStylePropertyMap( false, true); + m_xCellStylesExportPropertySetMapper = new OSpecialHanldeXMLExportPropertyMapper(m_xCellStylesPropertySetMapper); + m_xCellStylesExportPropertySetMapper->ChainExportMapper(XMLTextParagraphExport::CreateParaExtPropMapper(*this)); + +- UniReference < XMLPropertySetMapper > xColumnStylesPropertySetMapper = new XMLPropertySetMapper(OXMLHelper::GetColumnStyleProps(), m_xPropHdlFactory); ++ UniReference < XMLPropertySetMapper > xColumnStylesPropertySetMapper = new XMLPropertySetMapper(OXMLHelper::GetColumnStyleProps(), m_xPropHdlFactory, true); + m_xColumnStylesExportPropertySetMapper = new OSpecialHanldeXMLExportPropertyMapper(xColumnStylesPropertySetMapper); + +- UniReference < XMLPropertySetMapper > xRowStylesPropertySetMapper = new XMLPropertySetMapper(OXMLHelper::GetRowStyleProps(), m_xPropHdlFactory); ++ UniReference < XMLPropertySetMapper > xRowStylesPropertySetMapper = new XMLPropertySetMapper(OXMLHelper::GetRowStyleProps(), m_xPropHdlFactory, true); + m_xRowStylesExportPropertySetMapper = new OSpecialHanldeXMLExportPropertyMapper(xRowStylesPropertySetMapper); + +- UniReference < XMLPropertySetMapper > xPropMapper(new XMLTextPropertySetMapper( TEXT_PROP_MAP_PARA )); ++ UniReference < XMLPropertySetMapper > xPropMapper(new XMLTextPropertySetMapper( TEXT_PROP_MAP_PARA, true )); + m_xParaPropMapper = new OSpecialHanldeXMLExportPropertyMapper( xPropMapper); + + OUString sFamily( GetXMLToken(XML_PARAGRAPH) ); +diff --git a/reportdesign/source/filter/xml/xmlHelper.cxx b/reportdesign/source/filter/xml/xmlHelper.cxx +index 8537f94..1b1ada3 100644 +--- a/reportdesign/source/filter/xml/xmlHelper.cxx ++++ b/reportdesign/source/filter/xml/xmlHelper.cxx +@@ -104,13 +104,13 @@ const XMLPropertyHandler* OPropertyHandlerFactory::GetPropertyHandler(sal_Int32 + return pHandler; + } + // ----------------------------------------------------------------------------- +-#define MAP_CONST_T_ASCII( name, prefix, token, type, context ) { name, sizeof(name)-1, XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_TABLE, context, SvtSaveOptions::ODFVER_010 } +-#define MAP_CONST_P_ASCII( name, prefix, token, type, context ) { name, sizeof(name)-1, XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_PARAGRAPH, context, SvtSaveOptions::ODFVER_010 } +-#define MAP_CONST_S( name, prefix, token, type, context ) { name, sizeof(name)-1, XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_SECTION, context, SvtSaveOptions::ODFVER_010 } +-#define MAP_CONST_C_ASCII( name, prefix, token, type, context ) { name, sizeof(name)-1, XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_TABLE_CELL, context, SvtSaveOptions::ODFVER_010 } +-#define MAP_END() { NULL, 0, 0, XML_TOKEN_INVALID, 0 ,0, SvtSaveOptions::ODFVER_010} ++#define MAP_CONST_T_ASCII( name, prefix, token, type, context ) { name, sizeof(name)-1, XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_TABLE, context, SvtSaveOptions::ODFVER_010, false } ++#define MAP_CONST_P_ASCII( name, prefix, token, type, context ) { name, sizeof(name)-1, XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_PARAGRAPH, context, SvtSaveOptions::ODFVER_010, false } ++#define MAP_CONST_S( name, prefix, token, type, context ) { name, sizeof(name)-1, XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_SECTION, context, SvtSaveOptions::ODFVER_010, false } ++#define MAP_CONST_C_ASCII( name, prefix, token, type, context ) { name, sizeof(name)-1, XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_TABLE_CELL, context, SvtSaveOptions::ODFVER_010, false } ++#define MAP_END() { NULL, 0, 0, XML_TOKEN_INVALID, 0 ,0, SvtSaveOptions::ODFVER_010, false} + // ----------------------------------------------------------------------------- +-UniReference < XMLPropertySetMapper > OXMLHelper::GetCellStylePropertyMap(bool _bOldFormat) ++UniReference < XMLPropertySetMapper > OXMLHelper::GetCellStylePropertyMap(bool _bOldFormat, bool bForExport) + { + if ( _bOldFormat ) + { +@@ -133,7 +133,7 @@ UniReference < XMLPropertySetMapper > OXMLHelper::GetCellStylePropertyMap(bool _ + MAP_CONST_C_ASCII( "BorderBottom", FO, BORDER_BOTTOM, XML_TYPE_BORDER, 0 ), + MAP_END() + }; +- return new XMLPropertySetMapper((XMLPropertyMapEntry*)s_aXMLCellStylesProperties,new OPropertyHandlerFactory()); ++ return new XMLPropertySetMapper((XMLPropertyMapEntry*)s_aXMLCellStylesProperties,new OPropertyHandlerFactory(), bForExport); + } + else + { +@@ -153,7 +153,7 @@ UniReference < XMLPropertySetMapper > OXMLHelper::GetCellStylePropertyMap(bool _ + MAP_CONST_C_ASCII( "BorderBottom", FO, BORDER_BOTTOM, XML_TYPE_BORDER, 0 ), + MAP_END() + }; +- return new XMLPropertySetMapper((XMLPropertyMapEntry*)s_aXMLCellStylesProperties,new OPropertyHandlerFactory()); ++ return new XMLPropertySetMapper((XMLPropertyMapEntry*)s_aXMLCellStylesProperties,new OPropertyHandlerFactory(), bForExport); + } + } + // ----------------------------------------------------------------------------- +diff --git a/reportdesign/source/filter/xml/xmlHelper.hxx b/reportdesign/source/filter/xml/xmlHelper.hxx +index 6cc32dc..d3fbac9 100644 +--- a/reportdesign/source/filter/xml/xmlHelper.hxx ++++ b/reportdesign/source/filter/xml/xmlHelper.hxx +@@ -56,7 +56,7 @@ namespace rptxml + class OXMLHelper + { + public: +- static UniReference < XMLPropertySetMapper > GetCellStylePropertyMap(bool _bOldFormat = false); ++ static UniReference < XMLPropertySetMapper > GetCellStylePropertyMap(bool _bOldFormat, bool bForExport); + + static const SvXMLEnumMapEntry* GetReportPrintOptions(); + static const SvXMLEnumMapEntry* GetForceNewPageOptions(); +diff --git a/reportdesign/source/filter/xml/xmlStyleImport.cxx b/reportdesign/source/filter/xml/xmlStyleImport.cxx +index a79a9c2..eb19a01 100644 +--- a/reportdesign/source/filter/xml/xmlStyleImport.cxx ++++ b/reportdesign/source/filter/xml/xmlStyleImport.cxx +@@ -241,7 +241,7 @@ UniReference < SvXMLImportPropertyMapper > + if( !m_xTableImpPropMapper.is() ) + { + UniReference < XMLPropertyHandlerFactory> xFac = new ::xmloff::OControlPropertyHandlerFactory(); +- m_xTableImpPropMapper = new SvXMLImportPropertyMapper( new XMLPropertySetMapper(OXMLHelper::GetTableStyleProps(), xFac), m_rImport ); ++ m_xTableImpPropMapper = new SvXMLImportPropertyMapper( new XMLPropertySetMapper(OXMLHelper::GetTableStyleProps(), xFac, false), m_rImport ); + } + xMapper = m_xTableImpPropMapper; + } +diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx +index fa83c16..23115e8 100644 +--- a/reportdesign/source/filter/xml/xmlfilter.cxx ++++ b/reportdesign/source/filter/xml/xmlfilter.cxx +@@ -387,10 +387,10 @@ ORptFilter::ORptFilter( const uno::Reference< XComponentContext >& _rxContext,sa + XML_NAMESPACE_REPORT ); + + m_xPropHdlFactory = new OXMLRptPropHdlFactory; +- m_xCellStylesPropertySetMapper = OXMLHelper::GetCellStylePropertyMap(true); +- m_xColumnStylesPropertySetMapper = new XMLPropertySetMapper(OXMLHelper::GetColumnStyleProps(), m_xPropHdlFactory); +- m_xRowStylesPropertySetMapper = new XMLPropertySetMapper(OXMLHelper::GetRowStyleProps(), m_xPropHdlFactory); +- m_xTableStylesPropertySetMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_TABLE_DEFAULTS ); ++ m_xCellStylesPropertySetMapper = OXMLHelper::GetCellStylePropertyMap(true, false); ++ m_xColumnStylesPropertySetMapper = new XMLPropertySetMapper(OXMLHelper::GetColumnStyleProps(), m_xPropHdlFactory, false); ++ m_xRowStylesPropertySetMapper = new XMLPropertySetMapper(OXMLHelper::GetRowStyleProps(), m_xPropHdlFactory, false); ++ m_xTableStylesPropertySetMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_TABLE_DEFAULTS, false ); + } + + // ----------------------------------------------------------------------------- +diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx +index 73b3aec..0fbc692 100644 +--- a/sc/source/filter/xml/xmlexprt.cxx ++++ b/sc/source/filter/xml/xmlexprt.cxx +@@ -476,10 +476,10 @@ ScXMLExport::ScXMLExport( + // document is not set here - create ScChangeTrackingExportHelper later + + xScPropHdlFactory = new XMLScPropHdlFactory; +- xCellStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScCellStylesProperties, xScPropHdlFactory); +- xColumnStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScColumnStylesProperties, xScPropHdlFactory); +- xRowStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScRowStylesProperties, xScPropHdlFactory); +- xTableStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScTableStylesProperties, xScPropHdlFactory); ++ xCellStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScCellStylesProperties, xScPropHdlFactory, true); ++ xColumnStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScColumnStylesProperties, xScPropHdlFactory, true); ++ xRowStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScRowStylesProperties, xScPropHdlFactory, true); ++ xTableStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScTableStylesProperties, xScPropHdlFactory, true); + xCellStylesExportPropertySetMapper = new ScXMLCellExportPropertyMapper(xCellStylesPropertySetMapper); + xCellStylesExportPropertySetMapper->ChainExportMapper(XMLTextParagraphExport::CreateParaExtPropMapper(*this)); + xColumnStylesExportPropertySetMapper = new ScXMLColumnExportPropertyMapper(xColumnStylesPropertySetMapper); +@@ -4638,7 +4638,7 @@ sal_uInt32 ScXMLExport::exportDoc( enum XMLTokenEnum eClass ) + SfxObjectShell* pFoundShell = reinterpret_cast( xObjShellTunnel.is() ? xObjShellTunnel->getSomething(SfxObjectShell::getUnoTunnelId()) : 0 ); + if ( pFoundShell && ooo::vba::isAlienExcelDoc( *pFoundShell ) ) + { +- xRowStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScFromXLSRowStylesProperties, xScPropHdlFactory); ++ xRowStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScFromXLSRowStylesProperties, xScPropHdlFactory, true); + xRowStylesExportPropertySetMapper = new ScXMLRowExportPropertyMapper(xRowStylesPropertySetMapper); + GetAutoStylePool()->SetFamilyPropSetMapper( XML_STYLE_FAMILY_TABLE_ROW, + xRowStylesExportPropertySetMapper ); +diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx +index fd40dc7..28c3ace 100644 +--- a/sc/source/filter/xml/xmlimprt.cxx ++++ b/sc/source/filter/xml/xmlimprt.cxx +@@ -2078,10 +2078,10 @@ ScXMLImport::ScXMLImport( + pStylesImportHelper = new ScMyStylesImportHelper(*this); + + xScPropHdlFactory = new XMLScPropHdlFactory; +- xCellStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScCellStylesProperties, xScPropHdlFactory); +- xColumnStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScColumnStylesProperties, xScPropHdlFactory); +- xRowStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScRowStylesImportProperties, xScPropHdlFactory); +- xTableStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScTableStylesImportProperties, xScPropHdlFactory); ++ xCellStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScCellStylesProperties, xScPropHdlFactory, false); ++ xColumnStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScColumnStylesProperties, xScPropHdlFactory, false); ++ xRowStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScRowStylesImportProperties, xScPropHdlFactory, false); ++ xTableStylesPropertySetMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLScTableStylesImportProperties, xScPropHdlFactory, false); + + // #i66550# needed for 'presentation:event-listener' element for URLs in shapes + GetNamespaceMap().Add( +diff --git a/sc/source/filter/xml/xmlstyle.cxx b/sc/source/filter/xml/xmlstyle.cxx +index 3a5fe2b..88fdef7 100644 +--- a/sc/source/filter/xml/xmlstyle.cxx ++++ b/sc/source/filter/xml/xmlstyle.cxx +@@ -54,9 +54,9 @@ using namespace com::sun::star; + using namespace ::xmloff::token; + using namespace ::formula; + +-#define MAP(name,prefix,token,type,context) { name, sizeof(name)-1, prefix, token, type, context, SvtSaveOptions::ODFVER_010 } +-#define MAP_EXT(name,prefix,token,type,context) { name, sizeof(name)-1, prefix, token, type, context, SvtSaveOptions::ODFVER_012_EXT_COMPAT } +-#define MAP_END() { NULL, 0, 0, XML_TOKEN_INVALID, 0, 0, SvtSaveOptions::ODFVER_010 } ++#define MAP(name,prefix,token,type,context) { name, sizeof(name)-1, prefix, token, type, context, SvtSaveOptions::ODFVER_010, false } ++#define MAP_EXT(name,prefix,token,type,context) { name, sizeof(name)-1, prefix, token, type, context, SvtSaveOptions::ODFVER_012_EXT_COMPAT, false } ++#define MAP_END() { NULL, 0, 0, XML_TOKEN_INVALID, 0, 0, SvtSaveOptions::ODFVER_010, false } + + const XMLPropertyMapEntry aXMLScCellStylesProperties[] = + { +diff --git a/xmloff/inc/XMLChartPropertySetMapper.hxx b/xmloff/inc/XMLChartPropertySetMapper.hxx +index e2463e2..051910e 100644 +--- a/xmloff/inc/XMLChartPropertySetMapper.hxx ++++ b/xmloff/inc/XMLChartPropertySetMapper.hxx +@@ -47,8 +47,8 @@ public: + class XMLChartPropertySetMapper : public XMLPropertySetMapper + { + public: +- XMLChartPropertySetMapper(); +- ~XMLChartPropertySetMapper(); ++ explicit XMLChartPropertySetMapper( bool bForExport ); ++ ~XMLChartPropertySetMapper(); + }; + + // ---------------------------------------- +diff --git a/xmloff/qa/unit/uxmloff.cxx b/xmloff/qa/unit/uxmloff.cxx +index a0bd430..4380a9e 100644 +--- a/xmloff/qa/unit/uxmloff.cxx ++++ b/xmloff/qa/unit/uxmloff.cxx +@@ -62,7 +62,7 @@ void Test::testAutoStylePool() + UniReference< SvXMLAutoStylePoolP > xPool( + new SvXMLAutoStylePoolP( *pExport ) ); + UniReference< XMLPropertySetMapper > xSetMapper( +- new XMLChartPropertySetMapper ); ++ new XMLChartPropertySetMapper( true) ); + UniReference< XMLChartExportPropertyMapper > xExportPropMapper( + new XMLChartExportPropertyMapper( xSetMapper, *pExport ) ); + +diff --git a/xmloff/source/chart/PropertyMap.hxx b/xmloff/source/chart/PropertyMap.hxx +index f19b365..809c043 100644 +--- a/xmloff/source/chart/PropertyMap.hxx ++++ b/xmloff/source/chart/PropertyMap.hxx +@@ -84,14 +84,14 @@ + + #define XML_SCH_CONTEXT_SPECIAL_ERRORBAR_RANGE ( XML_SCH_CTF_START + 25 ) + +-#define MAP_FULL( ApiName, NameSpace, XMLTokenName, XMLType, ContextId, EarliestODFVersionForExport ) { ApiName, sizeof(ApiName)-1, XML_NAMESPACE_##NameSpace, xmloff::token::XMLTokenName, XMLType|XML_TYPE_PROP_CHART, ContextId, EarliestODFVersionForExport } +-#define MAP_ENTRY( a, ns, nm, t ) { a, sizeof(a)-1, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFVER_010 } +-#define MAP_ENTRY_ODF12( a, ns, nm, t ) { a, sizeof(a)-1, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFVER_012 } +-#define MAP_ENTRY_ODF_EXT( a, ns, nm, t ) { a, sizeof(a)-1, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT } +-#define MAP_CONTEXT( a, ns, nm, t, c ) { a, sizeof(a)-1, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, c, SvtSaveOptions::ODFVER_010 } +-#define MAP_SPECIAL( a, ns, nm, t, c ) { a, sizeof(a)-1, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART | MID_FLAG_SPECIAL_ITEM, c, SvtSaveOptions::ODFVER_010 } +-#define MAP_SPECIAL_ODF12( a, ns, nm, t, c ) { a, sizeof(a)-1, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART | MID_FLAG_SPECIAL_ITEM, c, SvtSaveOptions::ODFVER_012 } +-#define MAP_ENTRY_END { 0,0,0,xmloff::token::XML_TOKEN_INVALID,0,0,SvtSaveOptions::ODFVER_010 } ++#define MAP_FULL( ApiName, NameSpace, XMLTokenName, XMLType, ContextId, EarliestODFVersionForExport ) { ApiName, sizeof(ApiName)-1, XML_NAMESPACE_##NameSpace, xmloff::token::XMLTokenName, XMLType|XML_TYPE_PROP_CHART, ContextId, EarliestODFVersionForExport, false } ++#define MAP_ENTRY( a, ns, nm, t ) { a, sizeof(a)-1, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFVER_010, false } ++#define MAP_ENTRY_ODF12( a, ns, nm, t ) { a, sizeof(a)-1, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFVER_012, false } ++#define MAP_ENTRY_ODF_EXT( a, ns, nm, t ) { a, sizeof(a)-1, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT, false } ++#define MAP_CONTEXT( a, ns, nm, t, c ) { a, sizeof(a)-1, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, c, SvtSaveOptions::ODFVER_010, false } ++#define MAP_SPECIAL( a, ns, nm, t, c ) { a, sizeof(a)-1, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART | MID_FLAG_SPECIAL_ITEM, c, SvtSaveOptions::ODFVER_010, false } ++#define MAP_SPECIAL_ODF12( a, ns, nm, t, c ) { a, sizeof(a)-1, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART | MID_FLAG_SPECIAL_ITEM, c, SvtSaveOptions::ODFVER_012, false } ++#define MAP_ENTRY_END { 0,0,0,xmloff::token::XML_TOKEN_INVALID,0,0,SvtSaveOptions::ODFVER_010, false } + + // --------------------------------------------------------- + // PropertyMap for Chart properties drawing- and +diff --git a/xmloff/source/chart/PropertyMaps.cxx b/xmloff/source/chart/PropertyMaps.cxx +index da81152..dd7b59a 100644 +--- a/xmloff/source/chart/PropertyMaps.cxx ++++ b/xmloff/source/chart/PropertyMaps.cxx +@@ -171,8 +171,8 @@ const XMLPropertyHandler* XMLChartPropHdlFactory::GetPropertyHandler( sal_Int32 + + // ---------------------------------------- + +-XMLChartPropertySetMapper::XMLChartPropertySetMapper() : +- XMLPropertySetMapper( aXMLChartPropMap, new XMLChartPropHdlFactory ) ++XMLChartPropertySetMapper::XMLChartPropertySetMapper( bool bForExport ) : ++ XMLPropertySetMapper( aXMLChartPropMap, new XMLChartPropHdlFactory, bForExport ) + { + } + +diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx +index 89a8dae..8cd6416 100644 +--- a/xmloff/source/chart/SchXMLExport.cxx ++++ b/xmloff/source/chart/SchXMLExport.cxx +@@ -1064,7 +1064,7 @@ SchXMLExportHelper_Impl::SchXMLExportHelper_Impl( + msTableName = OUString( "local-table" ); + + // create property set mapper +- mxPropertySetMapper = new XMLChartPropertySetMapper; ++ mxPropertySetMapper = new XMLChartPropertySetMapper( true); + mxExpPropMapper = new XMLChartExportPropertyMapper( mxPropertySetMapper, rExport ); + + // register chart auto-style family +diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx +index 8e243fa..5486a18 100644 +--- a/xmloff/source/draw/sdpropls.cxx ++++ b/xmloff/source/draw/sdpropls.cxx +@@ -72,14 +72,14 @@ using ::com::sun::star::uno::Reference; + using namespace ::com::sun::star; + using namespace ::xmloff::token; + +-#define _MAP(name,prefix,token,type,context) { name, sizeof(name)-1, prefix, token, type, context, SvtSaveOptions::ODFVER_010 } +-#define _MAPV(name,prefix,token,type,context,version) { name, sizeof(name)-1, prefix, token, type, context, version } ++#define _MAP(name,prefix,token,type,context) { name, sizeof(name)-1, prefix, token, type, context, SvtSaveOptions::ODFVER_010, false } ++#define _MAPV(name,prefix,token,type,context,version) { name, sizeof(name)-1, prefix, token, type, context, version, false } + #define GMAP(name,prefix,token,type,context) _MAP(name,prefix,token,type|XML_TYPE_PROP_GRAPHIC,context) + #define GMAPV(name,prefix,token,type,context,version) _MAPV(name,prefix,token,type|XML_TYPE_PROP_GRAPHIC,context,version) + #define DPMAP(name,prefix,token,type,context) _MAP(name,prefix,token,type|XML_TYPE_PROP_DRAWING_PAGE,context) + #define TMAP(name,prefix,token,type,context) _MAP(name,prefix,token,type|XML_TYPE_PROP_TEXT,context) + #define PMAP(name,prefix,token,type,context) _MAP(name,prefix,token,type|XML_TYPE_PROP_PARAGRAPH,context) +-#define MAP_END() { 0L, 0, 0, XML_EMPTY, 0 ,0, SvtSaveOptions::ODFVER_010} ++#define MAP_END() { 0L, 0, 0, XML_EMPTY, 0 ,0, SvtSaveOptions::ODFVER_010, false } + + ////////////////////////////////////////////////////////////////////////////// + // entry list for graphic properties +@@ -1180,8 +1180,9 @@ const XMLPropertyHandler* XMLSdPropHdlFactory::GetPropertyHandler( sal_Int32 nTy + + ////////////////////////////////////////////////////////////////////////////// + +-XMLShapePropertySetMapper::XMLShapePropertySetMapper(const UniReference< XMLPropertyHandlerFactory >& rFactoryRef) +-: XMLPropertySetMapper( aXMLSDProperties, rFactoryRef ) ++XMLShapePropertySetMapper::XMLShapePropertySetMapper(const UniReference< XMLPropertyHandlerFactory >& rFactoryRef, ++ bool bForExport) ++: XMLPropertySetMapper( aXMLSDProperties, rFactoryRef, bForExport ) + { + } + +diff --git a/xmloff/source/draw/sdpropls.hxx b/xmloff/source/draw/sdpropls.hxx +index 70ac1b7..e10199c 100644 +--- a/xmloff/source/draw/sdpropls.hxx ++++ b/xmloff/source/draw/sdpropls.hxx +@@ -244,7 +244,7 @@ public: + class XMLShapePropertySetMapper : public XMLPropertySetMapper + { + public: +- XMLShapePropertySetMapper(const UniReference< XMLPropertyHandlerFactory >& rFactoryRef); ++ XMLShapePropertySetMapper(const UniReference< XMLPropertyHandlerFactory >& rFactoryRef, bool bForExport); + ~XMLShapePropertySetMapper(); + }; + +diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx +index c9149b9..5bbdce5 100644 +--- a/xmloff/source/draw/sdxmlexp.cxx ++++ b/xmloff/source/draw/sdxmlexp.cxx +@@ -444,7 +444,7 @@ void SAL_CALL SdXMLExport::setSourceDocument( const Reference< lang::XComponent + const UniReference< XMLPropertyHandlerFactory > aFactoryRef = mpSdPropHdlFactory; + + // construct PropertySetMapper +- UniReference < XMLPropertySetMapper > xMapper = new XMLShapePropertySetMapper( aFactoryRef); ++ UniReference < XMLPropertySetMapper > xMapper = new XMLShapePropertySetMapper( aFactoryRef, true); + + // get or create text paragraph export + GetTextParagraphExport(); +@@ -456,7 +456,7 @@ void SAL_CALL SdXMLExport::setSourceDocument( const Reference< lang::XComponent + mpPropertySetMapper->ChainExportMapper(XMLTextParagraphExport::CreateParaExtPropMapper(*this)); + + // construct PresPagePropsMapper +- xMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLSDPresPageProps, aFactoryRef); ++ xMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLSDPresPageProps, aFactoryRef, true); + + mpPresPagePropsMapper = new XMLPageExportPropertyMapper( xMapper, *this ); + if(mpPresPagePropsMapper) +diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx +index 14ec5c8..30c0230 100644 +--- a/xmloff/source/draw/shapeexport.cxx ++++ b/xmloff/source/draw/shapeexport.cxx +@@ -1014,7 +1014,7 @@ SvXMLExportPropertyMapper* XMLShapeExport::CreateShapePropMapper( + SvXMLExport& rExport ) + { + UniReference< XMLPropertyHandlerFactory > xFactory = new XMLSdPropHdlFactory( rExport.GetModel(), rExport ); +- UniReference < XMLPropertySetMapper > xMapper = new XMLShapePropertySetMapper( xFactory ); ++ UniReference < XMLPropertySetMapper > xMapper = new XMLShapePropertySetMapper( xFactory, true ); + rExport.GetTextParagraphExport(); // get or create text paragraph export + SvXMLExportPropertyMapper* pResult = + new XMLShapeExportPropertyMapper( xMapper, rExport ); +@@ -1259,7 +1259,7 @@ const rtl::Reference< XMLTableExport >& XMLShapeExport::GetShapeTableExport() + if( !mxShapeTableExport.is() ) + { + rtl::Reference< XMLPropertyHandlerFactory > xFactory( new XMLSdPropHdlFactory( mrExport.GetModel(), mrExport ) ); +- UniReference < XMLPropertySetMapper > xMapper( new XMLShapePropertySetMapper( xFactory.get() ) ); ++ UniReference < XMLPropertySetMapper > xMapper( new XMLShapePropertySetMapper( xFactory.get(), true ) ); + mrExport.GetTextParagraphExport(); // get or create text paragraph export + rtl::Reference< SvXMLExportPropertyMapper > xPropertySetMapper( new XMLShapeExportPropertyMapper( xMapper, mrExport ) ); + mxShapeTableExport = new XMLTableExport( mrExport, xPropertySetMapper, xFactory ); +diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx +index fb41110..7a4619ae 100644 +--- a/xmloff/source/draw/shapeimport.cxx ++++ b/xmloff/source/draw/shapeimport.cxx +@@ -154,7 +154,7 @@ XMLShapeImportHelper::XMLShapeImportHelper( + mpSdPropHdlFactory->acquire(); + + // construct PropertySetMapper +- UniReference < XMLPropertySetMapper > xMapper = new XMLShapePropertySetMapper(mpSdPropHdlFactory); ++ UniReference < XMLPropertySetMapper > xMapper = new XMLShapePropertySetMapper(mpSdPropHdlFactory, false); + mpPropertySetMapper = new SvXMLImportPropertyMapper( xMapper, rImporter ); + // set lock to avoid deletion + mpPropertySetMapper->acquire(); +@@ -170,7 +170,7 @@ XMLShapeImportHelper::XMLShapeImportHelper( + mpPropertySetMapper->ChainImportMapper(XMLTextImportHelper::CreateParaDefaultExtPropMapper(rImporter)); + + // construct PresPagePropsMapper +- xMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLSDPresPageProps, mpSdPropHdlFactory); ++ xMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLSDPresPageProps, mpSdPropHdlFactory, false); + mpPresPagePropsMapper = new SvXMLImportPropertyMapper( xMapper, rImporter ); + if(mpPresPagePropsMapper) + { +@@ -1055,7 +1055,7 @@ void XMLShapeImportHelper::restoreConnections() + SvXMLImportPropertyMapper* XMLShapeImportHelper::CreateShapePropMapper( const uno::Reference< frame::XModel>& rModel, SvXMLImport& rImport ) + { + UniReference< XMLPropertyHandlerFactory > xFactory = new XMLSdPropHdlFactory( rModel, rImport ); +- UniReference < XMLPropertySetMapper > xMapper = new XMLShapePropertySetMapper( xFactory ); ++ UniReference < XMLPropertySetMapper > xMapper = new XMLShapePropertySetMapper( xFactory, false ); + SvXMLImportPropertyMapper* pResult = new SvXMLImportPropertyMapper( xMapper, rImport ); + + // chain text attributes +@@ -1160,7 +1160,7 @@ const rtl::Reference< XMLTableImport >& XMLShapeImportHelper::GetShapeTableImpor + if( !mxShapeTableImport.is() ) + { + rtl::Reference< XMLPropertyHandlerFactory > xFactory( new XMLSdPropHdlFactory( mrImporter.GetModel(), mrImporter ) ); +- rtl::Reference< XMLPropertySetMapper > xPropertySetMapper( new XMLShapePropertySetMapper( xFactory.get() ) ); ++ rtl::Reference< XMLPropertySetMapper > xPropertySetMapper( new XMLShapePropertySetMapper( xFactory.get(), false ) ); + mxShapeTableImport = new XMLTableImport( mrImporter, xPropertySetMapper, xFactory ); + } + +diff --git a/xmloff/source/forms/controlpropertymap.cxx b/xmloff/source/forms/controlpropertymap.cxx +index 2f0dc04..59e5986 100644 +--- a/xmloff/source/forms/controlpropertymap.cxx ++++ b/xmloff/source/forms/controlpropertymap.cxx +@@ -35,10 +35,10 @@ namespace xmloff + { + //......................................................................... + +-#define MAP_ASCII( name, prefix, token, type, context ) { name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_TEXT, context, SvtSaveOptions::ODFVER_010 } +-#define MAP_CONST( name, prefix, token, type, context ) { name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_TEXT, context, SvtSaveOptions::ODFVER_010 } +-#define MAP_CONST_P( name, prefix, token, type, context ){ name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_PARAGRAPH, context, SvtSaveOptions::ODFVER_010 } +-#define MAP_END() { NULL, 0, 0, XML_TOKEN_INVALID, 0, 0, SvtSaveOptions::ODFVER_010 } ++#define MAP_ASCII( name, prefix, token, type, context ) { name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_TEXT, context, SvtSaveOptions::ODFVER_010, false } ++#define MAP_CONST( name, prefix, token, type, context ) { name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_TEXT, context, SvtSaveOptions::ODFVER_010, false } ++#define MAP_CONST_P( name, prefix, token, type, context ){ name, sizeof(name)-1, prefix, token, type|XML_TYPE_PROP_PARAGRAPH, context, SvtSaveOptions::ODFVER_010, false } ++#define MAP_END() { NULL, 0, 0, XML_TOKEN_INVALID, 0, 0, SvtSaveOptions::ODFVER_010, false } + + XMLPropertyMapEntry* getControlStylePropertyMap_Access( ) + { +diff --git a/xmloff/source/forms/layerexport.cxx b/xmloff/source/forms/layerexport.cxx +index c880662..663609a 100644 +--- a/xmloff/source/forms/layerexport.cxx ++++ b/xmloff/source/forms/layerexport.cxx +@@ -89,7 +89,7 @@ namespace xmloff + + // add our style family to the export context's style pool + m_xPropertyHandlerFactory = new OControlPropertyHandlerFactory(); +- ::rtl::Reference< XMLPropertySetMapper > xStylePropertiesMapper = new XMLPropertySetMapper( getControlStylePropertyMap(), m_xPropertyHandlerFactory.get() ); ++ ::rtl::Reference< XMLPropertySetMapper > xStylePropertiesMapper = new XMLPropertySetMapper( getControlStylePropertyMap(), m_xPropertyHandlerFactory.get(), true ); + m_xStyleExportMapper = new OFormComponentStyleExportMapper( xStylePropertiesMapper.get() ); + + // our style family +diff --git a/xmloff/source/style/PageMasterPropMapper.cxx b/xmloff/source/style/PageMasterPropMapper.cxx +index 273e1c3..639fbb0 100644 +--- a/xmloff/source/style/PageMasterPropMapper.cxx ++++ b/xmloff/source/style/PageMasterPropMapper.cxx +@@ -31,15 +31,16 @@ using namespace ::com::sun::star::beans; + + //______________________________________________________________________________ + +-XMLPageMasterPropSetMapper::XMLPageMasterPropSetMapper(): +- XMLPropertySetMapper( aXMLPageMasterStyleMap, new XMLPageMasterPropHdlFactory()) ++XMLPageMasterPropSetMapper::XMLPageMasterPropSetMapper( bool bForExport ): ++ XMLPropertySetMapper( aXMLPageMasterStyleMap, new XMLPageMasterPropHdlFactory(), bForExport) + { + } + + XMLPageMasterPropSetMapper::XMLPageMasterPropSetMapper( + const XMLPropertyMapEntry* pEntries, +- const UniReference< XMLPropertyHandlerFactory >& rFactory ) : +- XMLPropertySetMapper( pEntries, rFactory ) ++ const UniReference< XMLPropertyHandlerFactory >& rFactory, ++ bool bForExport ) : ++ XMLPropertySetMapper( pEntries, rFactory, bForExport ) + { + } + +diff --git a/xmloff/source/style/PageMasterPropMapper.hxx b/xmloff/source/style/PageMasterPropMapper.hxx +index 231a359..392fe17 100644 +--- a/xmloff/source/style/PageMasterPropMapper.hxx ++++ b/xmloff/source/style/PageMasterPropMapper.hxx +@@ -28,10 +28,11 @@ + class XMLPageMasterPropSetMapper : public XMLPropertySetMapper + { + public: +- XMLPageMasterPropSetMapper(); ++ XMLPageMasterPropSetMapper( bool bForExport ); + XMLPageMasterPropSetMapper( + const XMLPropertyMapEntry* pEntries, +- const UniReference< XMLPropertyHandlerFactory >& rFactory ); ++ const UniReference< XMLPropertyHandlerFactory >& rFactory, ++ bool bForExport ); + virtual ~XMLPageMasterPropSetMapper(); + }; + +diff --git a/xmloff/source/style/PageMasterStyleMap.cxx b/xmloff/source/style/PageMasterStyleMap.cxx +index 8726729..18d6ea2 100644 +--- a/xmloff/source/style/PageMasterStyleMap.cxx ++++ b/xmloff/source/style/PageMasterStyleMap.cxx +@@ -24,7 +24,7 @@ + + using namespace ::xmloff::token; + +-#define MAP(name,prefix,token,type,context,version) { name, sizeof(name)-1, prefix, token, type, context, version } ++#define MAP(name,prefix,token,type,context,version) { name, sizeof(name)-1, prefix, token, type, context, version, false } + #define PLMAP(name,prefix,token,type,context) \ + MAP(name,prefix,token,type|XML_TYPE_PROP_PAGE_LAYOUT,context, SvtSaveOptions::ODFVER_010) + #define PLMAP_12(name,prefix,token,type,context) \ +@@ -186,7 +186,7 @@ const XMLPropertyMapEntry aXMLPageMasterStyleMap[] = + HFMAP( "FooterBackGraphicURL", XML_NAMESPACE_STYLE, XML_BACKGROUND_IMAGE, XML_TYPE_STRING | MID_FLAG_ELEMENT_ITEM, CTF_PM_FOOTERGRAPHICURL ), + HFMAP( "FooterDynamicSpacing", XML_NAMESPACE_STYLE, XML_DYNAMIC_SPACING, XML_TYPE_BOOL, CTF_PM_FOOTERFLAG ), + +- { 0L, 0, 0, XML_EMPTY, 0, 0, SvtSaveOptions::ODFVER_010 } ++ { 0L, 0, 0, XML_EMPTY, 0, 0, SvtSaveOptions::ODFVER_010, false } + }; + + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/xmloff/source/style/XMLPageExport.cxx b/xmloff/source/style/XMLPageExport.cxx +index 48e4295..7278eb9 100644 +--- a/xmloff/source/style/XMLPageExport.cxx ++++ b/xmloff/source/style/XMLPageExport.cxx +@@ -161,7 +161,7 @@ XMLPageExport::XMLPageExport( SvXMLExport& rExp ) : + xPageMasterPropHdlFactory = new XMLPageMasterPropHdlFactory; + xPageMasterPropSetMapper = new XMLPageMasterPropSetMapper( + (XMLPropertyMapEntry*) aXMLPageMasterStyleMap, +- xPageMasterPropHdlFactory ); ++ xPageMasterPropHdlFactory, true ); + xPageMasterExportPropMapper = new XMLPageMasterExportPropMapper( + xPageMasterPropSetMapper, rExp); + +diff --git a/xmloff/source/style/xmlprmap.cxx b/xmloff/source/style/xmlprmap.cxx +index 351c912..1ea9a6f 100644 +--- a/xmloff/source/style/xmlprmap.cxx ++++ b/xmloff/source/style/xmlprmap.cxx +@@ -40,10 +40,11 @@ XMLPropertySetMapperEntry_Impl::XMLPropertySetMapperEntry_Impl( + sXMLAttributeName( GetXMLToken(rMapEntry.meXMLName) ), + sAPIPropertyName( OUString(rMapEntry.msApiName, rMapEntry.nApiNameLength, + RTL_TEXTENCODING_ASCII_US ) ), +- nXMLNameSpace( rMapEntry.mnNameSpace ), + nType( rMapEntry.mnType ), ++ nXMLNameSpace( rMapEntry.mnNameSpace ), + nContextId( rMapEntry.mnContextId ), + nEarliestODFVersionForExport( rMapEntry.mnEarliestODFVersionForExport ), ++ bImportOnly( rMapEntry.mbImportOnly), + pHdl( rFactory->GetPropertyHandler( rMapEntry.mnType & MID_FLAG_MASK ) ) + { + } +@@ -52,10 +53,11 @@ XMLPropertySetMapperEntry_Impl::XMLPropertySetMapperEntry_Impl( + const XMLPropertySetMapperEntry_Impl& rEntry ) : + sXMLAttributeName( rEntry.sXMLAttributeName), + sAPIPropertyName( rEntry.sAPIPropertyName), +- nXMLNameSpace( rEntry.nXMLNameSpace), + nType( rEntry.nType), ++ nXMLNameSpace( rEntry.nXMLNameSpace), + nContextId( rEntry.nContextId), + nEarliestODFVersionForExport( rEntry.nEarliestODFVersionForExport ), ++ bImportOnly( rEntry.bImportOnly), + pHdl( rEntry.pHdl) + { + DBG_ASSERT( pHdl, "Unknown XML property type handler!" ); +@@ -67,19 +69,36 @@ XMLPropertySetMapperEntry_Impl::XMLPropertySetMapperEntry_Impl( + // + XMLPropertySetMapper::XMLPropertySetMapper( + const XMLPropertyMapEntry* pEntries, +- const UniReference< XMLPropertyHandlerFactory >& rFactory ) ++ const UniReference< XMLPropertyHandlerFactory >& rFactory, ++ bool bForExport ) ++ : ++ mbOnlyExportMappings( bForExport) + { + aHdlFactories.push_back( rFactory ); + if( pEntries ) + { + const XMLPropertyMapEntry* pIter = pEntries; + +- // count entries +- while( pIter->msApiName ) ++ if (mbOnlyExportMappings) ++ { ++ while( pIter->msApiName ) ++ { ++ if (!pIter->mbImportOnly) ++ { ++ XMLPropertySetMapperEntry_Impl aEntry( *pIter, rFactory ); ++ aMapEntries.push_back( aEntry ); ++ } ++ pIter++; ++ } ++ } ++ else + { +- XMLPropertySetMapperEntry_Impl aEntry( *pIter, rFactory ); +- aMapEntries.push_back( aEntry ); +- pIter++; ++ while( pIter->msApiName ) ++ { ++ XMLPropertySetMapperEntry_Impl aEntry( *pIter, rFactory ); ++ aMapEntries.push_back( aEntry ); ++ pIter++; ++ } + } + } + } +@@ -104,7 +123,8 @@ void XMLPropertySetMapper::AddMapperEntry( + aEIter != rMapper->aMapEntries.end(); + ++aEIter ) + { +- aMapEntries.push_back( *aEIter ); ++ if (!mbOnlyExportMappings || !(*aEIter).bImportOnly) ++ aMapEntries.push_back( *aEIter ); + } + } + +diff --git a/xmloff/source/style/xmlstyle.cxx b/xmloff/source/style/xmlstyle.cxx +index c54d7ff..7ca0b20 100644 +--- a/xmloff/source/style/xmlstyle.cxx ++++ b/xmloff/source/style/xmlstyle.cxx +@@ -677,7 +677,7 @@ UniReference < SvXMLImportPropertyMapper > SvXMLStylesContext::GetImportProperty + case XML_STYLE_FAMILY_SCH_CHART_ID: + if( ! mxChartImpPropMapper.is() ) + { +- XMLPropertySetMapper *pPropMapper = new XMLChartPropertySetMapper(); ++ XMLPropertySetMapper *pPropMapper = new XMLChartPropertySetMapper( false ); + mxChartImpPropMapper = new XMLChartImportPropertyMapper( pPropMapper, GetImport() ); + } + xMapper = mxChartImpPropMapper; +@@ -686,7 +686,7 @@ UniReference < SvXMLImportPropertyMapper > SvXMLStylesContext::GetImportProperty + if( ! mxPageImpPropMapper.is() ) + { + XMLPropertySetMapper *pPropMapper = +- new XMLPageMasterPropSetMapper(); ++ new XMLPageMasterPropSetMapper( false ); + mxPageImpPropMapper = + new PageMasterImportPropertyMapper( pPropMapper, + ((SvXMLStylesContext*)this)->GetImport() ); +diff --git a/xmloff/source/table/XMLTableExport.cxx b/xmloff/source/table/XMLTableExport.cxx +index b710ade..611273d 100644 +--- a/xmloff/source/table/XMLTableExport.cxx ++++ b/xmloff/source/table/XMLTableExport.cxx +@@ -54,10 +54,10 @@ using namespace ::com::sun::star::style; + + // -------------------------------------------------------------------- + +-#define _MAP(name,prefix,token,type,context) { name, sizeof(name)-1, prefix, token, type, context, SvtSaveOptions::ODFVER_010 } ++#define _MAP(name,prefix,token,type,context) { name, sizeof(name)-1, prefix, token, type, context, SvtSaveOptions::ODFVER_010, false } + #define CMAP(name,prefix,token,type,context) _MAP(name,prefix,token,type|XML_TYPE_PROP_TABLE_COLUMN,context) + #define RMAP(name,prefix,token,type,context) _MAP(name,prefix,token,type|XML_TYPE_PROP_TABLE_ROW,context) +-#define MAP_END { 0L, 0, 0, XML_EMPTY, 0, 0, SvtSaveOptions::ODFVER_010 } ++#define MAP_END { 0L, 0, 0, XML_EMPTY, 0, 0, SvtSaveOptions::ODFVER_010, false } + + // -------------------------------------------------------------------- + +@@ -163,8 +163,8 @@ XMLTableExport::XMLTableExport(SvXMLExport& rExp, const rtl::Reference< SvXMLExp + mxCellExportPropertySetMapper = xExportPropertyMapper; + mxCellExportPropertySetMapper->ChainExportMapper(XMLTextParagraphExport::CreateParaExtPropMapper(rExp)); + +- mxRowExportPropertySetMapper = new SvXMLExportPropertyMapper( new XMLPropertySetMapper( getRowPropertiesMap(), xFactoryRef.get() ) ); +- mxColumnExportPropertySetMapper = new SvXMLExportPropertyMapper( new XMLPropertySetMapper( getColumnPropertiesMap(), xFactoryRef.get() ) ); ++ mxRowExportPropertySetMapper = new SvXMLExportPropertyMapper( new XMLPropertySetMapper( getRowPropertiesMap(), xFactoryRef.get(), true ) ); ++ mxColumnExportPropertySetMapper = new SvXMLExportPropertyMapper( new XMLPropertySetMapper( getColumnPropertiesMap(), xFactoryRef.get(), true ) ); + + mrExport.GetAutoStylePool()->AddFamily(XML_STYLE_FAMILY_TABLE_COLUMN, + OUString(XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_NAME), +diff --git a/xmloff/source/table/XMLTableImport.cxx b/xmloff/source/table/XMLTableImport.cxx +index 5925490..1f84765 100644 +--- a/xmloff/source/table/XMLTableImport.cxx ++++ b/xmloff/source/table/XMLTableImport.cxx +@@ -205,11 +205,10 @@ XMLTableImport::XMLTableImport( SvXMLImport& rImport, const rtl::Reference< XMLP + mxCellImportPropertySetMapper = new SvXMLImportPropertyMapper( xCellPropertySetMapper.get(), rImport ); + mxCellImportPropertySetMapper->ChainImportMapper(XMLTextImportHelper::CreateParaExtPropMapper(rImport)); + +- +- UniReference < XMLPropertySetMapper > xRowMapper( new XMLPropertySetMapper( getRowPropertiesMap(), xFactoryRef.get() ) ); ++ UniReference < XMLPropertySetMapper > xRowMapper( new XMLPropertySetMapper( getRowPropertiesMap(), xFactoryRef.get(), false ) ); + mxRowImportPropertySetMapper = new SvXMLImportPropertyMapper( xRowMapper, rImport ); + +- UniReference < XMLPropertySetMapper > xColMapper( new XMLPropertySetMapper( getColumnPropertiesMap(), xFactoryRef.get() ) ); ++ UniReference < XMLPropertySetMapper > xColMapper( new XMLPropertySetMapper( getColumnPropertiesMap(), xFactoryRef.get(), false ) ); + mxColumnImportPropertySetMapper = new SvXMLImportPropertyMapper( xColMapper, rImport ); + } + +diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx +index 24221a6..42e0576 100644 +--- a/xmloff/source/text/txtimp.cxx ++++ b/xmloff/source/text/txtimp.cxx +@@ -1001,23 +1001,23 @@ XMLTextImportHelper::XMLTextImportHelper( + } + + XMLPropertySetMapper *pPropMapper = +- new XMLTextPropertySetMapper( TEXT_PROP_MAP_PARA ); ++ new XMLTextPropertySetMapper( TEXT_PROP_MAP_PARA, false ); + m_pImpl->m_xParaImpPrMap = + new XMLTextImportPropertyMapper( pPropMapper, rImport ); + +- pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT ); ++ pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT, false ); + m_pImpl->m_xTextImpPrMap = + new XMLTextImportPropertyMapper( pPropMapper, rImport ); + +- pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_FRAME ); ++ pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_FRAME, false ); + m_pImpl->m_xFrameImpPrMap = + new XMLTextImportPropertyMapper( pPropMapper, rImport ); + +- pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_SECTION ); ++ pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_SECTION, false ); + m_pImpl->m_xSectionImpPrMap = + new XMLTextImportPropertyMapper( pPropMapper, rImport ); + +- pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_RUBY ); ++ pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_RUBY, false ); + m_pImpl->m_xRubyImpPrMap = + new SvXMLImportPropertyMapper( pPropMapper, rImport ); + } +@@ -1029,25 +1029,25 @@ XMLTextImportHelper::~XMLTextImportHelper() + SvXMLImportPropertyMapper *XMLTextImportHelper::CreateShapeExtPropMapper(SvXMLImport& rImport) + { + XMLPropertySetMapper *pPropMapper = +- new XMLTextPropertySetMapper( TEXT_PROP_MAP_FRAME ); ++ new XMLTextPropertySetMapper( TEXT_PROP_MAP_FRAME, false ); + return new XMLTextImportPropertyMapper( pPropMapper, rImport ); + } + + SvXMLImportPropertyMapper *XMLTextImportHelper::CreateParaExtPropMapper(SvXMLImport& rImport) + { + XMLPropertySetMapper *pPropMapper = +- new XMLTextPropertySetMapper( TEXT_PROP_MAP_SHAPE_PARA ); ++ new XMLTextPropertySetMapper( TEXT_PROP_MAP_SHAPE_PARA, false ); + return new XMLTextImportPropertyMapper( pPropMapper, rImport ); + } + + SvXMLImportPropertyMapper *XMLTextImportHelper::CreateParaDefaultExtPropMapper(SvXMLImport& rImport) + { + XMLPropertySetMapper* pPropMapper = +- new XMLTextPropertySetMapper( TEXT_PROP_MAP_SHAPE_PARA ); ++ new XMLTextPropertySetMapper( TEXT_PROP_MAP_SHAPE_PARA, false ); + SvXMLImportPropertyMapper* pImportMapper = new XMLTextImportPropertyMapper( pPropMapper, rImport ); + + pPropMapper = +- new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT_ADDITIONAL_DEFAULTS ); ++ new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT_ADDITIONAL_DEFAULTS, false ); + pImportMapper->ChainImportMapper( new XMLTextImportPropertyMapper( pPropMapper, rImport ) ); + + return pImportMapper; +@@ -1058,7 +1058,7 @@ SvXMLImportPropertyMapper* + SvXMLImport& rImport ) + { + XMLPropertySetMapper *pPropMapper = +- new XMLTextPropertySetMapper( TEXT_PROP_MAP_TABLE_DEFAULTS ); ++ new XMLTextPropertySetMapper( TEXT_PROP_MAP_TABLE_DEFAULTS, false ); + return new SvXMLImportPropertyMapper( pPropMapper, rImport ); + } + +@@ -1067,7 +1067,7 @@ SvXMLImportPropertyMapper* + SvXMLImport& rImport ) + { + XMLPropertySetMapper *pPropMapper = +- new XMLTextPropertySetMapper( TEXT_PROP_MAP_TABLE_ROW_DEFAULTS ); ++ new XMLTextPropertySetMapper( TEXT_PROP_MAP_TABLE_ROW_DEFAULTS, false ); + return new SvXMLImportPropertyMapper( pPropMapper, rImport ); + } + +diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx +index 3b5933b..e09b6a2 100644 +--- a/xmloff/source/text/txtparae.cxx ++++ b/xmloff/source/text/txtparae.cxx +@@ -1273,7 +1273,7 @@ XMLTextParagraphExport::XMLTextParagraphExport( + sTextFieldStartEnd( "TextFieldStartEnd" ), + aCharStyleNamesPropInfoCache( sCharStyleNames ) + { +- UniReference < XMLPropertySetMapper > xPropMapper(new XMLTextPropertySetMapper( TEXT_PROP_MAP_PARA )); ++ UniReference < XMLPropertySetMapper > xPropMapper(new XMLTextPropertySetMapper( TEXT_PROP_MAP_PARA, true )); + xParaPropMapper = new XMLTextExportPropertySetMapper( xPropMapper, + GetExport() ); + +@@ -1282,7 +1282,7 @@ XMLTextParagraphExport::XMLTextParagraphExport( + rAutoStylePool.AddFamily( XML_STYLE_FAMILY_TEXT_PARAGRAPH, sFamily, + xParaPropMapper, aPrefix ); + +- xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT ); ++ xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT, true ); + xTextPropMapper = new XMLTextExportPropertySetMapper( xPropMapper, + GetExport() ); + sFamily = OUString( GetXMLToken(XML_TEXT) ); +@@ -1290,7 +1290,7 @@ XMLTextParagraphExport::XMLTextParagraphExport( + rAutoStylePool.AddFamily( XML_STYLE_FAMILY_TEXT_TEXT, sFamily, + xTextPropMapper, aPrefix ); + +- xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_AUTO_FRAME ); ++ xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_AUTO_FRAME, true ); + xAutoFramePropMapper = new XMLTextExportPropertySetMapper( xPropMapper, + GetExport() ); + sFamily = OUString( XML_STYLE_FAMILY_SD_GRAPHICS_NAME ); +@@ -1298,7 +1298,7 @@ XMLTextParagraphExport::XMLTextParagraphExport( + rAutoStylePool.AddFamily( XML_STYLE_FAMILY_TEXT_FRAME, sFamily, + xAutoFramePropMapper, aPrefix ); + +- xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_SECTION ); ++ xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_SECTION, true ); + xSectionPropMapper = new XMLTextExportPropertySetMapper( xPropMapper, + GetExport() ); + sFamily = OUString( GetXMLToken( XML_SECTION ) ); +@@ -1306,14 +1306,14 @@ XMLTextParagraphExport::XMLTextParagraphExport( + rAutoStylePool.AddFamily( XML_STYLE_FAMILY_TEXT_SECTION, sFamily, + xSectionPropMapper, aPrefix ); + +- xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_RUBY ); ++ xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_RUBY, true ); + xRubyPropMapper = new SvXMLExportPropertyMapper( xPropMapper ); + sFamily = OUString( GetXMLToken( XML_RUBY ) ); + aPrefix = OUString( "Ru" ); + rAutoStylePool.AddFamily( XML_STYLE_FAMILY_TEXT_RUBY, sFamily, + xRubyPropMapper, aPrefix ); + +- xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_FRAME ); ++ xPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_FRAME, true ); + xFramePropMapper = new XMLTextExportPropertySetMapper( xPropMapper, + GetExport() ); + +@@ -1357,7 +1357,7 @@ SvXMLExportPropertyMapper *XMLTextParagraphExport::CreateShapeExtPropMapper( + SvXMLExport& rExport ) + { + UniReference < XMLPropertySetMapper > xPropMapper = +- new XMLTextPropertySetMapper( TEXT_PROP_MAP_SHAPE ); ++ new XMLTextPropertySetMapper( TEXT_PROP_MAP_SHAPE, true ); + return new XMLTextExportPropertySetMapper( xPropMapper, rExport ); + } + +@@ -1365,7 +1365,7 @@ SvXMLExportPropertyMapper *XMLTextParagraphExport::CreateCharExtPropMapper( + SvXMLExport& rExport) + { + XMLPropertySetMapper *pPropMapper = +- new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT ); ++ new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT, true ); + return new XMLTextExportPropertySetMapper( pPropMapper, rExport ); + } + +@@ -1373,7 +1373,7 @@ SvXMLExportPropertyMapper *XMLTextParagraphExport::CreateParaExtPropMapper( + SvXMLExport& rExport) + { + XMLPropertySetMapper *pPropMapper = +- new XMLTextPropertySetMapper( TEXT_PROP_MAP_SHAPE_PARA ); ++ new XMLTextPropertySetMapper( TEXT_PROP_MAP_SHAPE_PARA, true ); + return new XMLTextExportPropertySetMapper( pPropMapper, rExport ); + } + +@@ -1381,7 +1381,7 @@ SvXMLExportPropertyMapper *XMLTextParagraphExport::CreateParaDefaultExtPropMappe + SvXMLExport& rExport) + { + XMLPropertySetMapper *pPropMapper = +- new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT_ADDITIONAL_DEFAULTS ); ++ new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT_ADDITIONAL_DEFAULTS, true ); + return new XMLTextExportPropertySetMapper( pPropMapper, rExport ); + } + +diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx +index def8335..26d04d8 100644 +--- a/xmloff/source/text/txtprmap.cxx ++++ b/xmloff/source/text/txtprmap.cxx +@@ -31,13 +31,13 @@ using namespace ::com::sun::star::uno; + using namespace ::xmloff::token; + + #define _M_E( a, p, l, t, c ) \ +- { a, sizeof(a)-1, XML_NAMESPACE_##p, XML_##l, t, c, SvtSaveOptions::ODFVER_010 } ++ { a, sizeof(a)-1, XML_NAMESPACE_##p, XML_##l, t, c, SvtSaveOptions::ODFVER_010, false } + + #define _M_EV( a, p, l, t, c, v ) \ +- { a, sizeof(a)-1, XML_NAMESPACE_##p, XML_##l, t, c, v } ++ { a, sizeof(a)-1, XML_NAMESPACE_##p, XML_##l, t, c, v, false } + + #define _M_ED( a, p, l, t, c ) \ +- { a, sizeof(a)-1, XML_NAMESPACE_##p, XML_##l, (t) | MID_FLAG_DEFAULT_ITEM_EXPORT, c, SvtSaveOptions::ODFVER_010 } ++ { a, sizeof(a)-1, XML_NAMESPACE_##p, XML_##l, (t) | MID_FLAG_DEFAULT_ITEM_EXPORT, c, SvtSaveOptions::ODFVER_010, false } + + // text properties + #define MT_E( a, p, l, t, c ) \ +@@ -68,7 +68,7 @@ using namespace ::xmloff::token; + _M_E( a, p, l, (t|XML_TYPE_PROP_RUBY), c ) + + #define M_END() \ +- { NULL, 0, 0, XML_TOKEN_INVALID, 0, 0, SvtSaveOptions::ODFVER_010 } ++ { NULL, 0, 0, XML_TOKEN_INVALID, 0, 0, SvtSaveOptions::ODFVER_010, false } + + + XMLPropertyMapEntry aXMLParaPropMap[] = +@@ -88,7 +88,7 @@ XMLPropertyMapEntry aXMLParaPropMap[] = + MP_E( "ParaTopMarginRelative", FO, MARGIN_TOP, XML_TYPE_PERCENT16, CTF_PARATOPMARGIN_REL ), + MP_E( "ParaBottomMargin", FO, MARGIN_BOTTOM, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARABOTTOMMARGIN ), + MP_E( "ParaBottomMarginRelative",FO, MARGIN_BOTTOM, XML_TYPE_PERCENT16, CTF_PARABOTTOMMARGIN_REL ), +- { "ParaContextMargin", sizeof("ParaContextMargin")-1, XML_NAMESPACE_STYLE, XML_CONTEXTUAL_SPACING, XML_TYPE_BOOL|XML_TYPE_PROP_PARAGRAPH, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT }, ++ { "ParaContextMargin", sizeof("ParaContextMargin")-1, XML_NAMESPACE_STYLE, XML_CONTEXTUAL_SPACING, XML_TYPE_BOOL|XML_TYPE_PROP_PARAGRAPH, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT, false }, + // RES_CHRATR_CASEMAP + MT_E( "CharCaseMap", FO, FONT_VARIANT, XML_TYPE_TEXT_CASEMAP_VAR, 0 ), + MT_E( "CharCaseMap", FO, TEXT_TRANSFORM, XML_TYPE_TEXT_CASEMAP, 0 ), +@@ -136,9 +136,9 @@ XMLPropertyMapEntry aXMLParaPropMap[] = + // RES_CHRATR_WEIGHT + MT_E( "CharWeight", FO, FONT_WEIGHT, XML_TYPE_TEXT_WEIGHT, 0 ), + // RES_CHRATR_RSID +- { "Rsid", sizeof("Rsid")-1, XML_NAMESPACE_OFFICE_EXT, XML_RSID, XML_TYPE_HEX|XML_TYPE_PROP_TEXT, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT }, ++ { "Rsid", sizeof("Rsid")-1, XML_NAMESPACE_OFFICE_EXT, XML_RSID, XML_TYPE_HEX|XML_TYPE_PROP_TEXT, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT, false }, + // RES_PARATR_RSID +- { "ParRsid", sizeof("ParRsid")-1, XML_NAMESPACE_OFFICE_EXT, XML_PARRSID, XML_TYPE_HEX|XML_TYPE_PROP_TEXT, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT }, ++ { "ParRsid", sizeof("ParRsid")-1, XML_NAMESPACE_OFFICE_EXT, XML_PARRSID, XML_TYPE_HEX|XML_TYPE_PROP_TEXT, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT, false }, + // RES_CHRATR_WORDLINEMODE + MT_E( "CharWordMode", STYLE, TEXT_UNDERLINE_MODE, XML_TYPE_TEXT_LINE_MODE|MID_FLAG_MERGE_PROPERTY, 0 ), + MT_E( "CharWordMode", STYLE, TEXT_OVERLINE_MODE, XML_TYPE_TEXT_LINE_MODE|MID_FLAG_MERGE_PROPERTY, 0 ), +@@ -434,9 +434,9 @@ XMLPropertyMapEntry aXMLTextPropMap[] = + // RES_CHRATR_WEIGHT + MT_E( "CharWeight", FO, FONT_WEIGHT, XML_TYPE_TEXT_WEIGHT, 0 ), + // RES_CHRATR_RSID +- { "Rsid", sizeof("Rsid")-1, XML_NAMESPACE_OFFICE_EXT, XML_RSID, XML_TYPE_HEX|XML_TYPE_PROP_TEXT, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT }, ++ { "Rsid", sizeof("Rsid")-1, XML_NAMESPACE_OFFICE_EXT, XML_RSID, XML_TYPE_HEX|XML_TYPE_PROP_TEXT, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT, false }, + // RES_PARATR_RSID +- { "ParRsid", sizeof("ParRsid")-1, XML_NAMESPACE_OFFICE_EXT, XML_PARRSID, XML_TYPE_HEX|XML_TYPE_PROP_TEXT, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT }, ++ { "ParRsid", sizeof("ParRsid")-1, XML_NAMESPACE_OFFICE_EXT, XML_PARRSID, XML_TYPE_HEX|XML_TYPE_PROP_TEXT, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT, false }, + // RES_CHRATR_WORDLINEMODE + MT_E( "CharWordMode", STYLE, TEXT_UNDERLINE_MODE, XML_TYPE_TEXT_LINE_MODE|MID_FLAG_MERGE_PROPERTY, 0 ), + MT_E( "CharWordMode", STYLE, TEXT_OVERLINE_MODE, XML_TYPE_TEXT_LINE_MODE|MID_FLAG_MERGE_PROPERTY, 0 ), +@@ -890,9 +890,9 @@ const XMLPropertyMapEntry* XMLTextPropertySetMapper::getPropertyMapForType( sal_ + return lcl_txtprmap_getMap( _nType ); + } + +-XMLTextPropertySetMapper::XMLTextPropertySetMapper( sal_uInt16 nType ) : ++XMLTextPropertySetMapper::XMLTextPropertySetMapper( sal_uInt16 nType, bool bForExport ) : + XMLPropertySetMapper( lcl_txtprmap_getMap( nType ), +- new XMLTextPropertyHandlerFactory ) ++ new XMLTextPropertyHandlerFactory, bForExport ) + { + } + +diff --git a/xmloff/source/text/txtstyle.cxx b/xmloff/source/text/txtstyle.cxx +index b507b09..c3dd060 100644 +--- a/xmloff/source/text/txtstyle.cxx ++++ b/xmloff/source/text/txtstyle.cxx +@@ -128,7 +128,7 @@ void XMLTextParagraphExport::exportTextStyles( sal_Bool bUsed, sal_Bool bProg ) + GetXMLToken(XML_TABLE), + new XMLTextExportPropertySetMapper( + new XMLTextPropertySetMapper( +- TEXT_PROP_MAP_TABLE_DEFAULTS ), ++ TEXT_PROP_MAP_TABLE_DEFAULTS, true ), + GetExport() ) ); + + exportDefaultStyle( +@@ -136,7 +136,7 @@ void XMLTextParagraphExport::exportTextStyles( sal_Bool bUsed, sal_Bool bProg ) + GetXMLToken(XML_TABLE_ROW), + new XMLTextExportPropertySetMapper( + new XMLTextPropertySetMapper( +- TEXT_PROP_MAP_TABLE_ROW_DEFAULTS ), ++ TEXT_PROP_MAP_TABLE_ROW_DEFAULTS, true ), + GetExport() ) ); + } + } +-- +1.8.4.2 + diff --git a/SOURCES/0081-prepare-to-read-loext-vertical-justify-fdo-72922.patch b/SOURCES/0081-prepare-to-read-loext-vertical-justify-fdo-72922.patch new file mode 100644 index 0000000..7d9377d --- /dev/null +++ b/SOURCES/0081-prepare-to-read-loext-vertical-justify-fdo-72922.patch @@ -0,0 +1,42 @@ +From 494e4accc0634befb6ed7534faf3e2519bf5cca1 Mon Sep 17 00:00:00 2001 +From: Eike Rathke +Date: Fri, 20 Dec 2013 17:12:00 +0100 +Subject: [PATCH 081/109] prepare to read loext:vertical-justify, fdo#72922 + +Change-Id: I56d72d5cb8ea95aa63d4659899cba2f295ce9bea +(cherry picked from commit 11a73705d9dd10ebefa2bcdefa560f55e7024a1b) +Reviewed-on: https://gerrit.libreoffice.org/7150 +Reviewed-by: Miklos Vajna +Tested-by: Miklos Vajna +--- + sc/source/filter/xml/xmlstyle.cxx | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/sc/source/filter/xml/xmlstyle.cxx b/sc/source/filter/xml/xmlstyle.cxx +index 88fdef7..3264a5d 100644 +--- a/sc/source/filter/xml/xmlstyle.cxx ++++ b/sc/source/filter/xml/xmlstyle.cxx +@@ -55,7 +55,10 @@ using namespace ::xmloff::token; + using namespace ::formula; + + #define MAP(name,prefix,token,type,context) { name, sizeof(name)-1, prefix, token, type, context, SvtSaveOptions::ODFVER_010, false } ++// extensions import/export + #define MAP_EXT(name,prefix,token,type,context) { name, sizeof(name)-1, prefix, token, type, context, SvtSaveOptions::ODFVER_012_EXT_COMPAT, false } ++// extensions import only ++#define MAP_EXT_I(name,prefix,token,type,context) { name, sizeof(name)-1, prefix, token, type, context, SvtSaveOptions::ODFVER_012_EXT_COMPAT, true } + #define MAP_END() { NULL, 0, 0, XML_TOKEN_INVALID, 0, 0, SvtSaveOptions::ODFVER_010, false } + + const XMLPropertyMapEntry aXMLScCellStylesProperties[] = +@@ -106,7 +109,8 @@ const XMLPropertyMapEntry aXMLScCellStylesProperties[] = + MAP( "UserDefinedAttributes", XML_NAMESPACE_TEXT, XML_XMLNS, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_ATTRIBUTE_CONTAINER | MID_FLAG_SPECIAL_ITEM, 0 ), + MAP( "ValidationXML", XML_NAMESPACE_TABLE, XML_CONTENT_VALIDATION, XML_TYPE_PROP_TABLE_CELL|XML_TYPE_BUILDIN_CMP_ONLY, CTF_SC_VALIDATION ), + MAP( "VertJustify", XML_NAMESPACE_STYLE, XML_VERTICAL_ALIGN, XML_TYPE_PROP_TABLE_CELL|XML_SC_TYPE_VERTJUSTIFY, 0), +- MAP_EXT( SC_UNONAME_CELLVJUS_METHOD, XML_NAMESPACE_STYLE, XML_VERTICAL_JUSTIFY, XML_TYPE_PROP_TABLE_CELL|XML_SC_TYPE_VERTJUSTIFY_METHOD, 0 ), ++ MAP_EXT( SC_UNONAME_CELLVJUS_METHOD, XML_NAMESPACE_STYLE, XML_VERTICAL_JUSTIFY, XML_TYPE_PROP_TABLE_CELL|XML_SC_TYPE_VERTJUSTIFY_METHOD, 0 ), // proposed ODF 1.2+ ++ MAP_EXT_I( SC_UNONAME_CELLVJUS_METHOD, XML_NAMESPACE_LO_EXT, XML_VERTICAL_JUSTIFY, XML_TYPE_PROP_TABLE_CELL|XML_SC_TYPE_VERTJUSTIFY_METHOD, 0 ), // extension namespace + MAP_END() + }; + +-- +1.8.4.2 + diff --git a/SOURCES/0082-prepare-to-accept-loext-contextual-spacing-fdo-58112.patch b/SOURCES/0082-prepare-to-accept-loext-contextual-spacing-fdo-58112.patch new file mode 100644 index 0000000..57c5635 --- /dev/null +++ b/SOURCES/0082-prepare-to-accept-loext-contextual-spacing-fdo-58112.patch @@ -0,0 +1,43 @@ +From 6c90074b8dcfbb10ab03acfa082ac746ea38df6e Mon Sep 17 00:00:00 2001 +From: Eike Rathke +Date: Fri, 20 Dec 2013 21:15:03 +0100 +Subject: [PATCH 082/109] prepare to accept loext:contextual-spacing, fdo#58112 + +Change-Id: I58e151743bf910b8b51f1b453e0bfcb4ed767d9d +(cherry picked from commit ef5e7b69440baa9f222d1ec870668d31d08268f0) +Reviewed-on: https://gerrit.libreoffice.org/7151 +Reviewed-by: Miklos Vajna +Tested-by: Miklos Vajna +--- + xmloff/source/text/txtprmap.cxx | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx +index 26d04d8..abdba43 100644 +--- a/xmloff/source/text/txtprmap.cxx ++++ b/xmloff/source/text/txtprmap.cxx +@@ -67,6 +67,11 @@ using namespace ::xmloff::token; + #define MR_E( a, p, l, t, c ) \ + _M_E( a, p, l, (t|XML_TYPE_PROP_RUBY), c ) + ++// extensions import/export ++#define MAP_EXT(name,prefix,token,type,context) { name, sizeof(name)-1, prefix, token, type, context, SvtSaveOptions::ODFVER_012_EXT_COMPAT, false } ++// extensions import only ++#define MAP_EXT_I(name,prefix,token,type,context) { name, sizeof(name)-1, prefix, token, type, context, SvtSaveOptions::ODFVER_012_EXT_COMPAT, true } ++ + #define M_END() \ + { NULL, 0, 0, XML_TOKEN_INVALID, 0, 0, SvtSaveOptions::ODFVER_010, false } + +@@ -88,7 +93,8 @@ XMLPropertyMapEntry aXMLParaPropMap[] = + MP_E( "ParaTopMarginRelative", FO, MARGIN_TOP, XML_TYPE_PERCENT16, CTF_PARATOPMARGIN_REL ), + MP_E( "ParaBottomMargin", FO, MARGIN_BOTTOM, XML_TYPE_MEASURE|MID_FLAG_MULTI_PROPERTY, CTF_PARABOTTOMMARGIN ), + MP_E( "ParaBottomMarginRelative",FO, MARGIN_BOTTOM, XML_TYPE_PERCENT16, CTF_PARABOTTOMMARGIN_REL ), +- { "ParaContextMargin", sizeof("ParaContextMargin")-1, XML_NAMESPACE_STYLE, XML_CONTEXTUAL_SPACING, XML_TYPE_BOOL|XML_TYPE_PROP_PARAGRAPH, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT, false }, ++ MAP_EXT( "ParaContextMargin", XML_NAMESPACE_STYLE, XML_CONTEXTUAL_SPACING, XML_TYPE_BOOL|XML_TYPE_PROP_PARAGRAPH, 0 ), // proposed ODF 1.2+ ++ MAP_EXT_I( "ParaContextMargin", XML_NAMESPACE_LO_EXT, XML_CONTEXTUAL_SPACING, XML_TYPE_BOOL|XML_TYPE_PROP_PARAGRAPH, 0 ), // extension namespace + // RES_CHRATR_CASEMAP + MT_E( "CharCaseMap", FO, FONT_VARIANT, XML_TYPE_TEXT_CASEMAP_VAR, 0 ), + MT_E( "CharCaseMap", FO, TEXT_TRANSFORM, XML_TYPE_TEXT_CASEMAP, 0 ), +-- +1.8.4.2 + diff --git a/SOURCES/0083-fdo-67370-Hyphens-are-not-visible-in-tagged-PDF.patch b/SOURCES/0083-fdo-67370-Hyphens-are-not-visible-in-tagged-PDF.patch new file mode 100644 index 0000000..0b07456 --- /dev/null +++ b/SOURCES/0083-fdo-67370-Hyphens-are-not-visible-in-tagged-PDF.patch @@ -0,0 +1,109 @@ +From 158027cd7fe1ea2faeb5d2220547b36c9cbfb9d3 Mon Sep 17 00:00:00 2001 +From: Khaled Hosny +Date: Sun, 22 Dec 2013 01:02:19 +0200 +Subject: [PATCH 083/109] fdo#67370: Hyphens are not visible in tagged PDF +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +One requirement of tagged PDF is to represent automatically inserted +hyphens using the soft hyphen (U+00AD) character, so we were doing this +by simply passing that character to text layout code when exporting a +tagged PDF (which is the literal suggestion of old PDF specification). + +This is wrong, though, since the soft hyphen is a control character and +should not have a visible output by itself (and fonts might not even +have a visible glyph there), but this happened to work because non of +the layout engines we are using treated soft hyphen specially and was +just showing whatever glyph the font had there. This broke with the +switch to HarfBuzz since it will not show any visible glyph for Unicode +control characters (by default), which is the right thing to do. + +Latest versions of PDF spec suggest using either ToUnicode mapping or an +ActualText text entry to encode the soft hyphen instead, I found it +easier to use ActualText since we already have code that handles +non-standard hyphenation using it already. + +Conflicts: + sw/source/core/text/EnhancedPDFExportHelper.cxx + sw/source/core/text/txthyph.cxx + +Change-Id: I88deadf3a806f69775b2e0ccff2f9b2f61a0f2e2 +Reviewed-on: https://gerrit.libreoffice.org/7177 +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +--- + sw/source/core/text/EnhancedPDFExportHelper.cxx | 11 +++++++++-- + sw/source/core/text/txthyph.cxx | 12 ++---------- + 2 files changed, 11 insertions(+), 12 deletions(-) + +diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx +index 3933837..9538de6 100644 +--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx ++++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx +@@ -766,7 +766,8 @@ void SwTaggedPDFHelper::SetAttributes( vcl::PDFWriter::StructElement eType ) + case vcl::PDFWriter::Span : + case vcl::PDFWriter::Quote : + case vcl::PDFWriter::Code : +- if( POR_HYPHSTR == pPor->GetWhichPor() || POR_SOFTHYPHSTR == pPor->GetWhichPor() ) ++ if( POR_HYPHSTR == pPor->GetWhichPor() || POR_SOFTHYPHSTR == pPor->GetWhichPor() || ++ POR_HYPH == pPor->GetWhichPor() || POR_SOFTHYPH == pPor->GetWhichPor() ) + bActualText = true; + else + { +@@ -789,7 +790,11 @@ void SwTaggedPDFHelper::SetAttributes( vcl::PDFWriter::StructElement eType ) + + if ( bActualText ) + { +- const String aActualTxt( rInf.GetTxt(), rInf.GetIdx(), pPor->GetLen() ); ++ String aActualTxt; ++ if (pPor->GetWhichPor() == POR_SOFTHYPH || pPor->GetWhichPor() == POR_HYPH) ++ aActualTxt = (sal_Unicode)0xad; // soft hyphen ++ else ++ aActualTxt = String(rInf.GetTxt(), rInf.GetIdx(), pPor->GetLen()); + mpPDFExtOutDevData->SetActualText( aActualTxt ); + } + +@@ -1373,6 +1378,8 @@ void SwTaggedPDFHelper::BeginInlineStructureElements() + + switch ( pPor->GetWhichPor() ) + { ++ case POR_HYPH : ++ case POR_SOFTHYPH : + // Check for alternative spelling: + case POR_HYPHSTR : + case POR_SOFTHYPHSTR : +diff --git a/sw/source/core/text/txthyph.cxx b/sw/source/core/text/txthyph.cxx +index 62b3ad4..6b32a9f 100644 +--- a/sw/source/core/text/txthyph.cxx ++++ b/sw/source/core/text/txthyph.cxx +@@ -20,7 +20,6 @@ + #include + #include + #include +-#include + #include // SwViewOptions + #include + #include +@@ -370,16 +369,9 @@ sal_Bool SwTxtPortion::CreateHyphen( SwTxtFormatInfo &rInf, SwTxtGuess &rGuess ) + * virtual SwHyphPortion::GetExpTxt() + *************************************************************************/ + +-sal_Bool SwHyphPortion::GetExpTxt( const SwTxtSizeInfo &rInf, OUString &rTxt ) const ++sal_Bool SwHyphPortion::GetExpTxt( const SwTxtSizeInfo &/*rInf*/, OUString &rTxt ) const + { +- // #i16816# tagged pdf support +- const sal_Unicode cChar = rInf.GetVsh() && +- rInf.GetVsh()->GetViewOptions()->IsPDFExport() && +- SwTaggedPDFHelper::IsExportTaggedPDF( *rInf.GetOut() ) ? +- 0xad : +- '-'; +- +- rTxt = OUString(cChar); ++ rTxt = "-"; + return sal_True; + } + +-- +1.8.4.2 + diff --git a/SOURCES/0084-fdo-72916-correct-rounding-of-time-part-of-DateTime.patch b/SOURCES/0084-fdo-72916-correct-rounding-of-time-part-of-DateTime.patch new file mode 100644 index 0000000..6b64c6e --- /dev/null +++ b/SOURCES/0084-fdo-72916-correct-rounding-of-time-part-of-DateTime.patch @@ -0,0 +1,70 @@ +From 56381a9b28dbe4caf6e3d0a92dfddcddcebe3494 Mon Sep 17 00:00:00 2001 +From: Lionel Elie Mamane +Date: Sat, 21 Dec 2013 10:37:11 +0100 +Subject: [PATCH 084/109] fdo#72916 correct rounding of time part of DateTime + +Change-Id: I135478755f9e5a844119129b470fef8de2cd0409 +--- + connectivity/source/commontools/dbconversion.cxx | 16 +++++++++++++--- + include/connectivity/dbconversion.hxx | 2 +- + 2 files changed, 14 insertions(+), 4 deletions(-) + +diff --git a/connectivity/source/commontools/dbconversion.cxx b/connectivity/source/commontools/dbconversion.cxx +index 847f45f..15276a6 100644 +--- a/connectivity/source/commontools/dbconversion.cxx ++++ b/connectivity/source/commontools/dbconversion.cxx +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -355,10 +356,15 @@ namespace dbtools + return aRet; + } + // ------------------------------------------------------------------------- +- utl::Time DBTypeConversion::toTime(double dVal) ++ utl::Time DBTypeConversion::toTime(double dVal, short nDigits) + { + sal_Int32 nDays = (sal_Int32)dVal; +- sal_Int64 nNS = static_cast((dVal - (double)nDays) * fNanoSecondsPerDay + 0.5); ++ sal_Int64 nNS; ++ { ++ double fSeconds((dVal - (double)nDays) * (fNanoSecondsPerDay / nanoSecInSec)); ++ fSeconds = ::rtl::math::round( fSeconds, nDigits ); ++ nNS = fSeconds * nanoSecInSec; ++ } + + sal_Int16 nSign; + if ( nNS < 0 ) +@@ -401,7 +407,11 @@ namespace dbtools + utl::DateTime DBTypeConversion::toDateTime(double dVal, const utl::Date& _rNullDate) + { + utl::Date aDate = toDate(dVal, _rNullDate); +- utl::Time aTime = toTime(dVal); ++ // there is not enough precision in a double to have both a date ++ // and a time up to nanoseconds -> limit to microseconds to have ++ // correct rounding, that is e.g. 13:00:00.000000000 instead of ++ // 12:59:59.999999790 ++ utl::Time aTime = toTime(dVal, 6); + + utl::DateTime xRet; + +diff --git a/include/connectivity/dbconversion.hxx b/include/connectivity/dbconversion.hxx +index 9536c79..b11442b 100644 +--- a/include/connectivity/dbconversion.hxx ++++ b/include/connectivity/dbconversion.hxx +@@ -105,7 +105,7 @@ namespace dbtools + + static ::com::sun::star::util::Date toDate(double dVal, const ::com::sun::star::util::Date& _rNullDate = getStandardDate()); + static ::com::sun::star::util::Date toDate(const OUString& _sSQLDate); +- static ::com::sun::star::util::Time toTime(double dVal); ++ static ::com::sun::star::util::Time toTime(double dVal, short nDigits = 9); + static ::com::sun::star::util::Time toTime(const OUString& _sSQLDate); + static ::com::sun::star::util::DateTime toDateTime(double dVal, const ::com::sun::star::util::Date& _rNullDate = getStandardDate()); + static ::com::sun::star::util::DateTime toDateTime(const OUString& _sSQLDate); +-- +1.8.4.2 + diff --git a/SOURCES/0085-Fix-stepping-to-the-next-change.patch b/SOURCES/0085-Fix-stepping-to-the-next-change.patch new file mode 100644 index 0000000..52cd06d --- /dev/null +++ b/SOURCES/0085-Fix-stepping-to-the-next-change.patch @@ -0,0 +1,50 @@ +From 70f90c08592ef3e50840afda20428078c25c463a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zolnai=20Tam=C3=A1s?= +Date: Fri, 27 Dec 2013 09:45:05 +0100 +Subject: [PATCH 085/109] Fix stepping to the next change +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Bug description: +In the "Accept or Reject Changes" dialog, when select a change +(it should be after the first few ones) and clicking "Accept" +or "Reject" button, acception/rejection is made but after it +not the next change is selected for futher work, +but a random one. This bug doesn't appear in all case, +just if changes are complex enough. + +Solution: +The nPos means absolute position so we have to get the next entry +with the corresponding GetEntryAtAbsPos() method. It seems simple +position can differ from absolute positions if changes are +complex enough. + +Change-Id: I7996f81c2a09c492f9334f071591291d200d533f +(cherry picked from commit dbd8a631bb23c588f52102e5dd2a61c9cd854bc3) +Reviewed-on: https://gerrit.libreoffice.org/7209 +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +--- + sw/source/ui/misc/redlndlg.cxx | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/sw/source/ui/misc/redlndlg.cxx b/sw/source/ui/misc/redlndlg.cxx +index 7885bb4..f1cc96d 100644 +--- a/sw/source/ui/misc/redlndlg.cxx ++++ b/sw/source/ui/misc/redlndlg.cxx +@@ -830,9 +830,9 @@ void SwRedlineAcceptDlg::CallAcceptReject( sal_Bool bSelect, sal_Bool bAccept ) + { + if( nPos >= pTable->GetEntryCount() ) + nPos = pTable->GetEntryCount() - 1; +- pEntry = pTable->GetEntry( nPos ); ++ pEntry = pTable->GetEntryAtAbsPos( nPos ); + if( !pEntry && nPos-- ) +- pEntry = pTable->GetEntry( nPos ); ++ pEntry = pTable->GetEntryAtAbsPos( nPos ); + if( pEntry ) + { + pTable->Select( pEntry ); +-- +1.8.4.2 + diff --git a/SOURCES/0086-DOCX-import-close-rPrChange-properly.patch b/SOURCES/0086-DOCX-import-close-rPrChange-properly.patch new file mode 100644 index 0000000..c6665be --- /dev/null +++ b/SOURCES/0086-DOCX-import-close-rPrChange-properly.patch @@ -0,0 +1,56 @@ +From a5d5aa022c2ae04e1d230050a773b3983a410cde Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zolnai=20Tam=C3=A1s?= +Date: Tue, 24 Dec 2013 08:05:58 +0100 +Subject: [PATCH 086/109] DOCX import: close rPrChange properly. + +Call endtrackchanges when rPrChange ends so the +corresponding redline will be removed. + +Conflicts: + sw/qa/extras/ooxmlimport/ooxmlimport.cxx +Reviewed on: + https://gerrit.libreoffice.org/7194 + +Change-Id: I4091d7b54e0a74f3158cc979f210577a2dc29783 +--- + sw/qa/extras/inc/swmodeltestbase.hxx | 6 ++++++ + sw/qa/extras/ooxmlimport/data/rprchange_closed.docx | Bin 0 -> 24695 bytes + sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 9 +++++++++ + writerfilter/source/ooxml/model.xml | 3 +++ + 4 files changed, 18 insertions(+) + create mode 100644 sw/qa/extras/ooxmlimport/data/rprchange_closed.docx + +diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx +index a9b2368..727580d 100644 +--- a/sw/qa/extras/inc/swmodeltestbase.hxx ++++ b/sw/qa/extras/inc/swmodeltestbase.hxx +@@ -166,6 +166,12 @@ protected: + return data; + } + ++ bool hasProperty(const uno::Reference& obj, const OUString& name) const ++ { ++ uno::Reference properties(obj, uno::UNO_QUERY_THROW); ++ return properties->getPropertySetInfo()->hasPropertyByName(name); ++ } ++ + /// Get number of paragraphs of the document. + int getParagraphs() + { +diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml +index 4fad4ba..d368dab 100644 +--- a/writerfilter/source/ooxml/model.xml ++++ b/writerfilter/source/ooxml/model.xml +@@ -22077,6 +22077,9 @@ + + + ++ ++ ++ + + + +-- +1.8.4.2 + diff --git a/SOURCES/0088-fdo-65090-RTF-filter-import-RTF_CLMGF-and-RTF_CLMRG.patch b/SOURCES/0088-fdo-65090-RTF-filter-import-RTF_CLMGF-and-RTF_CLMRG.patch new file mode 100644 index 0000000..34624bb --- /dev/null +++ b/SOURCES/0088-fdo-65090-RTF-filter-import-RTF_CLMGF-and-RTF_CLMRG.patch @@ -0,0 +1,284 @@ +From 8b8152b8fbfb39f44fe0441decd3a746684f4382 Mon Sep 17 00:00:00 2001 +From: Miklos Vajna +Date: Fri, 27 Dec 2013 20:46:50 +0100 +Subject: [PATCH 088/109] fdo#65090 RTF filter: import RTF_CLMGF and RTF_CLMRG +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +These describe an explicit horizontal merge, that is not something Word +itself creates, but it turns out the Calc RTF export does. + +(cherry picked from commits bb562304c1e1c61a882e6db65806cfdf8601bcbf, +97dcf77841d19d344d58d5bdacdab141cdea4817 and +6eb02ac8a77f9f89f256b190281029f6cbd60d95) + +Conflicts: + sw/qa/extras/ooxmlimport/ooxmlimport.cxx + writerfilter/source/dmapper/PropertyIds.cxx + writerfilter/source/dmapper/PropertyIds.hxx + writerfilter/source/rtftok/rtfdocumentimpl.cxx + +Change-Id: I1b6ec10bb8e8bd40e24791ccc96f2f066dd0d5d5 +Reviewed-on: https://gerrit.libreoffice.org/7220 +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +--- + sw/qa/extras/ooxmlimport/data/fdo65090.docx | Bin 0 -> 10409 bytes + sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 12 ++++++ + sw/qa/extras/rtfimport/data/fdo65090.rtf | 6 +++ + sw/qa/extras/rtfimport/rtfimport.cxx | 12 ++++++ + sw/source/core/unocore/unotbl.cxx | 2 +- + .../source/dmapper/DomainMapperTableHandler.cxx | 43 ++++++++++++++++++++- + .../source/dmapper/DomainMapperTableHandler.hxx | 17 +++++++- + .../source/dmapper/DomainMapperTableManager.cxx | 8 ++++ + writerfilter/source/dmapper/PropertyIds.cxx | 1 + + writerfilter/source/dmapper/PropertyIds.hxx | 1 + + writerfilter/source/rtftok/rtfdocumentimpl.cxx | 12 ++++++ + 11 files changed, 110 insertions(+), 4 deletions(-) + create mode 100644 sw/qa/extras/ooxmlimport/data/fdo65090.docx + create mode 100644 sw/qa/extras/rtfimport/data/fdo65090.rtf + +diff --git a/sw/qa/extras/rtfimport/data/fdo65090.rtf b/sw/qa/extras/rtfimport/data/fdo65090.rtf +new file mode 100644 +index 0000000..8a3eabd +--- /dev/null ++++ b/sw/qa/extras/rtfimport/data/fdo65090.rtf +@@ -0,0 +1,6 @@ ++{\rtf\ansi ++{ ++\trowd\trgaph30\trleft-30\trrh242\clmgf\clvertalc\cellx1280\clmrg\clvertalb\cellx2560\clvertalb\cellx3840\pard\plain\intbl ++\qc a\cell\cell\ql b\cell\row ++} ++} +diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx +index 687baac..eca16e3 100644 +--- a/sw/qa/extras/rtfimport/rtfimport.cxx ++++ b/sw/qa/extras/rtfimport/rtfimport.cxx +@@ -161,6 +161,7 @@ public: + void testFdo68291(); + void testFdo69384(); + void testFdo70221(); ++ void testFdo65090(); + + CPPUNIT_TEST_SUITE(Test); + #if !defined(MACOSX) && !defined(WNT) +@@ -306,6 +307,7 @@ void Test::run() + {"fdo68291.odt", &Test::testFdo68291}, + {"hello.rtf", &Test::testFdo69384}, + {"fdo70221.rtf", &Test::testFdo70221}, ++ {"fdo65090.rtf", &Test::testFdo65090}, + }; + header(); + for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) +@@ -1488,6 +1490,16 @@ void Test::testFdo70221() + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount()); + } + ++void Test::testFdo65090() ++{ ++ uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); ++ uno::Reference xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); ++ uno::Reference xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); ++ uno::Reference xTableRows(xTextTable->getRows(), uno::UNO_QUERY); ++ // The first row had 3 cells, instead of a horizontally merged one and a normal one (2 -> 1 separator). ++ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty< uno::Sequence >(xTableRows->getByIndex(0), "TableColumnSeparators").getLength()); ++} ++ + CPPUNIT_TEST_SUITE_REGISTRATION(Test); + + CPPUNIT_PLUGIN_IMPLEMENT(); +diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx +index 49fc1a3..3fd2350 100644 +--- a/sw/source/core/unocore/unotbl.cxx ++++ b/sw/source/core/unocore/unotbl.cxx +@@ -1709,7 +1709,7 @@ sal_Bool SwXTextTableCursor::mergeRange(void) throw( uno::RuntimeException ) + if(bRet) + { + size_t nCount = pTblCrsr->GetSelectedBoxesCount(); +- while (--nCount) ++ while (nCount--) + { + pTblCrsr->DeleteBox(nCount); + } +diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +index b613c07..28be09c 100644 +--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx ++++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +@@ -536,7 +536,7 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo + #define CNF_LAST_ROW_LAST_COLUMN 0x002 + #define CNF_LAST_ROW_FIRST_COLUMN 0x001 + +-CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(TableInfo & rInfo) ++CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(TableInfo & rInfo, std::vector& rMerges) + { + #ifdef DEBUG_DMAPPER_TABLE_HANDLER + dmapper_logger->startElement("getCellProperties"); +@@ -692,6 +692,25 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl + aCellIterator->get()->Insert( PROP_BOTTOM_BORDER_DISTANCE, false, + uno::makeAny((sal_Int32) rInfo.nBottomBorderDistance ) ); + ++ // Horizontal merge is not an UNO property, extract that info here to rMerges, and then remove it from the map. ++ const PropertyMap::const_iterator aHorizontalMergeIter = aCellIterator->get()->find(PropertyDefinition(PROP_HORIZONTAL_MERGE, false)); ++ if (aHorizontalMergeIter != aCellIterator->get()->end()) ++ { ++ if (aHorizontalMergeIter->second.get()) ++ { ++ // first cell in a merge ++ HorizontallyMergedCell aMerge(nRow, nCell); ++ rMerges.push_back(aMerge); ++ } ++ else if (!rMerges.empty()) ++ { ++ // resuming an earlier merge ++ HorizontallyMergedCell& rMerge = rMerges.back(); ++ rMerge.m_nLastRow = nRow; ++ rMerge.m_nLastCol = nCell; ++ } ++ aCellIterator->get()->erase(PropertyDefinition(PROP_HORIZONTAL_MERGE, false)); ++ } + pSingleCellProperties[nCell] = aCellIterator->get()->GetPropertyValues(); + #ifdef DEBUG_DMAPPER_TABLE_HANDLER + dmapper_logger->endElement(); +@@ -804,7 +823,8 @@ void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel) + aTableInfo.pTableStyle = endTableGetTableStyle(aTableInfo, aFrameProperties); + // expands to uno::Sequence< Sequence< beans::PropertyValues > > + +- CellPropertyValuesSeq_t aCellProperties = endTableGetCellProperties(aTableInfo); ++ std::vector aMerges; ++ CellPropertyValuesSeq_t aCellProperties = endTableGetCellProperties(aTableInfo, aMerges); + + RowPropertyValuesSeq_t aRowProperties = endTableGetRowProperties(); + +@@ -837,8 +857,27 @@ void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel) + aTableInfo.aTableProperties); + + if (xTable.is()) ++ { + m_xTableRange = xTable->getAnchor( ); + ++ if (!aMerges.empty()) ++ { ++ // Perform horizontal merges in reverse order, so the fact that merging changes the position of cells won't cause a problem for us. ++ for (std::vector::reverse_iterator it = aMerges.rbegin(); it != aMerges.rend(); ++it) ++ { ++ uno::Reference xCellRange(xTable, uno::UNO_QUERY_THROW); ++ uno::Reference xCell(xCellRange->getCellByPosition(it->m_nFirstCol, it->m_nFirstRow), uno::UNO_QUERY_THROW); ++ OUString aFirst = xCell->getPropertyValue("CellName").get(); ++ xCell.set(xCellRange->getCellByPosition(it->m_nLastCol, it->m_nLastRow), uno::UNO_QUERY_THROW); ++ OUString aLast = xCell->getPropertyValue("CellName").get(); ++ ++ uno::Reference xCursor = xTable->createCursorByCellName(aFirst); ++ xCursor->gotoCellByName(aLast, true); ++ xCursor->mergeRange(); ++ } ++ } ++ } ++ + // OOXML table style may container paragraph properties, apply these now. + for (int i = 0; i < aTableInfo.aTableProperties.getLength(); ++i) + { +diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.hxx b/writerfilter/source/dmapper/DomainMapperTableHandler.hxx +index 792b978..6b284f7 100644 +--- a/writerfilter/source/dmapper/DomainMapperTableHandler.hxx ++++ b/writerfilter/source/dmapper/DomainMapperTableHandler.hxx +@@ -50,6 +50,21 @@ typedef std::vector PropertyMapVector2; + class DomainMapper_Impl; + class TableStyleSheetEntry; + struct TableInfo; ++ ++/// A horizontally merged cell is in fact a range of cells till its merge is performed. ++struct HorizontallyMergedCell ++{ ++ sal_Int32 m_nFirstRow; ++ sal_Int32 m_nFirstCol; ++ sal_Int32 m_nLastRow; ++ sal_Int32 m_nLastCol; ++ HorizontallyMergedCell(sal_Int32 nFirstRow, sal_Int32 nFirstCol) ++ : m_nFirstRow(nFirstRow), ++ m_nFirstCol(nFirstCol) ++ { ++ } ++}; ++ + class WRITERFILTER_DLLPRIVATE DomainMapperTableHandler : public TableDataHandler + { + TextReference_t m_xText; +@@ -69,7 +84,7 @@ class WRITERFILTER_DLLPRIVATE DomainMapperTableHandler : public TableDataHandler + sal_Int32 m_nRowIndex; + + TableStyleSheetEntry * endTableGetTableStyle(TableInfo & rInfo, uno::Sequence& rFrameProperties); +- CellPropertyValuesSeq_t endTableGetCellProperties(TableInfo & rInfo); ++ CellPropertyValuesSeq_t endTableGetCellProperties(TableInfo & rInfo, std::vector& rMerges); + RowPropertyValuesSeq_t endTableGetRowProperties(); + + public: +diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx +index c3f4c5b..59afbb3 100644 +--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx ++++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx +@@ -298,6 +298,14 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm) + cellProps( pMergeProps); + } + break; ++ case NS_ooxml::LN_CT_TcPrBase_hMerge: ++ { ++ // values can be: LN_Value_ST_Merge_restart, LN_Value_ST_Merge_continue, in reality the second one is a 0 ++ TablePropertyMapPtr pMergeProps(new TablePropertyMap()); ++ pMergeProps->Insert(PROP_HORIZONTAL_MERGE, false, uno::makeAny(bool(sal::static_int_cast(nIntValue) == NS_ooxml::LN_Value_ST_Merge_restart))); ++ cellProps(pMergeProps); ++ } ++ break; + case NS_ooxml::LN_CT_TcPrBase_gridSpan: //number of grid positions spanned by this cell + { + #ifdef DEBUG_DOMAINMAPPER +diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx +index 46a316c..f305c03 100644 +--- a/writerfilter/source/dmapper/PropertyIds.cxx ++++ b/writerfilter/source/dmapper/PropertyIds.cxx +@@ -325,6 +325,7 @@ const OUString& PropertyNameSupplier::GetName( PropertyIds eId ) const + case PROP_GRAPHIC_URL: sName = "GraphicURL"; break; + case PROP_GRAPHIC_BITMAP: sName = "GraphicBitmap"; break; + case PROP_LABEL_CATEGORY: sName = "LabelCategory"; break; ++ case PROP_HORIZONTAL_MERGE: sName = "HorizontalMerge"; 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 92d3928d..194d7c5 100644 +--- a/writerfilter/source/dmapper/PropertyIds.hxx ++++ b/writerfilter/source/dmapper/PropertyIds.hxx +@@ -296,6 +296,7 @@ enum PropertyIds + ,PROP_IS_WIDTH_RELATIVE + ,PROP_GRAPHIC_URL + ,PROP_GRAPHIC_BITMAP ++ ,PROP_HORIZONTAL_MERGE + }; + struct PropertyNameSupplier_Impl; + class PropertyNameSupplier +diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx +index 5e7ea2a..2deb1ef 100644 +--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx ++++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx +@@ -2394,6 +2394,18 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword) + m_aStates.top().nBorderState = BORDER_PARAGRAPH; + } + break; ++ case RTF_CLMGF: ++ { ++ RTFValue::Pointer_t pValue(new RTFValue(NS_ooxml::LN_Value_ST_Merge_restart)); ++ m_aStates.top().aTableCellSprms.set(NS_ooxml::LN_CT_TcPrBase_hMerge, pValue); ++ } ++ break; ++ case RTF_CLMRG: ++ { ++ RTFValue::Pointer_t pValue(new RTFValue(NS_ooxml::LN_Value_ST_Merge_continue)); ++ m_aStates.top().aTableCellSprms.set(NS_ooxml::LN_CT_TcPrBase_hMerge, pValue); ++ } ++ break; + case RTF_CLVMGF: + { + RTFValue::Pointer_t pValue(new RTFValue(NS_ooxml::LN_Value_ST_Merge_restart)); +-- +1.8.4.2 + diff --git a/SOURCES/0089-Resolves-fdo-72961-Crash-when-you-open-ODFver.1.0-1..patch b/SOURCES/0089-Resolves-fdo-72961-Crash-when-you-open-ODFver.1.0-1..patch new file mode 100644 index 0000000..828a175 --- /dev/null +++ b/SOURCES/0089-Resolves-fdo-72961-Crash-when-you-open-ODFver.1.0-1..patch @@ -0,0 +1,48 @@ +From 7be4941f5f8e4936e058c5530df6fad6448cac8e Mon Sep 17 00:00:00 2001 +From: Julien Nabet +Date: Sun, 29 Dec 2013 19:06:11 +0100 +Subject: [PATCH 089/109] Resolves: fdo#72961 Crash when you open + ODFver.1.0/1.1 created by LibO-3.5/3.6 + +It seems pAction may be NULL so let's keep on to check it. + +Change-Id: Ie1a48c96bfa930364053c7c3ad0c940559544e33 +Reviewed-on: https://gerrit.libreoffice.org/7228 +Reviewed-by: Andrzej Hunt +Tested-by: Andrzej Hunt +(cherry picked from commit 6cc888babdc3e6414e55f57c0df65135f2ef4804) +--- + vcl/source/gdi/gdimtf.cxx | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx +index 1240500..90e691b 100644 +--- a/vcl/source/gdi/gdimtf.cxx ++++ b/vcl/source/gdi/gdimtf.cxx +@@ -2765,15 +2765,17 @@ SvStream& operator>>( SvStream& rIStm, GDIMetaFile& rGDIMetaFile ) + { + pAction = MetaAction::ReadMetaAction( rIStm, &aReadData ); + +- if (pAction->GetType() == META_COMMENT_ACTION) +- { +- MetaCommentAction* pCommentAct = static_cast(pAction); +- if ( pCommentAct->GetComment() == "EMF_PLUS" ) +- rGDIMetaFile.UseCanvas( sal_True ); +- } + + if( pAction ) ++ { ++ if (pAction->GetType() == META_COMMENT_ACTION) ++ { ++ MetaCommentAction* pCommentAct = static_cast(pAction); ++ if ( pCommentAct->GetComment() == "EMF_PLUS" ) ++ rGDIMetaFile.UseCanvas( sal_True ); ++ } + rGDIMetaFile.AddAction( pAction ); ++ } + } + } + else +-- +1.8.4.2 + diff --git a/SOURCES/0090-fdo-39206-Add-support-for-image-transformation-in-SV.patch b/SOURCES/0090-fdo-39206-Add-support-for-image-transformation-in-SV.patch new file mode 100644 index 0000000..b9e44f9 --- /dev/null +++ b/SOURCES/0090-fdo-39206-Add-support-for-image-transformation-in-SV.patch @@ -0,0 +1,60 @@ +From 050e42346bd2d7ce8ab454df400b48f52c2aeecf Mon Sep 17 00:00:00 2001 +From: Samuel Mehrbrodt +Date: Sat, 7 Dec 2013 12:14:40 +0100 +Subject: [PATCH 090/109] fdo#39206 Add support for image transformation in SVG + Import + +Change-Id: I268599b0c13bbacf5db526fed79453a5443145a5 +Reviewed-on: https://gerrit.libreoffice.org/6968 +Reviewed-by: Miklos Vajna +Tested-by: Miklos Vajna +(cherry picked from commit fb978b8123a47123d184daf390ce17eaacbc05d9) +--- + filter/source/svg/svgreader.cxx | 17 ++++++++++++++++- + 1 file changed, 16 insertions(+), 1 deletion(-) + +diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx +index e74f669..e3f1af3 100644 +--- a/filter/source/svg/svgreader.cxx ++++ b/filter/source/svg/svgreader.cxx +@@ -1421,7 +1421,7 @@ struct ShapeWritingVisitor + // collect attributes + const sal_Int32 nNumAttrs( xAttributes->getLength() ); + OUString sAttributeValue; +- double x=0.0,y=0.0,width=0.0,height=0.0; ++ double x=0.0, y=0.0, width=0.0, height=0.0; + for( sal_Int32 i=0; iitem(i)->getNodeValue(); +@@ -1446,6 +1446,20 @@ struct ShapeWritingVisitor + break; + } + } ++ // extract basic transformations out of CTM ++ basegfx::B2DTuple aScale, aTranslate; ++ double fRotate, fShearX; ++ if (maCurrState.maCTM.decompose(aScale, aTranslate, fRotate, fShearX)) ++ { ++ // apply transform ++ x *= aScale.getX(); ++ width *= aScale.getX(); ++ y *= aScale.getY(); ++ height *= aScale.getY(); ++ x += aTranslate.getX(); ++ y += aTranslate.getY(); ++ //TODO: Rotate ++ } + + OUString sValue = xElem->hasAttribute("href") ? xElem->getAttribute("href") : ""; + OString aValueUtf8( sValue.getStr(), sValue.getLength(), RTL_TEXTENCODING_UTF8 ); +@@ -1508,6 +1522,7 @@ struct ShapeWritingVisitor + y *= aScale.getY(); + x += aTranslate.getX(); + y += aTranslate.getY(); ++ //TODO: Rotate + } + else { + // some heuristic attempts to have text output +-- +1.8.4.2 + diff --git a/SOURCES/0091-EMF-Integer-coordinate-values-are-signed.patch b/SOURCES/0091-EMF-Integer-coordinate-values-are-signed.patch new file mode 100644 index 0000000..fd9f250 --- /dev/null +++ b/SOURCES/0091-EMF-Integer-coordinate-values-are-signed.patch @@ -0,0 +1,39 @@ +From 215499e74fccb1809105d458b6076992be9d049c Mon Sep 17 00:00:00 2001 +From: Andrzej Hunt +Date: Thu, 26 Dec 2013 18:57:28 +0000 +Subject: [PATCH 091/109] EMF+: Integer coordinate values are signed. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Previously any coordinates with negative values would not be rendered +(as they would incorrectly appear to be outside the visible area). + +(cherry picked from commit d8dedc775cedf0e9daf9284bc7e3a0331ccd2963) + +Change-Id: I5babcec50d48dc2a6288a01685db61fbb7058680 +Reviewed-on: https://gerrit.libreoffice.org/7247 +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +--- + cppcanvas/source/mtfrenderer/emfplus.cxx | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx +index a11dc8b..01a77d6 100644 +--- a/cppcanvas/source/mtfrenderer/emfplus.cxx ++++ b/cppcanvas/source/mtfrenderer/emfplus.cxx +@@ -169,8 +169,8 @@ namespace cppcanvas + { + for (int i = 0; i < nPoints; i ++) { + if (pathFlags & 0x4000) { +- // points are stored in short 16bit integer format +- sal_uInt16 x, y; ++ // points are stored in signed short 16bit integer format ++ sal_Int16 x, y; + + s >> x >> y; + SAL_INFO ("cppcanvas.emf", "EMF+\tpoint [x,y]: " << x << "," << y); +-- +1.8.4.2 + diff --git a/SOURCES/0092-EMF-actually-use-lineJoin-attribute-for-polygons.patch b/SOURCES/0092-EMF-actually-use-lineJoin-attribute-for-polygons.patch new file mode 100644 index 0000000..440ff98 --- /dev/null +++ b/SOURCES/0092-EMF-actually-use-lineJoin-attribute-for-polygons.patch @@ -0,0 +1,81 @@ +From f5b984e416a05df220e339da2e9cda95ab660d85 Mon Sep 17 00:00:00 2001 +From: Andrzej Hunt +Date: Wed, 1 Jan 2014 17:36:54 +0000 +Subject: [PATCH 092/109] EMF+: actually use lineJoin attribute for polygons. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Change-Id: I5b369703333332598353d9817f0253bbe5fc3601 +(cherry picked from commit 9b1ceabd5f696500d4fe2acb89170bd987966a9b) +Reviewed-on: https://gerrit.libreoffice.org/7248 +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +--- + cppcanvas/source/mtfrenderer/emfplus.cxx | 28 ++++++++++++++++++---------- + 1 file changed, 18 insertions(+), 10 deletions(-) + +diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx +index 01a77d6..5eefdf6 100644 +--- a/cppcanvas/source/mtfrenderer/emfplus.cxx ++++ b/cppcanvas/source/mtfrenderer/emfplus.cxx +@@ -620,6 +620,19 @@ namespace cppcanvas + return rendering::PathCapType::BUTT; + } + ++ sal_Int8 lcl_convertLineJoinType(sal_uInt32 nEmfLineJoin) ++ { ++ switch (nEmfLineJoin) ++ { ++ case EmfPlusLineJoinTypeMiter: // fall-through ++ case EmfPlusLineJoinTypeMiterClipped: return rendering::PathJoinType::MITER; ++ case EmfPlusLineJoinTypeBevel: return rendering::PathJoinType::BEVEL; ++ case EmfPlusLineJoinTypeRound: return rendering::PathJoinType::ROUND; ++ } ++ assert(false); // Line Join type isn't in specification. ++ return 0; ++ } ++ + struct EMFPCustomLineCap : public EMFPObject + { + sal_uInt32 type; +@@ -641,14 +654,7 @@ namespace cppcanvas + { + aAttributes.StartCapType = lcl_convertStrokeCap(strokeStartCap); + aAttributes.EndCapType = lcl_convertStrokeCap(strokeEndCap); +- +- switch (strokeJoin) +- { +- case EmfPlusLineJoinTypeMiter: // fall-through +- case EmfPlusLineJoinTypeMiterClipped: aAttributes.JoinType = rendering::PathJoinType::MITER; break; +- case EmfPlusLineJoinTypeBevel: aAttributes.JoinType = rendering::PathJoinType::BEVEL; break; +- case EmfPlusLineJoinTypeRound: aAttributes.JoinType = rendering::PathJoinType::ROUND; break; +- } ++ aAttributes.JoinType = lcl_convertLineJoinType(strokeJoin); + + aAttributes.MiterLimit = miterLimit; + } +@@ -786,8 +792,10 @@ namespace cppcanvas + rStrokeAttributes.StrokeWidth = fabs((rState.mapModeTransform * rR.MapSize (width == 0.0 ? 0.05 : width, 0)).getX()); + } + +- void SetStrokeDashing(rendering::StrokeAttributes& rStrokeAttributes) ++ void SetStrokeAttributes(rendering::StrokeAttributes& rStrokeAttributes) + { ++ rStrokeAttributes.JoinType = lcl_convertLineJoinType(lineJoin); ++ + if (dashStyle != EmfPlusLineStyleSolid) + { + const float dash[] = {3, 3}; +@@ -1393,7 +1401,7 @@ namespace cppcanvas + // but eg. dashing has to be additionally set only on the + // polygon + rendering::StrokeAttributes aPolygonAttributes(aCommonAttributes); +- pen->SetStrokeDashing(aPolygonAttributes); ++ pen->SetStrokeAttributes(aPolygonAttributes); + + basegfx::B2DPolyPolygon aFinalPolyPolygon; + +-- +1.8.4.2 + diff --git a/SOURCES/0093-EMF-mapping-can-rotate-the-width-vector-so-use-resul.patch b/SOURCES/0093-EMF-mapping-can-rotate-the-width-vector-so-use-resul.patch new file mode 100644 index 0000000..aaa13f8 --- /dev/null +++ b/SOURCES/0093-EMF-mapping-can-rotate-the-width-vector-so-use-resul.patch @@ -0,0 +1,38 @@ +From 2bbcd06df60f4e7ab76e908a1173eeb343b22868 Mon Sep 17 00:00:00 2001 +From: Andrzej Hunt +Date: Wed, 1 Jan 2014 17:07:56 +0000 +Subject: [PATCH 093/109] EMF+: mapping can rotate the width vector, so use + resulting length. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Otherwise (i.e. with non-vertical lines) the width will be incorrect, +and can result in lines disappearing as the resulting X component +can be tiny/approaching zero. + +Change-Id: Icf3b7c10c627594600b517b8ff445f8df87c56f8 +(cherry picked from commit 83f2b3c590120a60b5e94fb1a15054ebe0745dbb) +Reviewed-on: https://gerrit.libreoffice.org/7249 +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +--- + cppcanvas/source/mtfrenderer/emfplus.cxx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx +index 5eefdf6..7614bbb 100644 +--- a/cppcanvas/source/mtfrenderer/emfplus.cxx ++++ b/cppcanvas/source/mtfrenderer/emfplus.cxx +@@ -789,7 +789,7 @@ namespace cppcanvas + SAL_INFO ("cppcanvas.emf", "TODO: pen with zero width - using minimal which might not be correct\n"); + } + #endif +- rStrokeAttributes.StrokeWidth = fabs((rState.mapModeTransform * rR.MapSize (width == 0.0 ? 0.05 : width, 0)).getX()); ++ rStrokeAttributes.StrokeWidth = fabs((rState.mapModeTransform * rR.MapSize (width == 0.0 ? 0.05 : width, 0)).getLength()); + } + + void SetStrokeAttributes(rendering::StrokeAttributes& rStrokeAttributes) +-- +1.8.4.2 + diff --git a/SOURCES/0095-Resolves-fdo-72464-Character-line-break-is-set-to-0-.patch b/SOURCES/0095-Resolves-fdo-72464-Character-line-break-is-set-to-0-.patch new file mode 100644 index 0000000..2dcb139 --- /dev/null +++ b/SOURCES/0095-Resolves-fdo-72464-Character-line-break-is-set-to-0-.patch @@ -0,0 +1,33 @@ +From b8303a3e58f0b8d50574126998228d7d71c94728 Mon Sep 17 00:00:00 2001 +From: Julien Nabet +Date: Wed, 1 Jan 2014 21:39:13 +0100 +Subject: [PATCH 095/109] Resolves: fdo#72464 Character line break is set to 0 + Options/.../Writing Aids +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Change-Id: I9f3d1c64fde064fc7ba9bdfcb9e35032a0c40255 +Reviewed-on: https://gerrit.libreoffice.org/7253 +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +--- + linguistic/source/lngopt.hxx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/linguistic/source/lngopt.hxx b/linguistic/source/lngopt.hxx +index c4bbc6c..c6d0bc6 100644 +--- a/linguistic/source/lngopt.hxx ++++ b/linguistic/source/lngopt.hxx +@@ -149,7 +149,7 @@ public: + virtual void SAL_CALL setIsSpellCapitalization(sal_Bool p1) throw (css::uno::RuntimeException) + { setProperty(UPN_IS_SPELL_CAPITALIZATION, p1); } + virtual sal_Int16 SAL_CALL getHyphMinLeading() throw (css::uno::RuntimeException) +- { return getPropertyBool(UPN_HYPH_MIN_LEADING); } ++ { return getPropertyInt16(UPN_HYPH_MIN_LEADING); } + virtual void SAL_CALL setHyphMinLeading(sal_Int16 p1) throw (css::uno::RuntimeException) + { setProperty(UPN_HYPH_MIN_LEADING, p1); } + virtual sal_Int16 SAL_CALL getHyphMinTrailing() throw (css::uno::RuntimeException) +-- +1.8.4.2 + diff --git a/SOURCES/0096-Make-CalcFocusRect-look-right.patch b/SOURCES/0096-Make-CalcFocusRect-look-right.patch new file mode 100644 index 0000000..3102121 --- /dev/null +++ b/SOURCES/0096-Make-CalcFocusRect-look-right.patch @@ -0,0 +1,55 @@ +From bfb51322f2bee76d7e70588050c38655a432aef0 Mon Sep 17 00:00:00 2001 +From: Stephan Bergmann +Date: Wed, 9 Oct 2013 12:06:41 +0200 +Subject: [PATCH 096/109] Make CalcFocusRect look right + +...at least for its (only, it appears) uses at the left of the "Insert - +Hyperlink" dialog and at the left of a Database window. As aBmpRect and +aTextRect never extend aBoundRect (and aTextRect always leaving a gap left and +right towards aBoundRect, it appears, with the text abbreviated with an ellipsis +if it would be too wide), there should be no need to eventually adjust "the +focus rectangle [to] not touch the text," and for calculating the top of the +focus rect aBoundRect can be used just as well as aBmpRect. (Though for +calculating the bottom, aBoundRect apparently stretches "too far" compareed to +aTextRect; whatever... The offsets look somewhat "magic" anyway, but appear to +produce the desired visual results.) + +Change-Id: Ic324561294fb6172c0d02a697fc261717e01c87c +Reviewed-on: https://gerrit.libreoffice.org/6165 +Reviewed-by: Eike Rathke +Tested-by: Eike Rathke +(cherry picked from commit 143bb92761f54cb7b8e41e5ac83bd274d4f7079b) +Signed-off-by: Eike Rathke +--- + svtools/source/contnr/imivctl1.cxx | 13 +++---------- + 1 file changed, 3 insertions(+), 10 deletions(-) + +diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx +index 01f733d..b0ea082 100644 +--- a/svtools/source/contnr/imivctl1.cxx ++++ b/svtools/source/contnr/imivctl1.cxx +@@ -2703,18 +2703,11 @@ const Size& SvxIconChoiceCtrl_Impl::GetItemSize( SvxIconChoiceCtrlEntry*, + + Rectangle SvxIconChoiceCtrl_Impl::CalcFocusRect( SvxIconChoiceCtrlEntry* pEntry ) + { +- Rectangle aBmpRect( CalcBmpRect( pEntry ) ); + Rectangle aTextRect( CalcTextRect( pEntry ) ); + Rectangle aBoundRect( GetEntryBoundRect( pEntry ) ); +- Rectangle aFocusRect( aBoundRect.Left(), aBmpRect.Top() - 1, +- aBoundRect.Right() - 4, aTextRect.Bottom() + 1 ); +- // the focus rectangle should not touch the text +- if( aFocusRect.Left() > ::std::numeric_limits::min() && aFocusRect.Left() - 1 >= pEntry->aRect.Left() ) +- aFocusRect.Left()--; +- if( aFocusRect.Right() < ::std::numeric_limits::max() && aFocusRect.Right() + 1 <= pEntry->aRect.Right() ) +- aFocusRect.Right()++; +- +- return aFocusRect; ++ return Rectangle( ++ aBoundRect.Left(), aBoundRect.Top() - 1, aBoundRect.Right() - 1, ++ aTextRect.Bottom() + 1); + } + + // the hot spot is the inner 50 % of the rectangle +-- +1.8.4.2 + diff --git a/SOURCES/0097-die-binfilter-die-die-die.patch b/SOURCES/0097-die-binfilter-die-die-die.patch new file mode 100644 index 0000000..e7833b5 --- /dev/null +++ b/SOURCES/0097-die-binfilter-die-die-die.patch @@ -0,0 +1,114 @@ +From 29439609d6023c8c7e14cafa5171b2bedc600ab4 Mon Sep 17 00:00:00 2001 +From: Eike Rathke +Date: Fri, 3 Jan 2014 00:34:06 +0100 +Subject: [PATCH 097/109] die binfilter die die die + +Euro Converter tried to obtain filters for names of binary filters that +don't exist anymore and can't be resolved hence the TypeDetection +GetByName() bailed out with an exception when calling the file picker +(e.g. when attempting to select a document), stopping in Basic +environment and effectively rendering the wizard useless. + +Change-Id: Ifdef6f59abdc16bedd0f54ec317dc44af8f1e628 +(cherry picked from commit e625d00439f725b01f3818859e95e431e6173d57) +Reviewed-on: https://gerrit.libreoffice.org/7264 +Reviewed-by: Andras Timar +Tested-by: Andras Timar +--- + wizards/source/euro/AutoPilotRun.xba | 60 +++++++++++++----------------------- + 1 file changed, 22 insertions(+), 38 deletions(-) + +diff --git a/wizards/source/euro/AutoPilotRun.xba b/wizards/source/euro/AutoPilotRun.xba +index 47d7959..fe2bed7 100644 +--- a/wizards/source/euro/AutoPilotRun.xba ++++ b/wizards/source/euro/AutoPilotRun.xba +@@ -28,7 +28,7 @@ Public Source as String + Public SubstFile as String + Public SubstDir as String + Public NoArgs() +-Public TypeList(14) as String ++Public TypeList(6) as String + Public GoOn as Boolean + Public DoUnprotect as Integer + Public Password as String +@@ -74,21 +74,13 @@ Dim bDisposable as Boolean + TargetStemDir = TargetDir + TypeList(0) = "calc8" + TypeList(1) = "calc_StarOffice_XML_Calc" +- TypeList(2) = "calc_StarCalc_30" +- TypeList(3) = "calc_StarCalc_40" +- TypeList(4) = "calc_StarCalc_50" + If DialogModel.chkTextDocuments.State = 1 Then +- ReDim Preserve TypeList(13) as String +- +- TypeList(5) = "writer8" +- TypeList(6) = "writerglobal8" +- TypeList(7) = "writer_StarOffice_XML_Writer" +- TypeList(8) = "writer_globaldocument_StarOffice_XML_Writer_GlobalDocument" +- TypeList(9) = "writer_StarWriter_30" +- TypeList(10) = "writer_StarWriter_40" +- TypeList(11) = "writer_globaldocument_StarWriter_40GlobalDocument" +- TypeList(12) = "writer_StarWriter_50" +- TypeList(13) = "writer_globaldocument_StarWriter_50GlobalDocument" ++ ReDim Preserve TypeList(5) as String ++ ++ TypeList(2) = "writer8" ++ TypeList(3) = "writerglobal8" ++ TypeList(4) = "writer_StarOffice_XML_Writer" ++ TypeList(5) = "writer_globaldocument_StarOffice_XML_Writer_GlobalDocument" + End If + FilesList() = ReadDirectories(SourceDir, bRecursive, True, False, TypeList()) + TotDocCount = Ubound(FilesList(),1) + 1 +@@ -387,34 +379,26 @@ Sub CallFilePicker() + oTypes() = oMasterKey.Types + oUIKey = GetRegistryKeyContent("org.openoffice.Office.UI/FilterClassification/LocalFilters") + If DialogModel.chkTextDocuments.State = 1 Then +- Dim FilterNames(11,1) as String +- FilterNames(6,0) = oTypes.GetByName("writer_StarOffice_XML_Writer").UIName +- FilterNames(6,1) = "*.sxw" +- FilterNames(7,0) = oTypes.GetByName("writer_StarOffice_XML_Writer_Template").UIName +- FilterNames(7,1) = "*.stw" +- FilterNames(8,0) = oUIKey.Classes.GetByName("sw3to5").DisplayName +- FilterNames(8,1) = "*.sdw" +- FilterNames(9,0) = oUIKey.Classes.GetByName("sw3to5templ").DisplayName +- Filternames(9,1) = "*.vor" +- FilterNames(10,0) = oTypes.GetByName("writer8").UIName +- FilterNames(10,1) = "*.odt" +- FilterNames(11,0) = oTypes.GetByName("writer8_template").UIName +- FilterNames(11,1) = "*.ott" ++ Dim FilterNames(7,1) as String ++ FilterNames(4,0) = oTypes.GetByName("writer_StarOffice_XML_Writer").UIName ++ FilterNames(4,1) = "*.sxw" ++ FilterNames(5,0) = oTypes.GetByName("writer_StarOffice_XML_Writer_Template").UIName ++ FilterNames(5,1) = "*.stw" ++ FilterNames(6,0) = oTypes.GetByName("writer8").UIName ++ FilterNames(6,1) = "*.odt" ++ FilterNames(7,0) = oTypes.GetByName("writer8_template").UIName ++ FilterNames(7,1) = "*.ott" + Else +- ReDim FilterNames(5,1) as String ++ ReDim FilterNames(3,1) as String + End If +- FilterNames(0,0) = oTypes.GetByName("calc_StarOffice_XML_Calc").UIName ++ FilterNames(0,0) = oTypes.GetByName("calc_StarOffice_XML_Calc").UIName + Filternames(0,1) = "*.sxc" + FilterNames(1,0) = oTypes.GetByName("calc_StarOffice_XML_Calc_Template").UIName + Filternames(1,1) = "*.stc" +- FilterNames(2,0) = oUIKey.Classes.GetByName("sc345").DisplayName +- FilterNames(2,1) = "*.sdc" +- FilterNames(3,0) = oUIKey.Classes.GetByName("sc345templ").DisplayName +- Filternames(3,1) = "*.vor" +- FilterNames(4,0) = oTypes.GetByName("calc8").UIName +- Filternames(4,1) = "*.ods" +- FilterNames(5,0) = oTypes.GetByName("calc8_template").UIName +- Filternames(5,1) = "*.ots" ++ FilterNames(2,0) = oTypes.GetByName("calc8").UIName ++ Filternames(2,1) = "*.ods" ++ FilterNames(3,0) = oTypes.GetByName("calc8_template").UIName ++ Filternames(3,1) = "*.ots" + GetFileName(DialogModel.txtSource, Filternames()) + Else + GetFolderName(DialogModel.txtSource) +-- +1.8.4.2 + diff --git a/SOURCES/0099-added-EEK-and-LVL-to-EUROCONVERT-EUR-to-LV-locale-da.patch b/SOURCES/0099-added-EEK-and-LVL-to-EUROCONVERT-EUR-to-LV-locale-da.patch new file mode 100644 index 0000000..9a6551f --- /dev/null +++ b/SOURCES/0099-added-EEK-and-LVL-to-EUROCONVERT-EUR-to-LV-locale-da.patch @@ -0,0 +1,108 @@ +From 9ac100fc1eaea06ebd80c4009ac7ebc3aee6fd50 Mon Sep 17 00:00:00 2001 +From: Eike Rathke +Date: Thu, 2 Jan 2014 21:53:36 +0100 +Subject: [PATCH 099/109] added "EEK" and "LVL" to EUROCONVERT(), "EUR" to + [*-LV] locale data fdo#73239 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This is a combination of 3 commits. + +added Estonian "EEK" to EUROCONVERT(), fdo#73239 + +(cherry picked from commit 127f863c727c07f1da40005fe638d97e89baaccf) + +Conflicts: + sc/source/core/tool/interpr2.cxx + +added EUR as default currency to Latvia [*-LV] locale data, fdo#73239 + +(cherry picked from commit c32996987354d045523beaa98b5d227d161f72fb) + +added Latvian "LVL" to EUROCONVERT(), fdo#73239 + +(cherry picked from commit cc1b6535e01db62688a7bee50852d33e4ee50761) + +Change-Id: I82085b6661c954b2afbf22b8b8ed5bd8c48cc50e +Reviewed-on: https://gerrit.libreoffice.org/7263 +Reviewed-by: Caolán McNamara +Tested-by: Caolán McNamara +--- + i18npool/source/localedata/data/ltg_LV.xml | 9 ++++++++- + i18npool/source/localedata/data/lv_LV.xml | 9 ++++++++- + sc/source/core/tool/interpr2.cxx | 11 ++++++++--- + 3 files changed, 24 insertions(+), 5 deletions(-) + +diff --git a/i18npool/source/localedata/data/ltg_LV.xml b/i18npool/source/localedata/data/ltg_LV.xml +index 12fe4b0..6765077 100644 +--- a/i18npool/source/localedata/data/ltg_LV.xml ++++ b/i18npool/source/localedata/data/ltg_LV.xml +@@ -331,7 +331,14 @@ + + + +- ++ ++ EUR ++ ++ EUR ++ Euro ++ 2 ++ ++ + LVL + Ls + LVL +diff --git a/i18npool/source/localedata/data/lv_LV.xml b/i18npool/source/localedata/data/lv_LV.xml +index 456214d..68483e5 100644 +--- a/i18npool/source/localedata/data/lv_LV.xml ++++ b/i18npool/source/localedata/data/lv_LV.xml +@@ -331,7 +331,14 @@ + + + +- ++ ++ EUR ++ ++ EUR ++ Euro ++ 2 ++ ++ + LVL + Ls + LVL +diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx +index a0f270d..14bba4f 100644 +--- a/sc/source/core/tool/interpr2.cxx ++++ b/sc/source/core/tool/interpr2.cxx +@@ -2625,8 +2625,11 @@ void ScInterpreter::ScHyperLink() + } + } + +- +-bool lclConvertMoney( const String& aSearchUnit, double& rfRate, int& rnDec ) ++/** Resources at the website of the European Commission: ++ http://ec.europa.eu/economy_finance/euro/adoption/conversion/ ++ http://ec.europa.eu/economy_finance/euro/countries/ ++ */ ++static bool lclConvertMoney( const String& aSearchUnit, double& rfRate, int& rnDec ) + { + struct ConvertInfo + { +@@ -2651,7 +2654,9 @@ bool lclConvertMoney( const String& aSearchUnit, double& rfRate, int& rnDec ) + { "SIT", 239.640, 2 }, + { "MTL", 0.429300, 2 }, + { "CYP", 0.585274, 2 }, +- { "SKK", 30.1260, 2 } ++ { "SKK", 30.1260, 2 }, ++ { "EEK", 15.6466, 2 }, ++ { "LVL", 0.702804, 2 } + }; + + const size_t nConversionCount = sizeof( aConvertTable ) / sizeof( aConvertTable[0] ); +-- +1.8.4.2 + diff --git a/SOURCES/0100-cp-2013101510000026-wrong-highlight-of-commented-tex.patch b/SOURCES/0100-cp-2013101510000026-wrong-highlight-of-commented-tex.patch new file mode 100644 index 0000000..bf26d90 --- /dev/null +++ b/SOURCES/0100-cp-2013101510000026-wrong-highlight-of-commented-tex.patch @@ -0,0 +1,81 @@ +From 28d59a1a48d633f438e344f247362af0858d8911 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zolnai=20Tam=C3=A1s?= +Date: Fri, 3 Jan 2014 11:38:05 +0100 +Subject: [PATCH 100/109] cp#2013101510000026: wrong highlight of commented + text range imported from doc + +When makeFieldBookmark() method is called with +ODF_COMMENTRANGE it will ignore the added field name and +generate an own one. We have to set the name of the +SwPostItField to this generated name so these two names will match. + +Note: lTagBkmk is only an identifier but not the exported name +of the fieldmark so we don't need to stick to use it as +a name. + +(cherry picked from commit 12e287220ebaf3a8f5eaf7bf526dce2c47f45a20) + +Conflicts: + sw/source/filter/ww8/ww8par.cxx + +(cherry picked from commit d6fc6624e1319257945f49388d635c36685108d5) + +Change-Id: I499abdcce1be0563c308bcf9f5c0a959a07f858b +--- + sw/qa/extras/ww8import/ww8import.cxx | 1 - + sw/source/filter/ww8/ww8par.cxx | 7 +++---- + 2 files changed, 3 insertions(+), 5 deletions(-) + +diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx +index ef68da6..50ef934 100644 +--- a/sw/qa/extras/ww8import/ww8import.cxx ++++ b/sw/qa/extras/ww8import/ww8import.cxx +@@ -242,7 +242,6 @@ void Test::testFdo59530() + uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); + uno::Reference xFields(xFieldsAccess->createEnumeration()); + xPropertySet.set(xFields->nextElement(), uno::UNO_QUERY); +- CPPUNIT_ASSERT_EQUAL(OUString("346376201"), getProperty(xPropertySet, "Name")); + CPPUNIT_ASSERT_EQUAL(OUString("M"), getProperty(xPropertySet, "Initials")); + } + +diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx +index b34b966..56040b7 100644 +--- a/sw/source/filter/ww8/ww8par.cxx ++++ b/sw/source/filter/ww8/ww8par.cxx +@@ -1790,7 +1790,6 @@ long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes) + + String sAuthor; + String sInitials; +- String sName; + if( bVer67 ) + { + const WW67_ATRD* pDescri = (const WW67_ATRD*)pSD->GetData(); +@@ -1820,7 +1819,6 @@ long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes) + sal_uInt32 nTagBkmk = SVBT32ToUInt32(pDescri->ITagBkmk); + if (nTagBkmk != 0xFFFFFFFF) + { +- sName = OUString::valueOf(sal_Int32(nTagBkmk)); + int nAtnIndex = GetAnnotationIndex(nTagBkmk); + if (nAtnIndex != -1) + { +@@ -1855,14 +1853,15 @@ long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes) + this->pFmtOfJustInsertedApo = 0; + SwPostItField aPostIt( + (SwPostItFieldType*)rDoc.GetSysFldType(RES_POSTITFLD), sAuthor, +- sTxt, sInitials, sName, aDate ); ++ sTxt, sInitials, String(), aDate ); + aPostIt.SetTextObject(pOutliner); + + // If this is a range, create the associated fieldmark. + if (pPaM->HasMark()) + { + IDocumentMarkAccess* pMarksAccess = rDoc.getIDocumentMarkAccess(); +- pMarksAccess->makeFieldBookmark(*pPaM, aPostIt.GetName(), ODF_COMMENTRANGE); ++ sw::mark::IFieldmark* pFieldmark = pMarksAccess->makeFieldBookmark(*pPaM, OUString(), ODF_COMMENTRANGE); ++ aPostIt.SetName(pFieldmark->GetName()); + pPaM->Exchange(); + pPaM->DeleteMark(); + } +-- +1.8.4.2 + diff --git a/SOURCES/0101-cp-2013101510000026-fix-doc-export-of-comments-initi.patch b/SOURCES/0101-cp-2013101510000026-fix-doc-export-of-comments-initi.patch new file mode 100644 index 0000000..ed6ef75 --- /dev/null +++ b/SOURCES/0101-cp-2013101510000026-fix-doc-export-of-comments-initi.patch @@ -0,0 +1,167 @@ +From e3f729cbe49baccc9d40c41af183529e494dd1d9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zolnai=20Tam=C3=A1s?= +Date: Fri, 3 Jan 2014 15:26:21 +0100 +Subject: [PATCH 101/109] cp#2013101510000026: fix doc export of comments + initials + +It seems comments' authers were exported twice. Once istead +of initials. + +(cherry picked from commit 0127e3dbabaf24c6c0d828e6d26357ff0b63c3fb) + +Conflicts: + sw/source/filter/ww8/wrtw8sty.cxx + sw/source/filter/ww8/wrtww8.hxx + +Change-Id: I082fb5caea99df013922e16c5d8d4ef29e866665 +(cherry picked from commit 7d12ed75718fcee74a731113928a12af0bb0e2f5) +--- + sw/source/filter/ww8/wrtw8sty.cxx | 55 ++++++++++++++++++++++----------------- + sw/source/filter/ww8/wrtww8.hxx | 1 + + 2 files changed, 32 insertions(+), 24 deletions(-) + +diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx +index bc08a72..17aad68 100644 +--- a/sw/source/filter/ww8/wrtw8sty.cxx ++++ b/sw/source/filter/ww8/wrtw8sty.cxx +@@ -1953,6 +1953,7 @@ WW8_Annotation::WW8_Annotation(const SwPostItField* pPostIt) + if (!mpRichText) + msSimpleText = pPostIt->GetTxt(); + msOwner = pPostIt->GetPar1(); ++ m_sInitials = pPostIt->GetInitials(); + maDateTime = DateTime(pPostIt->GetDate(), pPostIt->GetTime()); + } + +@@ -2118,11 +2119,14 @@ bool WW8_WrPlcSubDoc::WriteGenericTxt( WW8Export& rWrt, sal_uInt8 nTTyp, + return ( rCount != 0 ); + } + ++static bool lcl_AuthorComp( const std::pair& aFirst, const std::pair& aSecond) ++{ ++ return aFirst.first < aSecond.first; ++} ++ + void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, sal_uInt8 nTTyp, + WW8_FC& rTxtStart, sal_Int32& rTxtCount, WW8_FC& rRefStart, sal_Int32& rRefCount ) const + { +- typedef ::std::vector::iterator myiter; +- + sal_uLong nFcStart = rWrt.pTableStrm->Tell(); + sal_uInt16 nLen = aCps.size(); + if ( !nLen ) +@@ -2130,7 +2134,8 @@ void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, sal_uInt8 nTTyp, + + OSL_ENSURE( aCps.size() + 2 == pTxtPos->Count(), "WritePlc: DeSync" ); + +- ::std::vector aStrArr; ++ ::std::vector > aStrArr; ++ typedef ::std::vector >::iterator myiter; + WW8Fib& rFib = *rWrt.pFib; // n+1-te CP-Pos nach Handbuch + sal_uInt16 i; + bool bWriteCP = true; +@@ -2143,11 +2148,11 @@ void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, sal_uInt8 nTTyp, + for ( i = 0; i < nLen; ++i ) + { + const WW8_Annotation& rAtn = *(const WW8_Annotation*)aCntnt[i]; +- aStrArr.push_back(rAtn.msOwner); ++ aStrArr.push_back(std::pair(rAtn.msOwner,rAtn.m_sInitials)); + } + + //sort and remove duplicates +- ::std::sort(aStrArr.begin(), aStrArr.end()); ++ ::std::sort(aStrArr.begin(), aStrArr.end(),&lcl_AuthorComp); + myiter aIter = ::std::unique(aStrArr.begin(), aStrArr.end()); + aStrArr.erase(aIter, aStrArr.end()); + +@@ -2155,9 +2160,9 @@ void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, sal_uInt8 nTTyp, + { + for ( i = 0; i < aStrArr.size(); ++i ) + { +- const String& rStr = aStrArr[i]; +- SwWW8Writer::WriteShort(*rWrt.pTableStrm, rStr.Len()); +- SwWW8Writer::WriteString16(*rWrt.pTableStrm, rStr, ++ const String& sAuthor = aStrArr[i].first; ++ SwWW8Writer::WriteShort(*rWrt.pTableStrm, sAuthor.Len()); ++ SwWW8Writer::WriteString16(*rWrt.pTableStrm, sAuthor, + false); + } + } +@@ -2165,9 +2170,9 @@ void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, sal_uInt8 nTTyp, + { + for ( i = 0; i < aStrArr.size(); ++i ) + { +- const String& rStr = aStrArr[i]; +- *rWrt.pTableStrm << (sal_uInt8)rStr.Len(); +- SwWW8Writer::WriteString8(*rWrt.pTableStrm, rStr, false, ++ const String& sAuthor = aStrArr[i].first; ++ *rWrt.pTableStrm << (sal_uInt8)sAuthor.Len(); ++ SwWW8Writer::WriteString8(*rWrt.pTableStrm, sAuthor, false, + RTL_TEXTENCODING_MS_1252); + } + } +@@ -2266,35 +2271,37 @@ void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, sal_uInt8 nTTyp, + + //aStrArr is sorted + myiter aIter = ::std::lower_bound(aStrArr.begin(), +- aStrArr.end(), rAtn.msOwner); +- OSL_ENSURE(aIter != aStrArr.end() && *aIter == rAtn.msOwner, ++ aStrArr.end(), std::pair(rAtn.msOwner,String()), ++ &lcl_AuthorComp); ++ OSL_ENSURE(aIter != aStrArr.end() && aIter->first == rAtn.msOwner, + "Impossible"); + sal_uInt16 nFndPos = static_cast< sal_uInt16 >(aIter - aStrArr.begin()); +- String sAuthor(*aIter); +- sal_uInt8 nNameLen = (sal_uInt8)sAuthor.Len(); +- if ( nNameLen > 9 ) ++ ++ String sInitials( aIter->second ); ++ sal_uInt8 nInitialsLen = (sal_uInt8)sInitials.Len(); ++ if ( nInitialsLen > 9 ) + { +- sAuthor.Erase( 9 ); +- nNameLen = 9; ++ sInitials.Erase( 9 ); ++ nInitialsLen = 9; + } + + // xstUsrInitl[ 10 ] pascal-style String holding initials + // of annotation author + if ( rWrt.bWrtWW8 ) + { +- SwWW8Writer::WriteShort(*rWrt.pTableStrm, nNameLen); +- SwWW8Writer::WriteString16(*rWrt.pTableStrm, sAuthor, ++ SwWW8Writer::WriteShort(*rWrt.pTableStrm, nInitialsLen); ++ SwWW8Writer::WriteString16(*rWrt.pTableStrm, sInitials, + false); + SwWW8Writer::FillCount( *rWrt.pTableStrm, +- (9 - nNameLen) * 2 ); ++ (9 - nInitialsLen) * 2 ); + + } + else + { +- *rWrt.pTableStrm << nNameLen; +- SwWW8Writer::WriteString8(*rWrt.pTableStrm, sAuthor, ++ *rWrt.pTableStrm << nInitialsLen; ++ SwWW8Writer::WriteString8(*rWrt.pTableStrm, sInitials, + false, RTL_TEXTENCODING_MS_1252); +- SwWW8Writer::FillCount(*rWrt.pTableStrm, 9 - nNameLen); ++ SwWW8Writer::FillCount(*rWrt.pTableStrm, 9 - nInitialsLen); + } + + // documents layout of WriteShort's below: +diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx +index c48e101..bfbbe03 100644 +--- a/sw/source/filter/ww8/wrtww8.hxx ++++ b/sw/source/filter/ww8/wrtww8.hxx +@@ -1187,6 +1187,7 @@ struct WW8_Annotation + const OutlinerParaObject* mpRichText; + String msSimpleText; + String msOwner; ++ String m_sInitials; + DateTime maDateTime; + WW8_Annotation(const SwPostItField* pPostIt); + WW8_Annotation(const SwRedlineData* pRedline); +-- +1.8.4.2 + diff --git a/SOURCES/0102-cp-2013101510000026-doc-export-of-commented-text-ran.patch b/SOURCES/0102-cp-2013101510000026-doc-export-of-commented-text-ran.patch new file mode 100644 index 0000000..0a7a79f --- /dev/null +++ b/SOURCES/0102-cp-2013101510000026-doc-export-of-commented-text-ran.patch @@ -0,0 +1,307 @@ +From d3a5776b00ee07ac371dd180a6d962d50da4baf5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zolnai=20Tam=C3=A1s?= +Date: Fri, 3 Jan 2014 15:21:32 +0100 +Subject: [PATCH 102/109] cp#2013101510000026: doc export of commented text + ranges + +(cherry picked from commit 5969eec0e998804eba77338b17de90737e2acb43) + +Conflicts: + sw/qa/extras/ww8export/ww8export.cxx + sw/qa/extras/ww8import/ww8import.cxx + sw/source/filter/ww8/wrtw8sty.cxx + sw/source/filter/ww8/ww8attributeoutput.hxx + +(cherry picked from commit 765d89aa149e9afc78382e24bf7c86f70b1584ff) + +Change-Id: I2d31da5d659edcbebc682d5604d2db24b5e341fb +--- + sw/qa/extras/ww8export/data/fdo59530.doc | Bin 0 -> 9728 bytes + sw/qa/extras/ww8export/ww8export.cxx | 27 ++++++++ + sw/qa/extras/ww8import/data/fdo59530.doc | Bin 22528 -> 0 bytes + sw/qa/extras/ww8import/ww8import.cxx | 26 ------- + sw/source/filter/ww8/wrtw8sty.cxx | 104 ++++++++++++++++++++++++++-- + sw/source/filter/ww8/wrtww8.hxx | 8 ++- + sw/source/filter/ww8/ww8atr.cxx | 5 ++ + sw/source/filter/ww8/ww8attributeoutput.hxx | 2 + + 8 files changed, 139 insertions(+), 33 deletions(-) + create mode 100644 sw/qa/extras/ww8export/data/fdo59530.doc + delete mode 100755 sw/qa/extras/ww8import/data/fdo59530.doc + +diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx +index 50ef934..3311563 100644 +--- a/sw/qa/extras/ww8import/ww8import.cxx ++++ b/sw/qa/extras/ww8import/ww8import.cxx +@@ -30,7 +30,6 @@ public: + void testN757118(); + void testN757905(); + void testAllGapsWord(); +- void testFdo59530(); + void testI120158(); + void testN816603(); + void testN816593(); +@@ -57,7 +56,6 @@ void Test::run() + {"n757118.doc", &Test::testN757118}, + {"n757905.doc", &Test::testN757905}, + {"all_gaps_word.doc", &Test::testAllGapsWord}, +- {"fdo59530.doc", &Test::testFdo59530}, + {"i120158.doc", &Test::testI120158}, + {"n816603.doc", &Test::testN816603}, + {"n816593.doc", &Test::testN816593}, +@@ -221,30 +219,6 @@ void Test::testAllGapsWord() + borderTest.testTheBorders(mxComponent); + } + +-void Test::testFdo59530() +-{ +- // See ooxmlexport's testFdo38244(). +- // Test comment range feature. +- uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); +- uno::Reference xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); +- uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); +- uno::Reference xRunEnumAccess(xParaEnum->nextElement(), uno::UNO_QUERY); +- uno::Reference xRunEnum = xRunEnumAccess->createEnumeration(); +- xRunEnum->nextElement(); +- uno::Reference xPropertySet(xRunEnum->nextElement(), uno::UNO_QUERY); +- CPPUNIT_ASSERT_EQUAL(OUString("TextFieldStart"), getProperty(xPropertySet, "TextPortionType")); +- xRunEnum->nextElement(); +- xPropertySet.set(xRunEnum->nextElement(), uno::UNO_QUERY); +- CPPUNIT_ASSERT_EQUAL(OUString("TextFieldEnd"), getProperty(xPropertySet, "TextPortionType")); +- +- // Test initials. +- uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); +- uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); +- uno::Reference xFields(xFieldsAccess->createEnumeration()); +- xPropertySet.set(xFields->nextElement(), uno::UNO_QUERY); +- CPPUNIT_ASSERT_EQUAL(OUString("M"), getProperty(xPropertySet, "Initials")); +-} +- + void Test::testI120158() + { + // See https://issues.apache.org/ooo/show_bug.cgi?id=120158 +diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx +index 17aad68..0b5422c 100644 +--- a/sw/source/filter/ww8/wrtw8sty.cxx ++++ b/sw/source/filter/ww8/wrtw8sty.cxx +@@ -1945,9 +1945,11 @@ void WW8_WrPlcFtnEdn::Append( WW8_CP nCp, const SwFmtFtn& rFtn ) + aCntnt.push_back( &rFtn ); + } + +-WW8_Annotation::WW8_Annotation(const SwPostItField* pPostIt) ++WW8_Annotation::WW8_Annotation(const SwPostItField* pPostIt, WW8_CP nRangeStart, WW8_CP nRangeEnd) + : +- maDateTime( DateTime::EMPTY ) ++ maDateTime( DateTime::EMPTY ), ++ m_nRangeStart(nRangeStart), ++ m_nRangeEnd(nRangeEnd) + { + mpRichText = pPostIt->GetTextObject(); + if (!mpRichText) +@@ -1960,17 +1962,33 @@ WW8_Annotation::WW8_Annotation(const SwPostItField* pPostIt) + WW8_Annotation::WW8_Annotation(const SwRedlineData* pRedline) + : + mpRichText(0), +- maDateTime( DateTime::EMPTY ) ++ maDateTime( DateTime::EMPTY ), ++ m_nRangeStart(0), ++ m_nRangeEnd(0) + { + msSimpleText = pRedline->GetComment(); + msOwner = SW_MOD()->GetRedlineAuthor(pRedline->GetAuthor()); + maDateTime = pRedline->GetTimeStamp(); + } + ++void WW8_WrPlcAnnotations::AddRangeStartPosition( WW8_CP nStartCp) ++{ ++ m_nLastRangeStartPos = nStartCp; ++} ++ + void WW8_WrPlcAnnotations::Append( WW8_CP nCp, const SwPostItField *pPostIt ) + { + aCps.push_back( nCp ); +- WW8_Annotation* p = new WW8_Annotation(pPostIt); ++ WW8_Annotation* p; ++ if( m_nLastRangeStartPos != -1 ) ++ { ++ p = new WW8_Annotation(pPostIt, m_nLastRangeStartPos, nCp); ++ m_nLastRangeStartPos = -1; ++ } ++ else ++ { ++ p = new WW8_Annotation(pPostIt, nCp, nCp); ++ } + aCntnt.push_back( p ); + } + +@@ -2144,11 +2162,19 @@ void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, sal_uInt8 nTTyp, + { + case TXT_ATN: + { ++ std::vector aRangeStartPos; ++ std::vector aRangeEndPos; + // then write first the GrpXstAtnOwners + for ( i = 0; i < nLen; ++i ) + { + const WW8_Annotation& rAtn = *(const WW8_Annotation*)aCntnt[i]; ++ + aStrArr.push_back(std::pair(rAtn.msOwner,rAtn.m_sInitials)); ++ if( rAtn.m_nRangeStart != rAtn.m_nRangeEnd ) ++ { ++ aRangeStartPos.push_back(rAtn.m_nRangeStart); ++ aRangeEndPos.push_back(rAtn.m_nRangeEnd); ++ } + } + + //sort and remove duplicates +@@ -2181,6 +2207,67 @@ void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, sal_uInt8 nTTyp, + nFcStart = rWrt.pTableStrm->Tell(); + rFib.lcbGrpStAtnOwners = nFcStart - rFib.fcGrpStAtnOwners; + ++ // Commented text ranges ++ if ( rWrt.bWrtWW8 ) ++ { ++ if( aRangeStartPos.size() > 0 ) ++ { ++ // Commented text ranges starting positions (Plcfbkf.aCP) ++ rFib.fcPlcfAtnbkf = nFcStart; ++ for ( i = 0; i < aRangeStartPos.size(); ++i ) ++ { ++ SwWW8Writer::WriteLong( *rWrt.pTableStrm, aRangeStartPos[i] ); ++ } ++ SwWW8Writer::WriteLong( *rWrt.pTableStrm, aRangeStartPos[i-1] + 1); ++ ++ // Commented text ranges additional informations (Plcfbkf.aFBKF) ++ for ( i = 0; i < aRangeStartPos.size(); ++i ) ++ { ++ SwWW8Writer::WriteShort( *rWrt.pTableStrm, i ); // FBKF.ibkl ++ SwWW8Writer::WriteShort( *rWrt.pTableStrm, 0 ); // FBKF.bkc ++ } ++ ++ nFcStart = rWrt.pTableStrm->Tell(); ++ rFib.lcbPlcfAtnbkf = nFcStart - rFib.fcPlcfAtnbkf; ++ ++ // Commented text ranges ending positions (PlcfBkl.aCP) ++ rFib.fcPlcfAtnbkl = nFcStart; ++ for ( i = 0; i < aRangeEndPos.size(); ++i ) ++ { ++ SwWW8Writer::WriteLong( *rWrt.pTableStrm, aRangeEndPos[i] ); ++ } ++ SwWW8Writer::WriteLong( *rWrt.pTableStrm, aRangeEndPos[i-1] + 1); ++ ++ // Commented text ranges additional informations (Plcfbkl.aFBKF) ++ for ( i = 0; i < aRangeEndPos.size(); ++i ) ++ { ++ SwWW8Writer::WriteShort( *rWrt.pTableStrm, i ); // FBKF.ibkl ++ SwWW8Writer::WriteShort( *rWrt.pTableStrm, 0 ); // FBKF.bkc ++ } ++ ++ nFcStart = rWrt.pTableStrm->Tell(); ++ rFib.lcbPlcfAtnbkl = nFcStart - rFib.fcPlcfAtnbkl; ++ ++ // Commented text ranges as bookmarks (SttbfAtnBkmk) ++ rFib.fcSttbfAtnbkmk = nFcStart; ++ SwWW8Writer::WriteShort( *rWrt.pTableStrm, 0xFFFF ); // SttbfAtnBkmk.fExtend ++ SwWW8Writer::WriteShort( *rWrt.pTableStrm, aRangeStartPos.size() ); // SttbfAtnBkmk.cData ++ SwWW8Writer::WriteShort( *rWrt.pTableStrm, 0xA ); // SttbfAtnBkmk.cbExtra ++ ++ for ( i = 0; i < aRangeStartPos.size(); ++i ) ++ { ++ SwWW8Writer::WriteShort( *rWrt.pTableStrm, 0 ); // SttbfAtnBkmk.cchData ++ // One ATNBE structure for all text ranges ++ SwWW8Writer::WriteShort( *rWrt.pTableStrm, 0x0100 ); // ATNBE.bmc ++ SwWW8Writer::WriteLong( *rWrt.pTableStrm, i ); // ATNBE.lTag ++ SwWW8Writer::WriteLong( *rWrt.pTableStrm, -1 ); // ATNBE.lTagOld ++ } ++ ++ nFcStart = rWrt.pTableStrm->Tell(); ++ rFib.lcbSttbfAtnbkmk = nFcStart - rFib.fcSttbfAtnbkmk; ++ } ++ } ++ + // Write the extended >= Word XP ATLD records + if( rWrt.bWrtWW8 ) + { +@@ -2265,6 +2352,7 @@ void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, sal_uInt8 nTTyp, + + if ( TXT_ATN == nTTyp ) + { ++ sal_uInt16 nlTag = 0; + for ( i = 0; i < nLen; ++i ) + { + const WW8_Annotation& rAtn = *(const WW8_Annotation*)aCntnt[i]; +@@ -2314,7 +2402,13 @@ void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, sal_uInt8 nTTyp, + SwWW8Writer::WriteShort( *rWrt.pTableStrm, nFndPos ); + SwWW8Writer::WriteShort( *rWrt.pTableStrm, 0 ); + SwWW8Writer::WriteShort( *rWrt.pTableStrm, 0 ); +- SwWW8Writer::WriteLong( *rWrt.pTableStrm, -1 ); ++ if( rAtn.m_nRangeStart != rAtn.m_nRangeEnd ) ++ { ++ SwWW8Writer::WriteLong( *rWrt.pTableStrm, nlTag ); ++ ++nlTag; ++ } ++ else ++ SwWW8Writer::WriteLong( *rWrt.pTableStrm, -1 ); + } + } + else +diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx +index bfbbe03..9c4b267 100644 +--- a/sw/source/filter/ww8/wrtww8.hxx ++++ b/sw/source/filter/ww8/wrtww8.hxx +@@ -1189,7 +1189,8 @@ struct WW8_Annotation + String msOwner; + String m_sInitials; + DateTime maDateTime; +- WW8_Annotation(const SwPostItField* pPostIt); ++ WW8_CP m_nRangeStart, m_nRangeEnd; ++ WW8_Annotation(const SwPostItField* pPostIt, WW8_CP nRangeStart, WW8_CP nRangeEnd); + WW8_Annotation(const SwRedlineData* pRedline); + }; + +@@ -1200,10 +1201,13 @@ private: + WW8_WrPlcAnnotations(const WW8_WrPlcAnnotations&); + WW8_WrPlcAnnotations& operator=(WW8_WrPlcAnnotations&); + std::set maProcessedRedlines; ++ ++ WW8_CP m_nLastRangeStartPos; + public: +- WW8_WrPlcAnnotations() {} ++ WW8_WrPlcAnnotations(): m_nLastRangeStartPos(-1){} + ~WW8_WrPlcAnnotations(); + ++ void AddRangeStartPosition( WW8_CP nStartCp ); + void Append( WW8_CP nCp, const SwPostItField* pPostIt ); + void Append( WW8_CP nCp, const SwRedlineData* pRedLine ); + bool IsNewRedlineComment( const SwRedlineData* pRedLine ); +diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx +index d211344..fa1a3be 100644 +--- a/sw/source/filter/ww8/ww8atr.cxx ++++ b/sw/source/filter/ww8/ww8atr.cxx +@@ -2465,6 +2465,11 @@ void WW8AttributeOutput::PostitField( const SwField* pFld ) + m_rWW8Export.WritePostItBegin( m_rWW8Export.pO ); + } + ++void WW8AttributeOutput::WritePostitFieldStart() ++{ ++ m_rWW8Export.pAtn->AddRangeStartPosition( m_rWW8Export.Fc2Cp( m_rWW8Export.Strm().Tell() ) ); ++} ++ + bool WW8AttributeOutput::DropdownField( const SwField* pFld ) + { + bool bExpand = true; +diff --git a/sw/source/filter/ww8/ww8attributeoutput.hxx b/sw/source/filter/ww8/ww8attributeoutput.hxx +index 4c64635..a9693ad 100644 +--- a/sw/source/filter/ww8/ww8attributeoutput.hxx ++++ b/sw/source/filter/ww8/ww8attributeoutput.hxx +@@ -393,6 +393,8 @@ protected: + virtual bool DropdownField( const SwField* pFld ); + virtual bool PlaceholderField( const SwField* pFld ); + ++ virtual void WritePostitFieldStart(); ++ + virtual bool AnalyzeURL( const String& rURL, const String& rTarget, String* pLinkURL, String* pMark ); + + /// Reference to the export, where to get the data from +-- +1.8.4.2 + diff --git a/SOURCES/0103-cp-2013101510000026-doc-import-of-comments-affecting.patch b/SOURCES/0103-cp-2013101510000026-doc-import-of-comments-affecting.patch new file mode 100644 index 0000000..00ac1ec --- /dev/null +++ b/SOURCES/0103-cp-2013101510000026-doc-import-of-comments-affecting.patch @@ -0,0 +1,78 @@ +From 17f7655b6dedb7349c3ecd8445f119c4d14641b0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zolnai=20Tam=C3=A1s?= +Date: Fri, 3 Jan 2014 00:41:56 +0100 +Subject: [PATCH 103/109] cp#2013101510000026: doc import of comments affecting + more text nodes + +Change-Id: I3932d82cb4cd640b19957b93cc7e59711af1b564 +(cherry picked from commit f2945255df273404ee2457dcf761cb8f334b732b) +(cherry picked from commit e0bd7b01f31bfbaeac3bce86403bf25929c61c84) +--- + sw/qa/extras/ww8export/data/fdo59530.doc | Bin 9728 -> 10240 bytes + sw/qa/extras/ww8export/ww8export.cxx | 15 +++++++++- + sw/source/filter/ww8/ww8par.cxx | 49 +++++++++++++++++++++++++++---- + 3 files changed, 58 insertions(+), 6 deletions(-) + +diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx +index 56040b7..645d246 100644 +--- a/sw/source/filter/ww8/ww8par.cxx ++++ b/sw/source/filter/ww8/ww8par.cxx +@@ -1825,11 +1825,50 @@ long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes) + WW8_CP nStart = GetAnnotationStart(nAtnIndex); + WW8_CP nEnd = GetAnnotationEnd(nAtnIndex); + sal_Int32 nLen = nEnd - nStart; +- // Don't support ranges affecting multiple SwTxtNode for now. +- if (nLen && pPaM->GetPoint()->nContent.GetIndex() >= nLen) +- { +- pPaM->SetMark(); +- pPaM->GetPoint()->nContent -= nLen; ++ if( nLen ) ++ { ++ if (pPaM->GetPoint()->nContent.GetIndex() >= nLen) ++ { ++ pPaM->SetMark(); ++ pPaM->GetPoint()->nContent -= nLen; ++ } ++ else if (pPaM->GetPoint()->nNode.GetNode().IsTxtNode() ) ++ { ++ pPaM->SetMark(); ++ nLen -= pPaM->GetPoint()->nContent.GetIndex(); ++ ++ SwTxtNode* pTxtNode = 0; ++ // Find first text node which affected by the comment ++ while( pPaM->GetPoint()->nNode >= 0 ) ++ { ++ SwNode* pNode = 0; ++ // Find previous text node ++ do ++ { ++ pPaM->GetPoint()->nNode--; ++ nLen--; // End line character ++ pNode = &pPaM->GetPoint()->nNode.GetNode(); ++ } ++ while( !pNode->IsTxtNode() && pPaM->GetPoint()->nNode >= 0 ); ++ ++ // Subtrackt previous text node's length ++ if( pNode && pNode->IsTxtNode() ) ++ { ++ pTxtNode = pNode->GetTxtNode(); ++ if( nLen < pTxtNode->Len() ) ++ break; ++ else ++ nLen -= pTxtNode->Len(); ++ } ++ } ++ ++ // Set postion of the text range's first character ++ if( pTxtNode ) ++ { ++ pTxtNode->MakeStartIndex(&pPaM->GetPoint()->nContent); ++ pPaM->GetPoint()->nContent += pTxtNode->Len() - nLen; ++ } ++ } + } + } + } +-- +1.8.4.2 + diff --git a/SOURCES/0104-pages-with-equal-Priority-and-Class-getting-dropped.patch b/SOURCES/0104-pages-with-equal-Priority-and-Class-getting-dropped.patch new file mode 100644 index 0000000..b401cf2 --- /dev/null +++ b/SOURCES/0104-pages-with-equal-Priority-and-Class-getting-dropped.patch @@ -0,0 +1,40 @@ +From 6a7a73d278c300ac7519d1ec50e5a4495f174f89 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Thu, 12 Dec 2013 12:37:43 +0000 +Subject: [PATCH 104/109] pages with equal Priority and Class getting dropped + +Change-Id: Ib053dc4b6e5fb5f01f48c71a4b295a53c0ec6715 +(cherry picked from commit 9790588da4b2de455ffc7a2cc69f26539823c3da) +(cherry picked from commit be366ad7690b190c5ef4dc42311a4df6b7dcce4b) +Reviewed-on: https://gerrit.libreoffice.org/7054 +Reviewed-by: Stephan Bergmann +Tested-by: Stephan Bergmann +--- + sd/source/ui/slidesorter/cache/SlsRequestQueue.cxx | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/sd/source/ui/slidesorter/cache/SlsRequestQueue.cxx b/sd/source/ui/slidesorter/cache/SlsRequestQueue.cxx +index d02bae1..835787b 100644 +--- a/sd/source/ui/slidesorter/cache/SlsRequestQueue.cxx ++++ b/sd/source/ui/slidesorter/cache/SlsRequestQueue.cxx +@@ -40,9 +40,14 @@ public: + bool operator() (const Request& rRequest1, const Request& rRequest2) + { + if (rRequest1.meClass == rRequest2.meClass) +- return (rRequest1.mnPriorityInClass > rRequest2.mnPriorityInClass); +- else +- return (rRequest1.meClass < rRequest2.meClass); ++ { ++ if (rRequest1.mnPriorityInClass == rRequest2.mnPriorityInClass) ++ { ++ return rRequest1.maKey < rRequest2.maKey; ++ } ++ return rRequest1.mnPriorityInClass > rRequest2.mnPriorityInClass; ++ } ++ return rRequest1.meClass < rRequest2.meClass; + } + }; + /** Request data is compared arbitrarily by their addresses in memory. +-- +1.8.4.2 + diff --git a/SOURCES/0105-only-write-new-element-and-attributes-in-ODF-1.2-ext.patch b/SOURCES/0105-only-write-new-element-and-attributes-in-ODF-1.2-ext.patch new file mode 100644 index 0000000..52b0084 --- /dev/null +++ b/SOURCES/0105-only-write-new-element-and-attributes-in-ODF-1.2-ext.patch @@ -0,0 +1,30 @@ +From a487e676ef96d1e6e2efa8680385720667790a60 Mon Sep 17 00:00:00 2001 +From: Markus Mohrhard +Date: Sat, 28 Dec 2013 08:13:12 +0100 +Subject: [PATCH 105/109] only write new element and attributes in ODF 1.2 + extended + +Change-Id: I038f200f500ef1c6a0815b6332fb17bb2f62282a +Reviewed-on: https://gerrit.libreoffice.org/7221 +Reviewed-by: Eike Rathke +Tested-by: Eike Rathke +--- + sc/source/filter/xml/xmlexprt.cxx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx +index 0fbc692..4f97260 100644 +--- a/sc/source/filter/xml/xmlexprt.cxx ++++ b/sc/source/filter/xml/xmlexprt.cxx +@@ -2709,7 +2709,7 @@ void ScXMLExport::WriteTable(sal_Int32 nTable, const ReferenceisProtected()) ++ if (pProtect && pProtect->isProtected() && getDefaultVersion() > SvtSaveOptions::ODFVER_012) + { + if (pProtect->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS)) + AddAttribute(XML_NAMESPACE_TABLE, XML_SELECT_PROTECTED_CELLS, XML_TRUE); +-- +1.8.4.2 + diff --git a/SOURCES/0106-read-elements-attribs-written-to-extension-namespace.patch b/SOURCES/0106-read-elements-attribs-written-to-extension-namespace.patch new file mode 100644 index 0000000..748b8aa --- /dev/null +++ b/SOURCES/0106-read-elements-attribs-written-to-extension-namespace.patch @@ -0,0 +1,88 @@ +From 3d7011c3c2b47aca273d7e8a26bdaeaf982d8702 Mon Sep 17 00:00:00 2001 +From: Markus Mohrhard +Date: Sat, 28 Dec 2013 12:44:02 +0100 +Subject: [PATCH 106/109] read elements/attribs written to extension namespace + +Related to validation errors with fdo#31296 + +Change-Id: I1b76e05a9996b1123db164629475a3f7b07dda69 +Reviewed-on: https://gerrit.libreoffice.org/7222 +Reviewed-by: Eike Rathke +Tested-by: Eike Rathke +--- + sc/source/filter/xml/xmlimprt.cxx | 3 +++ + sc/source/filter/xml/xmlimprt.hxx | 5 ++++- + sc/source/filter/xml/xmltabi.cxx | 3 +++ + 3 files changed, 10 insertions(+), 1 deletion(-) + +diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx +index 28c3ace..3378541 100644 +--- a/sc/source/filter/xml/xmlimprt.cxx ++++ b/sc/source/filter/xml/xmlimprt.cxx +@@ -828,6 +828,7 @@ const SvXMLTokenMap& ScXMLImport::GetTableElemTokenMap() + { XML_NAMESPACE_TABLE, XML_TABLE_COLUMNS, XML_TOK_TABLE_COLS }, + { XML_NAMESPACE_TABLE, XML_TABLE_COLUMN, XML_TOK_TABLE_COL }, + { XML_NAMESPACE_TABLE, XML_TABLE_PROTECTION, XML_TOK_TABLE_PROTECTION }, ++ { XML_NAMESPACE_OFFICE_EXT, XML_TABLE_PROTECTION, XML_TOK_TABLE_PROTECTION_EXT }, + { XML_NAMESPACE_TABLE, XML_TABLE_ROW_GROUP, XML_TOK_TABLE_ROW_GROUP }, + { XML_NAMESPACE_TABLE, XML_TABLE_HEADER_ROWS, XML_TOK_TABLE_HEADER_ROWS }, + { XML_NAMESPACE_TABLE, XML_TABLE_ROWS, XML_TOK_TABLE_ROWS }, +@@ -856,6 +857,8 @@ const SvXMLTokenMap& ScXMLImport::GetTableProtectionAttrTokenMap() + { + { XML_NAMESPACE_TABLE, XML_SELECT_PROTECTED_CELLS, XML_TOK_TABLE_SELECT_PROTECTED_CELLS }, + { XML_NAMESPACE_TABLE, XML_SELECT_UNPROTECTED_CELLS, XML_TOK_TABLE_SELECT_UNPROTECTED_CELLS }, ++ { XML_NAMESPACE_OFFICE_EXT, XML_SELECT_PROTECTED_CELLS, XML_TOK_TABLE_SELECT_PROTECTED_CELLS_EXT }, ++ { XML_NAMESPACE_OFFICE_EXT, XML_SELECT_UNPROTECTED_CELLS, XML_TOK_TABLE_SELECT_UNPROTECTED_CELLS_EXT }, + XML_TOKEN_MAP_END + }; + pTableProtectionElemTokenMap = new SvXMLTokenMap(aTableProtectionTokenMap); +diff --git a/sc/source/filter/xml/xmlimprt.hxx b/sc/source/filter/xml/xmlimprt.hxx +index 0957a9f..3fb584a 100644 +--- a/sc/source/filter/xml/xmlimprt.hxx ++++ b/sc/source/filter/xml/xmlimprt.hxx +@@ -240,6 +240,7 @@ enum ScXMLTableTokens + XML_TOK_TABLE_ROW_GROUP, + XML_TOK_TABLE_HEADER_ROWS, + XML_TOK_TABLE_PROTECTION, ++ XML_TOK_TABLE_PROTECTION_EXT, + XML_TOK_TABLE_ROWS, + XML_TOK_TABLE_ROW, + XML_TOK_TABLE_SOURCE, +@@ -254,7 +255,9 @@ enum ScXMLTableTokens + enum ScXMLTokenProtectionTokens + { + XML_TOK_TABLE_SELECT_PROTECTED_CELLS, +- XML_TOK_TABLE_SELECT_UNPROTECTED_CELLS ++ XML_TOK_TABLE_SELECT_UNPROTECTED_CELLS, ++ XML_TOK_TABLE_SELECT_PROTECTED_CELLS_EXT, ++ XML_TOK_TABLE_SELECT_UNPROTECTED_CELLS_EXT + }; + + enum ScXMLTableRowsTokens +diff --git a/sc/source/filter/xml/xmltabi.cxx b/sc/source/filter/xml/xmltabi.cxx +index a1bc801..f15a602 100644 +--- a/sc/source/filter/xml/xmltabi.cxx ++++ b/sc/source/filter/xml/xmltabi.cxx +@@ -286,6 +286,7 @@ SvXMLImportContext *ScXMLTableContext::CreateChildContext( sal_uInt16 nPrefix, + rLName, xAttrList ); + break; + case XML_TOK_TABLE_PROTECTION: ++ case XML_TOK_TABLE_PROTECTION_EXT: + pContext = new ScXMLTableProtectionContext( GetScImport(), nPrefix, rLName, xAttrList ); + break; + case XML_TOK_TABLE_ROW_GROUP: +@@ -454,9 +455,11 @@ ScXMLTableProtectionContext::ScXMLTableProtectionContext( + switch (rAttrTokenMap.Get(nLocalPrefix, aLocalName)) + { + case XML_TOK_TABLE_SELECT_PROTECTED_CELLS: ++ case XML_TOK_TABLE_SELECT_PROTECTED_CELLS_EXT: + bSelectProtectedCells = IsXMLToken(aValue, XML_TRUE); + break; + case XML_TOK_TABLE_SELECT_UNPROTECTED_CELLS: ++ case XML_TOK_TABLE_SELECT_UNPROTECTED_CELLS_EXT: + bSelectUnprotectedCells = IsXMLToken(aValue, XML_TRUE); + break; + default: +-- +1.8.4.2 + diff --git a/SOURCES/0107-cp-2013101510000026-fix-file-coruption-caused-by-com.patch b/SOURCES/0107-cp-2013101510000026-fix-file-coruption-caused-by-com.patch new file mode 100644 index 0000000..28dce52 --- /dev/null +++ b/SOURCES/0107-cp-2013101510000026-fix-file-coruption-caused-by-com.patch @@ -0,0 +1,37 @@ +From 5ea7f28bb9f787a1650e0d126e28ffb543c2a363 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zolnai=20Tam=C3=A1s?= +Date: Mon, 6 Jan 2014 15:59:50 +0100 +Subject: [PATCH 107/109] cp#2013101510000026: fix file coruption caused by + comments' doc export + +Plcfbkl contains only character positions. The Plcfbkf is that one +which contains additional informations. + +Change-Id: I9bd8eec5c8e64d9d757764dae51bcb866456cdc9 +(cherry picked from commit 3ed870e237a0b7b95f48bfb8192fe7d5c2957a03) +--- + sw/qa/extras/ww8export/data/fdo59530.doc | Bin 10240 -> 10240 bytes + sw/source/filter/ww8/wrtw8sty.cxx | 7 ------- + 2 files changed, 7 deletions(-) + +diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx +index 0b5422c..7b27efd 100644 +--- a/sw/source/filter/ww8/wrtw8sty.cxx ++++ b/sw/source/filter/ww8/wrtw8sty.cxx +@@ -2238,13 +2238,6 @@ void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, sal_uInt8 nTTyp, + } + SwWW8Writer::WriteLong( *rWrt.pTableStrm, aRangeEndPos[i-1] + 1); + +- // Commented text ranges additional informations (Plcfbkl.aFBKF) +- for ( i = 0; i < aRangeEndPos.size(); ++i ) +- { +- SwWW8Writer::WriteShort( *rWrt.pTableStrm, i ); // FBKF.ibkl +- SwWW8Writer::WriteShort( *rWrt.pTableStrm, 0 ); // FBKF.bkc +- } +- + nFcStart = rWrt.pTableStrm->Tell(); + rFib.lcbPlcfAtnbkl = nFcStart - rFib.fcPlcfAtnbkl; + +-- +1.8.4.2 + diff --git a/SOURCES/0108-Fix-fdo-70807-Page-Style-method-isInUse-broken.patch b/SOURCES/0108-Fix-fdo-70807-Page-Style-method-isInUse-broken.patch new file mode 100644 index 0000000..4e532cb --- /dev/null +++ b/SOURCES/0108-Fix-fdo-70807-Page-Style-method-isInUse-broken.patch @@ -0,0 +1,47 @@ +From 63c2990d0e67e90f5445dac10c8c1f7919031482 Mon Sep 17 00:00:00 2001 +From: Marcos Paulo de Souza +Date: Tue, 7 Jan 2014 12:42:25 -0200 +Subject: [PATCH 108/109] Fix fdo#70807: Page Style method isInUse() broken + +We need to check m_FirstMaster and m_FirstLeft too to verify is a style is used + +Thanks a lot mst__ for pointing how to fix this! + +Change-Id: Ic9c37c552893c17fba4aabcc0fd4beb7fe2550e8 +Reviewed-on: https://gerrit.libreoffice.org/7295 +Reviewed-by: Michael Stahl +Tested-by: Olivier Hallot +(cherry picked from commit 6131787afbb32e1e12aac4cf4f65625d11d39f08) +Signed-off-by: Michael Stahl +--- + sw/source/core/layout/pagedesc.cxx | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx +index 05a24d1..1f7addb 100644 +--- a/sw/source/core/layout/pagedesc.cxx ++++ b/sw/source/core/layout/pagedesc.cxx +@@ -156,13 +156,16 @@ void SwPageDesc::ResetAllAttr( sal_Bool bLeft ) + |* + *************************************************************************/ + +- +- // gets information from Modify ++// gets information from Modify + bool SwPageDesc::GetInfo( SfxPoolItem & rInfo ) const + { + if( !aMaster.GetInfo( rInfo ) ) +- return false; // found +- return aLeft.GetInfo( rInfo ); ++ return false; // found ++ if ( !aLeft.GetInfo( rInfo ) ) ++ return false ; ++ if ( !m_FirstMaster.GetInfo( rInfo ) ) ++ return false; ++ return m_FirstLeft.GetInfo( rInfo ); + } + + /************************************************************************* +-- +1.8.4.2 + diff --git a/SOURCES/0109-No-serviceNames-attribute-in-Loader.patch b/SOURCES/0109-No-serviceNames-attribute-in-Loader.patch new file mode 100644 index 0000000..70cf16b --- /dev/null +++ b/SOURCES/0109-No-serviceNames-attribute-in-Loader.patch @@ -0,0 +1,30 @@ +From ac3c6de70409ab3a14d92a0644c29323e47605bf Mon Sep 17 00:00:00 2001 +From: Stephan Bergmann +Date: Tue, 7 Jan 2014 15:37:16 +0100 +Subject: [PATCH 109/109] No serviceNames attribute in Loader + +Change-Id: I6cc001d18683fc412f0ec0b6a33054d6e745463f +(cherry picked from commit 431b49fbec68c17c7a486ef0f577107d3dd27e55) +Reviewed-on: https://gerrit.libreoffice.org/7294 +Reviewed-by: Michael Stahl +Tested-by: Michael Stahl +--- + pyuno/source/loader/pythonloader.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pyuno/source/loader/pythonloader.py b/pyuno/source/loader/pythonloader.py +index 3074d0f..1d1b7de 100644 +--- a/pyuno/source/loader/pythonloader.py ++++ b/pyuno/source/loader/pythonloader.py +@@ -157,7 +157,7 @@ class Loader( XImplementationLoader, XServiceInfo, unohelper.Base ): + return g_implementationName + + def supportsService( self, ServiceName ): +- return ServiceName in self.serviceNames ++ return ServiceName in self.getSupportedServiceNames() + + def getSupportedServiceNames( self ): + return g_supportedServices +-- +1.8.4.2 + diff --git a/SPECS/libreoffice.spec b/SPECS/libreoffice.spec index abb595a..b9ba8bd 100644 --- a/SPECS/libreoffice.spec +++ b/SPECS/libreoffice.spec @@ -1,5 +1,5 @@ # download path contains version without the last (fourth) digit -%define libo_version 4.1.3 +%define libo_version 4.1.4 # Should contain .alphaX / .betaX, if this is pre-release (actually # pre-RC) version. The pre-release string is part of tarball file names, # so we need a way to define it easily at one place. @@ -249,23 +249,99 @@ Patch10: libreoffice-rhel6limits.patch Patch11: libreoffice-rhel6glib.patch %endif Patch12: 0001-do-not-build-LibreOffice_Test.patch -Patch13: 0001-Resolves-rhbz-968892-force-render-full-grapheme-with.patch -Patch14: 0001-Related-rhbz-968892-discard-impossible-languages-for.patch -Patch15: 0002-Related-rhbz-968892-discard-impossible-languages-for.patch -Patch16: 0001-Resolves-fdo-48835-application-menu-for-LibreOffice.patch -Patch17: 0001-Make-charmap.cxx-compile-with-icu-4.4.patch -Patch18: 0001-select-sheet-menu-as-a-right-click-popup-to-the-prev.patch -Patch19: 0001-Resolves-rhbz-1013480-crash-in-EditLineList-operator.patch -Patch20: 0001-Resolves-rhbz-1015281-crash-on-clicking-custom-anima.patch -Patch21: 0001-Resolves-rhbz-996162-apparent-NULL-bullet-font.patch -Patch22: 0001-fdo-70201-sw-eliminate-no-extent-RSID-only-AUTOFMT-h.patch -Patch23: 0001-WaE-Wstrict-overflow-assuming-signed-overflow-does-n.patch -Patch24: 0001-Related-rhbz-1020712-wrong-default-font-shown-in-edi.patch -Patch25: 0001-Related-rhbz-919070-display-1-means-span-all-display.patch -Patch26: 0001-fdo-67725-unoidl-AggregatingCursor-must-wrap-modules.patch -Patch27: 0001-Resolves-rhbz-1021915-force-menubar-menus-to-be-up-d.patch -Patch28: 0001-fdo-70968-Incorrect-rendering-of-Devanagari-short-i-.patch -Patch29: 0001-resolved-fdo-56209-reviving-FilterFormulaParser.patch +Patch13: 0001-Resolves-fdo-48835-application-menu-for-LibreOffice.patch +Patch14: 0001-Make-charmap.cxx-compile-with-icu-4.4.patch +Patch15: 0001-select-sheet-menu-as-a-right-click-popup-to-the-prev.patch +Patch16: 0001-Resolves-rhbz-1013480-crash-in-EditLineList-operator.patch +Patch17: 0001-Resolves-rhbz-1015281-crash-on-clicking-custom-anima.patch +Patch18: 0001-Related-rhbz-919070-display-1-means-span-all-display.patch +Patch19: 0001-Resolves-rhbz-1021915-force-menubar-menus-to-be-up-d.patch +# beginning of additional 4.1 patches +Patch20: 0002-EMF-Stroke-size-is-always-supposed-to-be-absolute.patch +Patch21: 0003-fdo-61272-Do-the-mapping-correctly-both-for-WMF-and-.patch +Patch22: 0004-EMF-Implement-line-dashing.patch +Patch23: 0005-EMF-Parse-and-render-custom-line-cap-data.patch +Patch24: 0006-EMF-Line-thickness-has-to-be-considered-when-drawing.patch +Patch25: 0007-cairo-canvas-Line-dashing-size-depends-on-the-line-w.patch +Patch26: 0011-resolved-fdo-67572-export-add-in-equivalents-as-inte.patch +Patch27: 0012-resolved-fdo-61946-use-correct-TabDelta-for-UpdateRe.patch +Patch28: 0013-resolved-fdo-53103-actually-use-the-external-data-fi.patch +Patch29: 0014-resolved-fdo-67536-export-internal-equivalents-as-ad.patch +Patch30: 0016-fix-2D-vs-3D-coordinatesystem-regression-fdo-67300.patch +Patch31: 0017-fix-validation-error-for-OOXML-chart-export-related-.patch +Patch32: 0020-fdo-72078-make-status-bar-text-localizable.patch +Patch33: 0021-don-t-use-fixed-size-icon-sets-fdo-62652.patch +Patch34: 0025-fdo-71056-add-sup-to-list-of-inline-help-XML-tags.patch +Patch35: 0029-fdo-71434-don-t-show-master-text-if-PlaceHolder-type.patch +Patch36: 0032-write-valid-dxf-record-related-fdo-71971.patch +Patch37: 0036-EMF-Do-not-ignore-source-rectangle-of-the-image-to-b.patch +Patch38: 0038-EMF-force-canvas-if-EMF-comments-are-used.patch +Patch39: 0039-Relater-rhbz-903281-NULL-follow-frames-on-drag-drop.patch +Patch40: 0040-fdo-69984-Handle-duplicate-field-names-correctly.patch +Patch41: 0042-fdo-71892-sw-fix-crash-when-pasting-table-in-footnot.patch +Patch42: 0043-fdo-69518-Correctly-handle-the-old-constraint-syntax.patch +Patch43: 0044-Do-not-create-paths-starting-when-root-is-just.patch +Patch44: 0046-fdo-66984-Define-an-assignment-operator-to-prevent-d.patch +Patch45: 0047-EMF-Fill-line-cap-object-if-EmfPlusCustomLineCapData.patch +Patch46: 0049-fdo-72488-Broken-text-when-showing-visible-space.patch +Patch47: 0050-CID-736170-CID-736171-CID-736172-Out-of-Bounds-read-.patch +Patch48: 0056-sax-xmloff-fix-ODF-import-export-of-text-time-text-t.patch +Patch49: 0057-fdo-66969-Set-selected-page-name-after-building-all-.patch +Patch50: 0058-fdo-66969-Reset-group-dimension-data-from-all-refere.patch +Patch51: 0059-fdo-68160-Revert-Resolves-ii122335-Disabling-the-old.patch +Patch52: 0060-fdo-66864-Return-from-full-screen-should-restore-too.patch +Patch53: 0061-fdo-70499-selectn-of-lock-unlocked-cells-with-worksh.patch +Patch54: 0063-correctly-dispose-to-avoid-cyclic-dependencies.patch +Patch55: 0064-disposed-but-not-dtored.patch +Patch56: 0065-fdo-72697-accept-future-loext-sender-initials.patch +Patch57: 0066-odbc-DBMetaData-NULL-pattern-equivalent-to-not-foo.patch +Patch58: 0067-fdo-72697-actually-write-this-only-in-ODF-1.2-extend.patch +Patch59: 0068-fdo-72163-fix-safer-way.patch +Patch60: 0071-Do-not-use-Boost-in-SDK-examples.patch +Patch61: 0072-Keep-using-component_getImplementationEnvironment-in.patch +Patch62: 0073-Avoid-inaccurate-floating-point-computations.patch +Patch63: 0074-fdo-72850-ODF-export-don-t-export-spurious-style-dis.patch +Patch64: 0075-m_bHasActive-must-be-false-after-last-visible-entry-.patch +Patch65: 0076-fdo-60705-Don-t-discard-valid-printing-options.patch +Patch66: 0077-fdo-70232-sw-brown-paper-bag-fix-for-header-sharing-.patch +Patch67: 0078-fdo-69065-sw-fix-mirrored-page-style-with-first-page.patch +Patch68: 0079-fdo-71429-sw-fix-crashes-when-changing-header-first-.patch +Patch69: 0080-XMLPropertyMapEntry-mbImportOnly-and-XMLPropertySetM.patch +Patch70: 0081-prepare-to-read-loext-vertical-justify-fdo-72922.patch +Patch71: 0082-prepare-to-accept-loext-contextual-spacing-fdo-58112.patch +Patch72: 0083-fdo-67370-Hyphens-are-not-visible-in-tagged-PDF.patch +Patch73: 0084-fdo-72916-correct-rounding-of-time-part-of-DateTime.patch +Patch74: 0085-Fix-stepping-to-the-next-change.patch +Patch75: 0086-DOCX-import-close-rPrChange-properly.patch +Patch76: 0088-fdo-65090-RTF-filter-import-RTF_CLMGF-and-RTF_CLMRG.patch +Patch77: 0089-Resolves-fdo-72961-Crash-when-you-open-ODFver.1.0-1..patch +Patch78: 0090-fdo-39206-Add-support-for-image-transformation-in-SV.patch +Patch79: 0091-EMF-Integer-coordinate-values-are-signed.patch +Patch80: 0092-EMF-actually-use-lineJoin-attribute-for-polygons.patch +Patch81: 0093-EMF-mapping-can-rotate-the-width-vector-so-use-resul.patch +Patch82: 0095-Resolves-fdo-72464-Character-line-break-is-set-to-0-.patch +Patch83: 0096-Make-CalcFocusRect-look-right.patch +Patch84: 0097-die-binfilter-die-die-die.patch +Patch85: 0099-added-EEK-and-LVL-to-EUROCONVERT-EUR-to-LV-locale-da.patch +Patch86: 0100-cp-2013101510000026-wrong-highlight-of-commented-tex.patch +Patch87: 0101-cp-2013101510000026-fix-doc-export-of-comments-initi.patch +Patch88: 0102-cp-2013101510000026-doc-export-of-commented-text-ran.patch +Patch89: 0103-cp-2013101510000026-doc-import-of-comments-affecting.patch +Patch90: 0104-pages-with-equal-Priority-and-Class-getting-dropped.patch +Patch91: 0105-only-write-new-element-and-attributes-in-ODF-1.2-ext.patch +Patch92: 0106-read-elements-attribs-written-to-extension-namespace.patch +Patch93: 0107-cp-2013101510000026-fix-file-coruption-caused-by-com.patch +Patch94: 0108-Fix-fdo-70807-Page-Style-method-isInUse-broken.patch +Patch95: 0109-No-serviceNames-attribute-in-Loader.patch +Patch96: 0001-n-839727-rhbz-1038176-Crash-fix.patch +Patch97: 0002-fdo-72645-Allow-GETPIVOTDATA-to-get-result-from-leaf.patch +Patch98: 0003-fdo-72645-Case-insensitive-string-comparison-in-GETP.patch +Patch99: 0004-fdo-72774-Ensure-that-all-the-group-fields-are-in-ca.patch +Patch100: 0005-fdo-72774-Generate-correct-group-items-for-the-year-.patch +Patch101: 0006-fix-occasional-crash-on-dragging-and-dropping-pages-.patch +Patch102: 0007-fdo-37167-create-statement-before-execute-wasNull-ge.patch +Patch103: 0008-fdo-72219-Fix-for-corruption-of-symbols-in-docx.patch +# end of additional 4.1 patches %define instdir %{_libdir} %define baseinstdir %{instdir}/libreoffice @@ -652,6 +728,7 @@ used as a backend server for e.g. document conversion. %package glade Summary: Support for creating LibreOffice dialogs in glade Group: Development/Libraries +Requires: %{name}-ure = %{epoch}:%{version}-%{release} Requires: %{name}-core = %{epoch}:%{version}-%{release} Requires: glade3-libgladeui @@ -897,7 +974,7 @@ Rules for auto-correcting common %{langname} typing errors. \ %langpack -l nr -n %{langpack_lang} -F -H -o nr_ZA %define langpack_lang Northern Sotho %langpack -l nso -n %{langpack_lang} -F -H -o nso_ZA -w nso_ZA -%langpack -l or -n Oriya -F -H -Y -s ctl -o or_IN -w or_IN +%langpack -l or -n Odia -F -H -Y -s ctl -o or_IN -w or_IN %langpack -l pa -n Punjabi -F -H -Y -s ctl -L pa-IN -O -v pa_IN -w pa_IN %langpack -l pl -n Polish -F -H -Y -M -A -T -X -o pl_PL -V -w pl_PL %define langpack_lang Brazilian Portuguese @@ -1013,23 +1090,97 @@ mv -f redhat.soc extras/source/palettes/standard.soc %patch11 -p1 -b .rhel6glib.patch %endif %patch12 -p1 -b .do-not-build-LibreOffice_Test.patch -%patch13 -p1 -b .rhbz-968892-force-render-full-grapheme-with.patch -%patch14 -p1 -b .rhbz-968892-discard-impossible-languages-for.patch -%patch15 -p1 -b .rhbz-968892-discard-impossible-languages-for.patch -%patch16 -p1 -b .fdo-48835-application-menu-for-LibreOffice.patch -%patch17 -p1 -b .Make-charmap.cxx-compile-with-icu-4.4.patch -%patch18 -p1 -b .select-sheet-menu-as-a-right-click-popup-to-the-prev.patch -%patch19 -p1 -b .rhbz-1013480-crash-in-EditLineList-operator.patch -%patch20 -p1 -b .rhbz-1015281-crash-on-clicking-custom-anima.patch -%patch21 -p1 -b .rhbz-996162-apparent-NULL-bullet-font.patch -%patch22 -p1 -b .fdo-70201-sw-eliminate-no-extent-RSID-only-AUTOFMT-h.patch -%patch23 -p1 -b .WaE-Wstrict-overflow-assuming-signed-overflow-does-n.patch -%patch24 -p1 -b .rhbz-1020712-wrong-default-font-shown-in-edi.patch -%patch25 -p1 -b .rhbz-919070-display-1-means-span-all-display.patch -%patch26 -p1 -b .fdo-67725-unoidl-AggregatingCursor-must-wrap-modules.patch -%patch27 -p1 -b .rhbz-1021915-force-menubar-menus-to-be-up-d.patch -%patch28 -p1 -b .fdo-70968-Incorrect-rendering-of-Devanagari-short-i-.patch -%patch29 -p1 -b .resolved-fdo-56209-reviving-FilterFormulaParser.patch +%patch13 -p1 -b .fdo-48835-application-menu-for-LibreOffice.patch +%patch14 -p1 -b .Make-charmap.cxx-compile-with-icu-4.4.patch +%patch15 -p1 -b .select-sheet-menu-as-a-right-click-popup-to-the-prev.patch +%patch16 -p1 -b .rhbz-1013480-crash-in-EditLineList-operator.patch +%patch17 -p1 -b .rhbz-1015281-crash-on-clicking-custom-anima.patch +%patch18 -p1 -b .rhbz-919070-display-1-means-span-all-display.patch +%patch19 -p1 -b .rhbz-1021915-force-menubar-menus-to-be-up-d.patch +%patch20 -p1 -b .EMF-Stroke-size-is-always-supposed-to-be-absolute.patch +%patch21 -p1 -b .fdo-61272-Do-the-mapping-correctly-both-for-WMF-and-.patch +%patch22 -p1 -b .EMF-Implement-line-dashing.patch +%patch23 -p1 -b .EMF-Parse-and-render-custom-line-cap-data.patch +%patch24 -p1 -b .EMF-Line-thickness-has-to-be-considered-when-drawing.patch +%patch25 -p1 -b .cairo-canvas-Line-dashing-size-depends-on-the-line-w.patch +%patch26 -p1 -b .resolved-fdo-67572-export-add-in-equivalents-as-inte.patch +%patch27 -p1 -b .resolved-fdo-61946-use-correct-TabDelta-for-UpdateRe.patch +%patch28 -p1 -b .resolved-fdo-53103-actually-use-the-external-data-fi.patch +%patch29 -p1 -b .resolved-fdo-67536-export-internal-equivalents-as-ad.patch +%patch30 -p1 -b .fix-2D-vs-3D-coordinatesystem-regression-fdo-67300.patch +%patch31 -p1 -b .fix-validation-error-for-OOXML-chart-export-related-.patch +%patch32 -p1 -b .fdo-72078-make-status-bar-text-localizable.patch +%patch33 -p1 -b .don-t-use-fixed-size-icon-sets-fdo-62652.patch +%patch34 -p1 -b .fdo-71056-add-sup-to-list-of-inline-help-XML-tags.patch +%patch35 -p1 -b .fdo-71434-don-t-show-master-text-if-PlaceHolder-type.patch +%patch36 -p1 -b .write-valid-dxf-record-related-fdo-71971.patch +%patch37 -p1 -b .EMF-Do-not-ignore-source-rectangle-of-the-image-to-b.patch +%patch38 -p1 -b .EMF-force-canvas-if-EMF-comments-are-used.patch +%patch39 -p1 -b .Relater-rhbz-903281-NULL-follow-frames-on-drag-drop.patch +%patch40 -p1 -b .fdo-69984-Handle-duplicate-field-names-correctly.patch +%patch41 -p1 -b .fdo-71892-sw-fix-crash-when-pasting-table-in-footnot.patch +%patch42 -p1 -b .fdo-69518-Correctly-handle-the-old-constraint-syntax.patch +%patch43 -p1 -b .Do-not-create-paths-starting-when-root-is-just.patch +%patch44 -p1 -b .fdo-66984-Define-an-assignment-operator-to-prevent-d.patch +%patch45 -p1 -b .EMF-Fill-line-cap-object-if-EmfPlusCustomLineCapData.patch +%patch46 -p1 -b .fdo-72488-Broken-text-when-showing-visible-space.patch +%patch47 -p1 -b .CID-736170-CID-736171-CID-736172-Out-of-Bounds-read-.patch +%patch48 -p1 -b .sax-xmloff-fix-ODF-import-export-of-text-time-text-t.patch +%patch49 -p1 -b .fdo-66969-Set-selected-page-name-after-building-all-.patch +%patch50 -p1 -b .fdo-66969-Reset-group-dimension-data-from-all-refere.patch +%patch51 -p1 -b .fdo-68160-Revert-Resolves-ii122335-Disabling-the-old.patch +%patch52 -p1 -b .fdo-66864-Return-from-full-screen-should-restore-too.patch +%patch53 -p1 -b .fdo-70499-selectn-of-lock-unlocked-cells-with-worksh.patch +%patch54 -p1 -b .correctly-dispose-to-avoid-cyclic-dependencies.patch +%patch55 -p1 -b .disposed-but-not-dtored.patch +%patch56 -p1 -b .fdo-72697-accept-future-loext-sender-initials.patch +%patch57 -p1 -b .odbc-DBMetaData-NULL-pattern-equivalent-to-not-foo.patch +%patch58 -p1 -b .fdo-72697-actually-write-this-only-in-ODF-1.2-extend.patch +%patch59 -p1 -b .fdo-72163-fix-safer-way.patch +%patch60 -p1 -b .Do-not-use-Boost-in-SDK-examples.patch +%patch61 -p1 -b .Keep-using-component_getImplementationEnvironment-in.patch +%patch62 -p1 -b .Avoid-inaccurate-floating-point-computations.patch +%patch63 -p1 -b .fdo-72850-ODF-export-don-t-export-spurious-style-dis.patch +%patch64 -p1 -b .m_bHasActive-must-be-false-after-last-visible-entry-.patch +%patch65 -p1 -b .fdo-60705-Don-t-discard-valid-printing-options.patch +%patch66 -p1 -b .fdo-70232-sw-brown-paper-bag-fix-for-header-sharing-.patch +%patch67 -p1 -b .fdo-69065-sw-fix-mirrored-page-style-with-first-page.patch +%patch68 -p1 -b .fdo-71429-sw-fix-crashes-when-changing-header-first-.patch +%patch69 -p1 -b .XMLPropertyMapEntry-mbImportOnly-and-XMLPropertySetM.patch +%patch70 -p1 -b .prepare-to-read-loext-vertical-justify-fdo-72922.patch +%patch71 -p1 -b .prepare-to-accept-loext-contextual-spacing-fdo-58112.patch +%patch72 -p1 -b .fdo-67370-Hyphens-are-not-visible-in-tagged-PDF.patch +%patch73 -p1 -b .fdo-72916-correct-rounding-of-time-part-of-DateTime.patch +%patch74 -p1 -b .Fix-stepping-to-the-next-change.patch +%patch75 -p1 -b .DOCX-import-close-rPrChange-properly.patch +%patch76 -p1 -b .fdo-65090-RTF-filter-import-RTF_CLMGF-and-RTF_CLMRG.patch +%patch77 -p1 -b .Resolves-fdo-72961-Crash-when-you-open-ODFver.1.0-1..patch +%patch78 -p1 -b .fdo-39206-Add-support-for-image-transformation-in-SV.patch +%patch79 -p1 -b .EMF-Integer-coordinate-values-are-signed.patch +%patch80 -p1 -b .EMF-actually-use-lineJoin-attribute-for-polygons.patch +%patch81 -p1 -b .EMF-mapping-can-rotate-the-width-vector-so-use-resul.patch +%patch82 -p1 -b .Resolves-fdo-72464-Character-line-break-is-set-to-0-.patch +%patch83 -p1 -b .Make-CalcFocusRect-look-right.patch +%patch84 -p1 -b .die-binfilter-die-die-die.patch +%patch85 -p1 -b .added-EEK-and-LVL-to-EUROCONVERT-EUR-to-LV-locale-da.patch +%patch86 -p1 -b .cp-2013101510000026-wrong-highlight-of-commented-tex.patch +%patch87 -p1 -b .cp-2013101510000026-fix-doc-export-of-comments-initi.patch +%patch88 -p1 -b .cp-2013101510000026-doc-export-of-commented-text-ran.patch +%patch89 -p1 -b .cp-2013101510000026-doc-import-of-comments-affecting.patch +%patch90 -p1 -b .pages-with-equal-Priority-and-Class-getting-dropped.patch +%patch91 -p1 -b .only-write-new-element-and-attributes-in-ODF-1.2-ext.patch +%patch92 -p1 -b .read-elements-attribs-written-to-extension-namespace.patch +%patch93 -p1 -b .cp-2013101510000026-fix-file-coruption-caused-by-com.patch +%patch94 -p1 -b .Fix-fdo-70807-Page-Style-method-isInUse-broken.patch +%patch95 -p1 -b .No-serviceNames-attribute-in-Loader.patch +%patch96 -p1 -b .n-839727-rhbz-1038176-Crash-fix.patch +%patch97 -p1 -b .fdo-72645-Allow-GETPIVOTDATA-to-get-result-from-leaf.patch +%patch98 -p1 -b .fdo-72645-Case-insensitive-string-comparison-in-GETP.patch +%patch99 -p1 -b .fdo-72774-Ensure-that-all-the-group-fields-are-in-ca.patch +%patch100 -p1 -b .fdo-72774-Generate-correct-group-items-for-the-year-.patch +%patch101 -p1 -b .fix-occasional-crash-on-dragging-and-dropping-pages-.patch +%patch102 -p1 -b .fdo-37167-create-statement-before-execute-wasNull-ge.patch +%patch103 -p1 -b .fdo-72219-Fix-for-corruption-of-symbols-in-docx.patch # TODO: check this # these are horribly incomplete--empty translations and copied english @@ -1041,6 +1192,12 @@ cp -r translations/source/en-GB translations/source/ms cp -r translations/source/en-GB translations/source/ur %endif +# fdo#54514 fix Tango icon names +pushd icon-themes/tango/cmd + mv previouspage.png sc_previouspage.png + mv sc_gotoendodoc.png sc_gotoendofdoc.png +popd + %build echo build start time is `date`, diskspace: `df -h . | tail -n 1` echo building localizations: %{langpack_langs} @@ -2121,6 +2278,25 @@ update-desktop-database %{_datadir}/applications &> /dev/null || : %endif %changelog +* Fri Jan 24 2014 Daniel Mach - 1:4.1.4.2-3 +- Mass rebuild 2014-01-24 + +* Mon Jan 13 2014 Caolán McNamara - 1:4.1.4.2-2 +- Resolves: rhbz#1040777 rename "Oriya" to "Odia" + +* Wed Jan 08 2014 David Tardon - 1:4.1.4.2-1 +- Resolves: rhbz#1049791 rebase to 4.1.4 +- also add a load of 4.1.5 patches + +* Fri Dec 27 2013 Daniel Mach - 1:4.1.3.2-6 +- Mass rebuild 2013-12-27 + +* Wed Dec 11 2013 Caolán McNamara - 1:4.1.3.2-5 +- Resolves: rhbz#1035092 no shortcut key for Italian Tools + +* Tue Nov 12 2013 David Tardon - 1:4.1.3.2-4 +- Related: rhbz#1019277 fix rpmdiff problem + * Fri Nov 01 2013 David Tardon - 1:4.1.3.2-3 - Resolves: rhbz#1019277 rebase libreoffice to 4.1.3