sd/qa/unit/tiledrendering/data/test.ppsx     |binary
 sd/qa/unit/tiledrendering/tiledrendering.cxx |   21 +++++++++++++++++++++
 sd/source/ui/view/ViewShellBase.cxx          |    6 ++++++
 3 files changed, 27 insertions(+)

New commits:
commit b951c57d4b723621d211b552f2cd238ae0dc246a
Author:     Méven Car <meven....@collabora.com>
AuthorDate: Tue Feb 20 12:51:39 2024 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Thu Mar 14 08:15:33 2024 +0100

    Impress: transmit document's property StartWithPresentation
    
    This is transmitted as stateChanged event.
    
    This property is set for ppsx/pps files.
    
    Change-Id: Ic2f495cb9923b385bce7d93a2d8121d2945221ab
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163652
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sd/qa/unit/tiledrendering/data/test.ppsx 
b/sd/qa/unit/tiledrendering/data/test.ppsx
new file mode 100644
index 000000000000..2b955adeca97
Binary files /dev/null and b/sd/qa/unit/tiledrendering/data/test.ppsx differ
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 31d61c1fb1a0..e9a3f0f81e38 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -778,6 +778,7 @@ public:
     bool m_bViewLock;
     bool m_bTilesInvalidated;
     std::vector<tools::Rectangle> m_aInvalidations;
+    std::vector<std::string> m_aStateChanged;
     std::map<int, bool> m_aViewCursorInvalidations;
     std::map<int, bool> m_aViewCursorVisibilities;
     bool m_bViewSelectionSet;
@@ -895,6 +896,13 @@ public:
             m_aCommentCallbackResult = 
m_aCommentCallbackResult.get_child("comment");
         }
         break;
+        case LOK_CALLBACK_STATE_CHANGED:
+        {
+            std::stringstream aStream(pPayload);
+
+            m_aStateChanged.push_back(aStream.str());
+        }
+        break;
         }
     }
 };
@@ -2942,6 +2950,19 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, 
testShapeEditInMultipleViews)
     }
 }
 
+CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testStartPresentation)
+{
+    SdXImpressDocument* pXImpressDocument = createDoc("test.ppsx");
+    ViewCallback aView1;
+    CPPUNIT_ASSERT(pXImpressDocument->GetDoc()->IsStartWithPresentation());
+    Scheduler::ProcessEventsToIdle();
+
+    CPPUNIT_ASSERT(aView1.m_aStateChanged.size() >= 1);
+
+    CPPUNIT_ASSERT(std::find(aView1.m_aStateChanged.begin(),
+        aView1.m_aStateChanged.end(), ".uno:StartWithPresentation=true") != 
aView1.m_aStateChanged.end());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/view/ViewShellBase.cxx 
b/sd/source/ui/view/ViewShellBase.cxx
index 70691ce1133e..b308ad108b0a 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -1023,6 +1023,12 @@ void ViewShellBase::afterCallbackRegistered()
         std::set<Color> aDocumentColors = pDocShell->GetDocColors();
         svx::theme::notifyLOK(pThemeColors, aDocumentColors);
     }
+
+    if (mpDocument && mpDocument->IsStartWithPresentation())
+    {
+        this->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED,
+                                        
".uno:StartWithPresentation=true"_ostr);
+    }
 }
 
 void ViewShellBase::NotifyCursor(SfxViewShell* pOtherShell) const

Reply via email to