filter/source/svg/presentation_engine.js |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

New commits:
commit 0c9e914dc98179190994ee45405a1b38825cc4bc
Author:     nienzu <tommy...@ossii.com.tw>
AuthorDate: Thu Jul 2 12:07:41 2020 +0800
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Sep 9 14:07:07 2020 +0200

    tdf#134546 let users can present current page when using LibreOffice Online
    
    Change-Id: Ib6e1350519d1da5f704a4799a7cbcd1b76cdb050
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97690
    Tested-by: Jenkins
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>

diff --git a/filter/source/svg/presentation_engine.js 
b/filter/source/svg/presentation_engine.js
index cc67d3252a96..b4c8d3a63078 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -4752,6 +4752,14 @@ function getSafeIndex( nIndex, nMin, nMax )
         return nIndex;
 }
 
+function getUrlParameter(name)
+{
+    name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
+    var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
+    var results = regex.exec(window.location.search);
+    return results === null ? '' : 
decodeURIComponent(results[1].replace(/\+/g, ' '));
+}
+
 /** getRandomInt
  *
  * @param nMax
@@ -4873,6 +4881,12 @@ function MetaDocument()
             'MetaDocument: number of slides is zero or undefined.' );
     // - the index of the slide to show when the presentation starts;
     this.nStartSlideNumber = parseInt( aMetaDocElem.getAttributeNS( 
NSS['ooo'], aOOOAttrStartSlideNumber ) ) || 0;
+    // - get the parameter StartSlideNumber in the URL for online presentation
+    var aParmStartSlideNumber = getUrlParameter('StartSlideNumber');
+    if (aParmStartSlideNumber !== '')
+    {
+        this.nStartSlideNumber = parseInt(aParmStartSlideNumber);
+    }
     // - the numbering type used in the presentation, default type is arabic.
     this.sPageNumberingType = aMetaDocElem.getAttributeNS( NSS['ooo'], 
aOOOAttrNumberingType ) || 'arabic';
     // - the way text is exported
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to