summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMéven Car <meven.car@collabora.com>2024-02-20 12:51:39 +0100
committerMiklos Vajna <vmiklos@collabora.com>2024-03-14 08:15:33 +0100
commitb951c57d4b723621d211b552f2cd238ae0dc246a (patch)
tree38969c36f521553f79c22a1989ffcd09cb038659 /sd
parent7450af4f2545446574c7ce0b5b56aaaddffd486c (diff)
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 <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/tiledrendering/data/test.ppsxbin0 -> 32452 bytes
-rw-r--r--sd/qa/unit/tiledrendering/tiledrendering.cxx21
-rw-r--r--sd/source/ui/view/ViewShellBase.cxx6
3 files changed, 27 insertions, 0 deletions
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
--- /dev/null
+++ b/sd/qa/unit/tiledrendering/data/test.ppsx
Binary files 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