sd/source/filter/eppt/eppt.cxx   |   21 ++++++++++++++++-----
 sd/source/filter/eppt/eppt.hxx   |    4 ++++
 sfx2/source/control/unoctitm.cxx |    4 +++-
 3 files changed, 23 insertions(+), 6 deletions(-)

New commits:
commit 21dccc044e11fb8d03bc9716ef3fffc885198c84
Author:     Mike Kaganski <[email protected]>
AuthorDate: Sun Jun 16 16:02:40 2024 +0500
Commit:     Xisco Fauli <[email protected]>
CommitDate: Fri Jun 21 12:44:47 2024 +0200

    LOK: Send view modes status change notifications
    
    Change-Id: If9a36dcd447eef355f137b5afe16f917e9c0cfa3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168960
    Reviewed-by: Mike Kaganski <[email protected]>
    Tested-by: Jenkins
    (cherry picked from commit a14ec822c9c571a32eb0565158f1976b2d0dbf28)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168943
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 6dd55fc06a2d..7e82656ab178 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -940,7 +940,9 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, 
SfxViewFrame* pViewFra
         aEvent.FeatureURL.Path == "SpacePara15" ||
         aEvent.FeatureURL.Path == "SpacePara2" ||
         aEvent.FeatureURL.Path == "DataFilterAutoFilter" ||
-        aEvent.FeatureURL.Path == "CellProtection")
+        aEvent.FeatureURL.Path == "CellProtection" ||
+        aEvent.FeatureURL.Path == "NormalMultiPaneGUI" ||
+        aEvent.FeatureURL.Path == "NotesMode")
     {
         bool bTemp = false;
         aEvent.State >>= bTemp;
commit aabca2276e0fea69cc59a51850b3f3bb22afc338
Author:     Samuel Mehrbrodt <[email protected]>
AuthorDate: Thu Jun 13 19:26:04 2024 +0200
Commit:     Xisco Fauli <[email protected]>
CommitDate: Fri Jun 21 12:44:33 2024 +0200

    ppt: Don't export notes author/date when in privacy mode
    
    Change-Id: Id748b79e7685f5e99df142aa2aa9449a18a32d5c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168821
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <[email protected]>
    Signed-off-by: Xisco Fauli <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168988

diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx
index 32af30aecd97..bb0544c5d068 100644
--- a/sd/source/filter/eppt/eppt.cxx
+++ b/sd/source/filter/eppt/eppt.cxx
@@ -42,6 +42,7 @@
 #include <com/sun/star/task/XStatusIndicator.hpp>
 #include <comphelper/sequence.hxx>
 #include <tools/zcodec.hxx>
+#include <unotools/securityoptions.hxx>
 #include <filter/msfilter/classids.hxx>
 #include <filter/msfilter/msoleexp.hxx>
 #include <filter/msfilter/msdffimp.hxx>
@@ -82,6 +83,7 @@ PPTWriter::PPTWriter( rtl::Reference<SotStorage> xSvStorage,
     mpVBA                   ( pVBA ),
     mnExEmbed               ( 0 ),
     mpExEmbed               ( new SvMemoryStream ),
+    mpAuthorIDs             ( new SvtSecurityMapPersonalInfo ),
     mnPagesWritten          ( 0 ),
     mnTxId                  ( 0x7a2f64 ),
     mnDiaMode               ( 0 ),
@@ -149,8 +151,6 @@ void PPTWriter::exportPPTPost( )
     mbStatus = true;
 };
 
-static void ImplExportComments( const uno::Reference< drawing::XDrawPage >& 
xPage, SvMemoryStream& rBinaryTagData10Atom );
-
 void PPTWriter::ImplWriteSlide( sal_uInt32 nPageNum, sal_uInt32 nMasterNum, 
sal_uInt16 nMode,
                                 bool bHasBackground, Reference< XPropertySet > 
const & aXBackgroundPropSet )
 {
@@ -1056,13 +1056,20 @@ static OUString getInitials( const OUString& rName )
     return sInitials.makeStringAndClear();
 }
 
-void ImplExportComments( const uno::Reference< drawing::XDrawPage >& xPage, 
SvMemoryStream& rBinaryTagData10Atom )
+
+void PPTWriter::ImplExportComments( const uno::Reference< drawing::XDrawPage 
>& xPage, SvMemoryStream& rBinaryTagData10Atom )
 {
     try
     {
         uno::Reference< office::XAnnotationAccess > xAnnotationAccess( xPage, 
uno::UNO_QUERY_THROW );
         uno::Reference< office::XAnnotationEnumeration > 
xAnnotationEnumeration( xAnnotationAccess->createAnnotationEnumeration() );
 
+        bool bRemoveCommentAuthorDates
+            = SvtSecurityOptions::IsOptionSet(
+                  SvtSecurityOptions::EOption::DocWarnRemovePersonalInfo)
+              && !SvtSecurityOptions::IsOptionSet(
+                     
SvtSecurityOptions::EOption::DocWarnKeepNoteAuthorDateInfo);
+
         sal_Int32 nIndex = 1;
 
         while( xAnnotationEnumeration->hasMoreElements() )
@@ -1075,11 +1082,15 @@ void ImplExportComments( const uno::Reference< 
drawing::XDrawPage >& xPage, SvMe
                 Point aPoint(o3tl::convert(aRealPoint2D.X, o3tl::Length::mm, 
o3tl::Length::master),
                              o3tl::convert(aRealPoint2D.Y, o3tl::Length::mm, 
o3tl::Length::master));
 
-                OUString sAuthor( xAnnotation->getAuthor() );
+                OUString sAuthor( bRemoveCommentAuthorDates
+                            ? "Author" + 
OUString::number(mpAuthorIDs->GetInfoID(xAnnotation->getAuthor() ))
+                            : xAnnotation->getAuthor() );
                 uno::Reference< text::XText > xText( 
xAnnotation->getTextRange() );
                 OUString sText( xText->getString() );
                 OUString sInitials( getInitials( sAuthor ) );
-                util::DateTime aDateTime( xAnnotation->getDateTime() );
+                util::DateTime aEmptyDateTime;
+                util::DateTime aDateTime(bRemoveCommentAuthorDates ? 
aEmptyDateTime
+                                                                   : 
xAnnotation->getDateTime());
                 if ( !sAuthor.isEmpty() )
                     PPTWriter::WriteCString( rBinaryTagData10Atom, sAuthor );
                 if ( !sText.isEmpty() )
diff --git a/sd/source/filter/eppt/eppt.hxx b/sd/source/filter/eppt/eppt.hxx
index 1ef07d1dcff4..3d95b4380229 100644
--- a/sd/source/filter/eppt/eppt.hxx
+++ b/sd/source/filter/eppt/eppt.hxx
@@ -24,6 +24,7 @@
 #include "escherex.hxx"
 #include <sal/types.h>
 #include <sot/storage.hxx>
+#include <unotools/securityoptions.hxx>
 #include "pptexsoundcollection.hxx"
 
 #include "text.hxx"
@@ -138,6 +139,7 @@ class PPTWriter final : public PPTWriterBase, public 
PPTExBulletProvider
         SvMemoryStream*     mpVBA;
         sal_uInt32          mnExEmbed;
         std::unique_ptr<SvMemoryStream> mpExEmbed;
+        std::unique_ptr<SvtSecurityMapPersonalInfo> mpAuthorIDs; // map 
authors to remove personal info
 
         sal_uInt32          mnPagesWritten;
         sal_uInt32          mnTxId;             // Identifier determined by 
the HOST (PP) ????
@@ -211,6 +213,8 @@ class PPTWriter final : public PPTWriterBase, public 
PPTExBulletProvider
 
         bool                ImplCloseDocument();        // we write the font, 
hyper and sound list
 
+        void                ImplExportComments(const 
css::uno::Reference<css::drawing::XDrawPage>& xPage,
+                                               SvMemoryStream& 
rBinaryTagData10Atom);
         virtual void        ImplWriteSlide( sal_uInt32 nPageNum, sal_uInt32 
nMasterID, sal_uInt16 nMode,
                                             bool bHasBackground, 
css::uno::Reference< css::beans::XPropertySet > const & aXBackgroundPropSet ) 
override;
         virtual void        ImplWriteNotes( sal_uInt32 nPageNum ) override;

Reply via email to