external/libodfgen/0001-tdf-101077-make-double-string-conversion-locale-agno.patch.1 | 58 ++++++++++ external/libodfgen/UnpackedTarball_libodfgen.mk | 3 framework/source/services/autorecovery.cxx | 13 ++ i18npool/source/localedata/data/be_BY.xml | 9 + sc/source/core/data/column4.cxx | 14 ++ sc/source/core/tool/interpr4.cxx | 15 ++ sc/source/ui/cctrl/checklistmenu.cxx | 5 7 files changed, 111 insertions(+), 6 deletions(-)
New commits: commit 99512804d2614014831be31f488d17250554d9bc Author: David Tardon <dtar...@redhat.com> Date: Fri Aug 12 13:11:38 2016 +0200 tdf#101077 make double->str conv. locale-agnostic Change-Id: Ibb87f4a14fda6957149ca52083387760ff6e60a3 (cherry picked from commit 8d26a169794083f047a57e5c8d3f5da0aaab2583) Reviewed-on: https://gerrit.libreoffice.org/28081 Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Jenkins <c...@libreoffice.org> (cherry picked from commit fc79186d80ffa8e734727c555456165af6dd51c4) diff --git a/external/libodfgen/0001-tdf-101077-make-double-string-conversion-locale-agno.patch.1 b/external/libodfgen/0001-tdf-101077-make-double-string-conversion-locale-agno.patch.1 new file mode 100644 index 0000000..1fc4e6b --- /dev/null +++ b/external/libodfgen/0001-tdf-101077-make-double-string-conversion-locale-agno.patch.1 @@ -0,0 +1,58 @@ +From 68e0c8e4c834df57bc9a0e8da72151f69ff5e7a6 Mon Sep 17 00:00:00 2001 +From: David Tardon <dtar...@redhat.com> +Date: Fri, 12 Aug 2016 12:50:39 +0200 +Subject: [PATCH] tdf#101077 make double->string conversion locale-agnostic + +--- + src/OdsGenerator.cxx | 19 +++++++++++++++++-- + 1 file changed, 17 insertions(+), 2 deletions(-) + +diff --git a/src/OdsGenerator.cxx b/src/OdsGenerator.cxx +index 52e135e..8cb7203 100644 +--- a/src/OdsGenerator.cxx ++++ b/src/OdsGenerator.cxx +@@ -26,6 +26,8 @@ + + #include <librevenge/librevenge.h> + ++#include <iomanip> ++#include <locale> + #include <map> + #include <stack> + #include <sstream> +@@ -46,6 +48,19 @@ + #include "OdcGenerator.hxx" + #include "OdfGenerator.hxx" + ++namespace ++{ ++ ++librevenge::RVNGString makePreciseStr(const double value) ++{ ++ std::ostringstream os; ++ os.imbue(std::locale::classic()); ++ os << std::fixed << std::setprecision(8) << value; ++ return os.str().c_str(); ++} ++ ++} ++ + class OdsGeneratorPrivate : public OdfGenerator + { + public: +@@ -968,10 +983,10 @@ void OdsGenerator::openSheetCell(const librevenge::RVNGPropertyList &propList) + // we need the maximum precision here, so we must avoid getStr() when possible + librevenge::RVNGString value; + if (propList["librevenge:value"]->getUnit()==librevenge::RVNG_GENERIC) +- value.sprintf("%.8f", propList["librevenge:value"]->getDouble()); ++ value = makePreciseStr(propList["librevenge:value"]->getDouble()); + else if (propList["librevenge:value"]->getUnit()==librevenge::RVNG_PERCENT) + { +- value.sprintf("%.8f", propList["librevenge:value"]->getDouble()*100.); ++ value = makePreciseStr(propList["librevenge:value"]->getDouble()*100.); + value.append('%'); + } + else +-- +2.7.4 + diff --git a/external/libodfgen/UnpackedTarball_libodfgen.mk b/external/libodfgen/UnpackedTarball_libodfgen.mk index 3cbeb55..f6695d9 100644 --- a/external/libodfgen/UnpackedTarball_libodfgen.mk +++ b/external/libodfgen/UnpackedTarball_libodfgen.mk @@ -35,5 +35,8 @@ $(eval $(call gb_UnpackedTarball_add_patches,libodfgen, \ endif endif +$(eval $(call gb_UnpackedTarball_add_patches,libodfgen, \ + external/libodfgen/0001-tdf-101077-make-double-string-conversion-locale-agno.patch.1 \ +)) # vim: set noet sw=4 ts=4: commit 084427ccf6690ab80b7ee58d1475d4e528a30d82 Author: anwilli5 <anwil...@ncsu.edu> Date: Sun Jun 5 23:06:05 2016 -0400 tdf#96607 'Save as' doesn't update global auto-recovery state The auto-recovery service maintains a list of structures (one for each open document) containing information needed to carry out the auto-save functionality. One such piece of information is the location of the backup file, stored in a struct member named 'OldTempURL'. At every auto-save interval, this list is iterated through and a function (implts_saveOneDoc) is called during each iteration to save the current state of the associated document. The algorithm works as follows: 1. A new backup file URL is chosen so as not to conflict with any already existing backup files in the backup directory. This URL is based on the file name and incorporates a number (starting at 0) that is incremented until a name is chosen that doesn't conflict. 2. The document is saved to this new backup file URL 3. The previous backup file (indicated by its structure's 'OldTempURL') is deleted 4. The new backup file URL is stored (in its structure's 'OldTempURL') for the next time the file needs to be saved. Assuming you start with a new Writer doc and then make some changes, when it is time to auto-save, the backup file name 'untitled_0.odt' (excluding path) will be selected, the latest state of the open file will be written to that backup file, and the full URL for the backup file will be saved into the struct 'OldTempURL' member. The next time changes are made and an auto-save occurs, this algorithm will result in the name 'untitled_1.odt' being selected, the file contents saved into this new file, 'untitled_0.odt' being deleted, and the full URL for the new backup file being saved in 'OldTempURL'. The third time through results in 'untitled_0.odt' being selected (since this file doesn't exist on disk), and subsequent iterations of auto-saving cause the backup file name to alternate between the two aforementioned. The problem occurs during a 'Save as' operation. When this happens, the backup file is deleted (which is fine - it was just saved, and the next auto-save will back it up) but 'OldTempURL' is not properly reset (see below for more info.) During the next auto-save, 'untitled_0.odt' will be selected for the new backup file name (since no file exists by this name), and one of two things will happen (based on how many auto-saves have occurred): 1. 'OldTempURL' points to 'untitled_1.odt', and the algorithm above continues to work correctly (at least in that it continues to backup file contents.) 2. 'OldTempURL' points to 'untitled_0.odt', the name chosen for the new backup file. In this case, the document contents will be saved to this file (step 2) but then the file will be deleted (step 3). 'OldTempURL' will maintain this URL from then on out, causing this case to be hit for all future auto-save intervals. So, 50% of the time (30 minutes out of every hour) auto-save will stop backing up file contents on a 'Save as'. The function that handles the 'Save as' case (implts_markDocumentAsSaved) clears 'OldTempURL' and sets other relavent struct members for a local variable copy of the global struct, but doesn't copy them back. :( These changes are effectively lost when the function returns. There are several other cases where this appears to be happening as well, but more work is needed to determine whether this is actually the case: - implts_prepareSessionShutdown - implts_saveDocs, handling the 'dangerousDocs' and in a few other places - implts_openDocs - implts_resetHandleStates Also, there is some JUnitTest code for auto-save, but it is currently disabled (and fails to run successfully.) It'd be great to get these working again, or to just write python equivalents. Implementing this would like take me a while, though, so for now I just tested manually to ensure that this fixes the issue. When I have some more time I'd like to work more on this, but I wanted to send this patch in for now to address bug #96607. This may also address bug #99890, since some of the struct members that don't make it into the global state relate to the file name. I haven't explicitly tested this case, though. Change-Id: Ic702d6f78e60c7cf828a1564ccca118dd45d152b Reviewed-on: https://gerrit.libreoffice.org/25948 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: jan iversen <j...@documentfoundation.org> Reviewed-on: https://gerrit.libreoffice.org/27921 Reviewed-by: Eike Rathke <er...@redhat.com> (cherry picked from commit e3759a3154de534a5edfd69f7face5b5c29c1ea9) diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index 7365cb7..5544819 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -2689,11 +2689,22 @@ void AutoRecovery::implts_markDocumentAsSaved(const css::uno::Reference< css::fr return; aInfo = *pIt; + /* Since the document has been saved, update its entry in the document + * cache. We essentially reset the state of the document from an + * autorecovery perspective, updating things like the filename (which + * would change in the case of a 'Save as' operation) and the associated + * backup file URL. */ + aInfo.DocumentState = AutoRecovery::E_UNKNOWN; // TODO replace getLocation() with getURL() ... it's a workaround currently only! css::uno::Reference< css::frame::XStorable > xDoc(aInfo.Document, css::uno::UNO_QUERY); aInfo.OrgURL = xDoc->getLocation(); + /* Save off the backup file URLs and then clear them. NOTE - it is + * important that we clear them - otherwise, we could enter a state + * where pIt->OldTempURL == pIt->NewTempURL and our backup algorithm + * in implts_saveOneDoc will write to that URL and then delete the file + * at that URL (bug #96607) */ sRemoveURL1 = aInfo.OldTempURL; sRemoveURL2 = aInfo.NewTempURL; aInfo.OldTempURL.clear(); @@ -2714,6 +2725,8 @@ void AutoRecovery::implts_markDocumentAsSaved(const css::uno::Reference< css::fr aInfo.UsedForSaving = false; + *pIt = aInfo; + } /* SAFE */ implts_flushConfigItem(aInfo); commit afa3f8c0b825f50c017dc48bffe74c15f6ec403f Author: Caolán McNamara <caol...@redhat.com> Date: Tue Aug 16 11:54:38 2016 +0100 Resolves: tdf#101165 crash on deselecting all filters (cherry picked from commit b101ff56e874824fa9f0d37a8468b07dbf3d002c) Change-Id: I49162bb73bf6dbef5cff68d35d10da2c47d9f2b5 Reviewed-on: https://gerrit.libreoffice.org/28165 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> (cherry picked from commit ecef794528282fa7e9fba93b6eff1dac097dae99) diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index e5897ec..9d3298e 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -1632,8 +1632,11 @@ SvTreeListEntry* ScCheckListBox::ShowCheckEntry( const OUString& sName, ScCheckL { if ( !pEntry ) { - if ( rMember.mbDate ) + if (rMember.mbDate) { + if (rMember.maDateParts.empty()) + return nullptr; + SvTreeListEntry* pYearEntry = FindEntry( nullptr, rMember.maDateParts[0] ); if ( !pYearEntry ) pYearEntry = InsertEntry( rMember.maDateParts[0], nullptr, true ); commit 823b610e750c60272af47e954817b0b3af01256f Author: Eike Rathke <er...@redhat.com> Date: Thu Aug 18 12:45:28 2016 +0200 Resolves: tdf#101572 New Belarusian Ruble BYN/Br for [be-BY] Change-Id: I742ca7ae410f49cfa84e595433b241c4a7ca9ecb (cherry picked from commit 92ba4bc561293cc29e4e92bc3791dd9db1da6b9c) Reviewed-on: https://gerrit.libreoffice.org/28214 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> (cherry picked from commit 3242a37f35d2691a7fe080e571c96ee8e40786c4) diff --git a/i18npool/source/localedata/data/be_BY.xml b/i18npool/source/localedata/data/be_BY.xml index 545ceeb..68f9642 100644 --- a/i18npool/source/localedata/data/be_BY.xml +++ b/i18npool/source/localedata/data/be_BY.xml @@ -387,13 +387,20 @@ </Calendar> </LC_CALENDAR> <LC_CURRENCY> - <Currency default="true" usedInCompatibleFormatCodes="true"> + <Currency default="false" usedInCompatibleFormatCodes="true"> <CurrencyID>BYR</CurrencyID> <CurrencySymbol>Ñ.</CurrencySymbol> <BankSymbol>BYR</BankSymbol> <CurrencyName>Ruble</CurrencyName> <DecimalPlaces>2</DecimalPlaces> </Currency> + <Currency default="true" usedInCompatibleFormatCodes="false"> + <CurrencyID>BYN</CurrencyID> + <CurrencySymbol>Br</CurrencySymbol> + <BankSymbol>BYN</BankSymbol> + <CurrencyName>New Belarusian Ruble</CurrencyName> + <DecimalPlaces>2</DecimalPlaces> + </Currency> </LC_CURRENCY> <LC_TRANSLITERATION ref="en_US"/> <LC_MISC> commit cfed2619b3a394fd6badadb2851cff898a1670bd Author: Eike Rathke <er...@redhat.com> Date: Fri Aug 5 21:01:49 2016 +0200 Resolves: rhbz#1364406 inherit the actual format index also for date and time So summing [HH]:MM cells or calculating with dates uses the same format in the result, not just the default format of a type. This also fixes the apparently broken state stored by 4.4 (and earlier, later?) where no type information was stored with the formula cell, which may be just due to the old behavior of not applying the actual format but determining it on the fly instead. Change-Id: I14d0a7d07185bf5c77e0d7f6989a4a1d1a468d27 (cherry picked from commit f2e3de4dfcf10f9a59f8fc3f051c620fd50ef3c2) Reviewed-on: https://gerrit.libreoffice.org/27917 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> (cherry picked from commit 6b63d44fee68a8db94b045c60767ee11a7265446) diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index 0642fcd..6bd15b7 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -4074,9 +4074,18 @@ StackVar ScInterpreter::Interpret() if ( nFuncFmtType != css::util::NumberFormat::UNDEFINED ) { nRetTypeExpr = nFuncFmtType; - // inherit the format index only for currency formats - nRetIndexExpr = ( nFuncFmtType == css::util::NumberFormat::CURRENCY ? - nFuncFmtIndex : 0 ); + // Inherit the format index for currency, date or time formats. + switch (nFuncFmtType) + { + case css::util::NumberFormat::CURRENCY: + case css::util::NumberFormat::DATE: + case css::util::NumberFormat::TIME: + case css::util::NumberFormat::DATETIME: + nRetIndexExpr = nFuncFmtIndex; + break; + default: + nRetIndexExpr = 0; + } } } commit f3033dbbdf68c89dcc31d6cdee82a57a4bb79cdb Author: Eike Rathke <er...@redhat.com> Date: Tue Aug 2 19:55:08 2016 +0200 Resolves: tdf#100582 SetMatColsRows() when constructing matrix ScFormulaCell ... from an ScFormulaCellGroup token array, because ScFormulaResult that holds the matrix dimensions is not cloned in that case as we don't clone from an ScFormulaCell. Change-Id: I13ab1b29db71ae1618580de995fe12ec423d4dc7 (cherry picked from commit c82a81bbda104ef08dd9e18725a09475b2d65183) Reviewed-on: https://gerrit.libreoffice.org/27809 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> (cherry picked from commit 10195ce5563d6ac93177b67d484151c01a751922) diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx index c2e5bc5..004e653 100644 --- a/sc/source/core/data/column4.cxx +++ b/sc/source/core/data/column4.cxx @@ -483,6 +483,16 @@ void ScColumn::CloneFormulaCell( sc::CellStoreType::iterator itPos = maCells.begin(); sc::CellTextAttrStoreType::iterator itAttrPos = maCellTextAttrs.begin(); + SCCOL nMatrixCols = 0; + SCROW nMatrixRows = 0; + sal_uInt8 nMatrixFlag = rSrc.GetMatrixFlag(); + if (nMatrixFlag == MM_FORMULA) + { + rSrc.GetMatColsRows( nMatrixCols, nMatrixRows); + SAL_WARN_IF( nMatrixCols != 1 || nMatrixRows != 1, "sc.core", + "ScColumn::CloneFormulaCell - cloning array/matrix with not exactly one column or row as single cell"); + } + std::vector<ScFormulaCell*> aFormulas; std::vector<sc::RowSpan>::const_iterator itSpan = rRanges.begin(), itSpanEnd = rRanges.end(); for (; itSpan != itSpanEnd; ++itSpan) @@ -514,7 +524,9 @@ void ScColumn::CloneFormulaCell( xGroup->compileCode(*pDocument, aPos, pDocument->GetGrammar()); for (size_t i = 0; i < nLen; ++i, aPos.IncRow()) { - ScFormulaCell* pCell = new ScFormulaCell(pDocument, aPos, xGroup, pDocument->GetGrammar(), rSrc.GetMatrixFlag()); + ScFormulaCell* pCell = new ScFormulaCell(pDocument, aPos, xGroup, pDocument->GetGrammar(), nMatrixFlag); + if (nMatrixFlag == MM_FORMULA) + pCell->SetMatColsRows( nMatrixCols, nMatrixRows); if (i == 0) { xGroup->mpTopCell = pCell;
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits