[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - 2 commits - svl/source sw/source
Eike Rathke (via logerrit)
logerrit at kemper.freedesktop.org
Fri Aug 7 06:35:55 UTC 2020
svl/source/numbers/zforfind.cxx | 13 +++++++++----
sw/source/core/doc/docdesc.cxx | 8 ++++++--
2 files changed, 15 insertions(+), 6 deletions(-)
New commits:
commit c5a90c8843e635317078307a26ab898b6cd4c95d
Author: Eike Rathke <erack at redhat.com>
AuthorDate: Thu Aug 6 01:40:04 2020 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Fri Aug 7 08:34:53 2020 +0200
Resolves: tdf#135249 Duration input 0:123 or 0:0:123 or 0:123:59 is valid
Change-Id: Ie624b324822495192edc65d046945eb92356550b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100192
Reviewed-by: Eike Rathke <erack at redhat.com>
Tested-by: Jenkins
(cherry picked from commit 1616b53292cdc22c04d07bb21e71bf43dcd22299)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100212
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index e1b7c856f6e4..11a3e637157e 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -980,6 +980,9 @@ bool ImpSvNumberInputScan::GetTimeRef( double& fOutNumber,
SAL_WARN( "svl.numbers", "ImpSvNumberInputScan::GetTimeRef: bad number index");
}
+ // 0:123 or 0:0:123 or 0:123:59 is valid
+ bool bAllowDuration = (nHour == 0 && !nAmPm);
+
if (nAmPm && nHour > 12) // not a valid AM/PM clock time
{
bRet = false;
@@ -1000,16 +1003,18 @@ bool ImpSvNumberInputScan::GetTimeRef( double& fOutNumber,
else if (nIndex - nStartIndex < nCnt)
{
nMinute = static_cast<sal_uInt16>(sStrArray[nNums[nIndex++]].toInt32());
- if (!(eInputOptions & SvNumInputOptions::LAX_TIME)
+ if (!(eInputOptions & SvNumInputOptions::LAX_TIME) && !bAllowDuration
&& nIndex > 1 && nMinute > 59)
- bRet = false; // 1:60 or 1:123 is invalid, 123:1 is valid
+ bRet = false; // 1:60 or 1:123 is invalid, 123:1 or 0:123 is valid
+ if (bAllowDuration)
+ bAllowDuration = (nMinute == 0);
}
if (nIndex - nStartIndex < nCnt)
{
nSecond = static_cast<sal_uInt16>(sStrArray[nNums[nIndex++]].toInt32());
- if (!(eInputOptions & SvNumInputOptions::LAX_TIME)
+ if (!(eInputOptions & SvNumInputOptions::LAX_TIME) && !bAllowDuration
&& nIndex > 1 && nSecond > 59 && !(nHour == 23 && nMinute == 59 && nSecond == 60))
- bRet = false; // 1:60 or 1:123 or 1:1:123 is invalid, 123:1 or 123:1:1 is valid, or leap second
+ bRet = false; // 1:60 or 1:123 or 1:1:123 is invalid, 123:1 or 123:1:1 or 0:0:123 is valid, or leap second
}
if (nIndex - nStartIndex < nCnt)
{
commit 306c700716ff552cb8036cd7363ab8c8bc96224b
Author: Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Tue Aug 4 12:26:23 2020 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Fri Aug 7 08:34:53 2020 +0200
tdf#135144 sw: copy bookmarks in SwDoc::CopyMasterHeader()
... and SwDoc::CopyMasterFooter(); this is the same as commit
9f7ee38acec0cb614e37aecc5ea9c5f1c63b61b6 but for 2 other functions that
do the same thing.
Change-Id: Id7ed449a004ee3c9452d4603bf8632e2720651ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100077
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl at cib.de>
(cherry picked from commit af38654b4b8388f0a0236601742b7ab3d1590ae8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100059
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index d1cc84f8d8e3..e6f9fed947a3 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -293,7 +293,9 @@ void SwDoc::CopyMasterHeader(const SwPageDesc &rChged, const SwFormatHeader &rHe
GetNodes().Copy_( aRange, aTmp, false );
aTmp = *pSttNd;
GetDocumentContentOperationsManager().CopyFlyInFlyImpl(aRange, nullptr, aTmp);
-
+ SwPaM const source(aRange.aStart, aRange.aEnd);
+ SwPosition dest(aTmp);
+ sw::CopyBookmarks(source, dest);
pFormat->SetFormatAttr( SwFormatContent( pSttNd ) );
rDescFrameFormat.SetFormatAttr( SwFormatHeader( pFormat ) );
}
@@ -365,7 +367,9 @@ void SwDoc::CopyMasterFooter(const SwPageDesc &rChged, const SwFormatFooter &rFo
GetNodes().Copy_( aRange, aTmp, false );
aTmp = *pSttNd;
GetDocumentContentOperationsManager().CopyFlyInFlyImpl(aRange, nullptr, aTmp);
-
+ SwPaM const source(aRange.aStart, aRange.aEnd);
+ SwPosition dest(aTmp);
+ sw::CopyBookmarks(source, dest);
pFormat->SetFormatAttr( SwFormatContent( pSttNd ) );
rDescFrameFormat.SetFormatAttr( SwFormatFooter( pFormat ) );
}
More information about the Libreoffice-commits
mailing list