From b477b14958990a213417d2c3d06f124817c2d05e Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Oct 09 2014 19:43:42 +0000 Subject: InsertCurrentTime: in input mode inherit matching format if set --- diff --git a/0001-InsertCurrentTime-in-input-mode-inherit-matching-for.patch b/0001-InsertCurrentTime-in-input-mode-inherit-matching-for.patch new file mode 100644 index 0000000..9e46a18 --- /dev/null +++ b/0001-InsertCurrentTime-in-input-mode-inherit-matching-for.patch @@ -0,0 +1,103 @@ +From 9f6f54567b9179d7c9918f36bb87382072e2660b Mon Sep 17 00:00:00 2001 +Message-Id: <9f6f54567b9179d7c9918f36bb87382072e2660b.1412882640.git.erack@redhat.com> +From: Eike Rathke +Date: Thu, 9 Oct 2014 21:10:35 +0200 +Subject: [PATCH] InsertCurrentTime: in input mode inherit matching format if + set +MIME-Version: 1.0 +Content-Type: multipart/mixed; boundary="------------erAck-patch-parts" + +This is a multi-part message in MIME format. +--------------erAck-patch-parts +Content-Type: text/plain; charset=UTF-8; format=fixed +Content-Transfer-Encoding: 8bit + + +In case a date or time cell format was set, inherit that format for +Ctrl+; or Ctrl+: date/time insertion while editing the cell. + +Change-Id: If13e680fc74ab36611f8c11d992dba4b9c91ddb4 +(cherry picked from commit 980fd719648fb5b7cbe93ba23c1ee2f180ffcee8) +--- + sc/source/ui/view/viewfun6.cxx | 24 +++++++++++++++++------- + 1 file changed, 17 insertions(+), 7 deletions(-) + + +--------------erAck-patch-parts +Content-Type: text/x-patch; name="0001-InsertCurrentTime-in-input-mode-inherit-matching-for.patch" +Content-Transfer-Encoding: 8bit +Content-Disposition: attachment; filename="0001-InsertCurrentTime-in-input-mode-inherit-matching-for.patch" + +diff --git a/sc/source/ui/view/viewfun6.cxx b/sc/source/ui/view/viewfun6.cxx +index a55dec3..3b25d32 100644 +--- a/sc/source/ui/view/viewfun6.cxx ++++ b/sc/source/ui/view/viewfun6.cxx +@@ -268,22 +268,29 @@ void ScViewFunc::InsertCurrentTime(short nReqFmt, const OUString& rUndoStr) + const sal_uInt32 nCurNumFormat = rDoc.GetNumberFormat(aCurPos); + SvNumberFormatter* pFormatter = rDoc.GetFormatTable(); + const SvNumberformat* pCurNumFormatEntry = pFormatter->GetEntry(nCurNumFormat); ++ const short nCurNumFormatType = (pCurNumFormatEntry ? ++ (pCurNumFormatEntry->GetType() & ~NUMBERFORMAT_DEFINED) : NUMBERFORMAT_UNDEFINED); + + if (bInputMode) + { + double fVal = 0.0; ++ sal_uInt32 nFormat = 0; + switch (nReqFmt) + { + case NUMBERFORMAT_DATE: + { + Date aActDate( Date::SYSTEM ); + fVal = aActDate - *pFormatter->GetNullDate(); ++ if (nCurNumFormatType == NUMBERFORMAT_DATE) ++ nFormat = nCurNumFormat; + } + break; + case NUMBERFORMAT_TIME: + { + Time aActTime( Time::SYSTEM ); + fVal = aActTime.GetTimeInDays(); ++ if (nCurNumFormatType == NUMBERFORMAT_TIME) ++ nFormat = nCurNumFormat; + } + break; + default: +@@ -294,15 +301,20 @@ void ScViewFunc::InsertCurrentTime(short nReqFmt, const OUString& rUndoStr) + { + DateTime aActDateTime( DateTime::SYSTEM ); + fVal = aActDateTime - DateTime( *pFormatter->GetNullDate()); ++ if (nCurNumFormatType == NUMBERFORMAT_DATETIME) ++ nFormat = nCurNumFormat; + } + break; + } + +- LanguageType nLang = (pCurNumFormatEntry ? pCurNumFormatEntry->GetLanguage() : ScGlobal::eLnge); +- sal_uInt32 nFormat = pFormatter->GetStandardFormat( nReqFmt, nLang); +- // This would return a more precise format with seconds and 100th +- // seconds for a time request. +- //nFormat = pFormatter->GetStandardFormat( fVal, nFormat, nReqFmt, nLang); ++ if (!nFormat) ++ { ++ const LanguageType nLang = (pCurNumFormatEntry ? pCurNumFormatEntry->GetLanguage() : ScGlobal::eLnge); ++ nFormat = pFormatter->GetStandardFormat( nReqFmt, nLang); ++ // This would return a more precise format with seconds and 100th ++ // seconds for a time request. ++ //nFormat = pFormatter->GetStandardFormat( fVal, nFormat, nReqFmt, nLang); ++ } + OUString aString; + Color* pColor; + pFormatter->GetOutputString( fVal, nFormat, aString, &pColor); +@@ -318,8 +330,6 @@ void ScViewFunc::InsertCurrentTime(short nReqFmt, const OUString& rUndoStr) + } + else + { +- const short nCurNumFormatType = (pCurNumFormatEntry ? +- (pCurNumFormatEntry->GetType() & ~NUMBERFORMAT_DEFINED) : NUMBERFORMAT_UNDEFINED); + bool bForceReqFmt = false; + const double fCell = rDoc.GetValue( aCurPos); + // Combine requested date/time stamp with existing cell time/date, if any. + +--------------erAck-patch-parts-- + + diff --git a/libreoffice.spec b/libreoffice.spec index c6d149b..3187f6c 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -36,7 +36,7 @@ Summary: Free Software Productivity Suite Name: libreoffice Epoch: 1 Version: %{libo_version}.3 -Release: 8%{?libo_prerelease}%{?dist} +Release: 9%{?libo_prerelease}%{?dist} License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and Artistic and MPLv2.0 Group: Applications/Productivity URL: http://www.libreoffice.org/ @@ -318,6 +318,7 @@ Patch63: 0001-default-n-up-printing-of-notes-to-sensible-2-x-1-not.patch Patch64: 0001-n-up-printing-done-by-vcl-brochures-by-draw-impress.patch Patch65: 0001-fdo-79604-sw-fix-clicking-on-hyper-links-in-Draw-obj.patch Patch66: 0001-Remove-smb-from-X-KDE-Protocols-lines.patch +Patch67: 0001-InsertCurrentTime-in-input-mode-inherit-matching-for.patch %define instdir %{_libdir} %define baseinstdir %{instdir}/libreoffice @@ -2259,6 +2260,9 @@ update-desktop-database %{_datadir}/applications &> /dev/null || : %endif %changelog +* Thu Oct 09 2014 Eike Rathke - 1:4.2.6.3-9-UNBUILT +- InsertCurrentTime: in input mode inherit matching format if set + * Wed Oct 08 2014 Stephan Bergmann - 1:4.2.6.3-8 - Resolves: fdo#79604 sw: fix clicking on hyper-links in Draw objects - Resolves: rhbz#1054952 bad access of smb URLs on KDE