summaryrefslogtreecommitdiff
path: root/sw/source/core/view/viewsh.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/view/viewsh.cxx')
-rw-r--r--sw/source/core/view/viewsh.cxx41
1 files changed, 41 insertions, 0 deletions
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index c5d20fe38d88..e30fc909eaad 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -81,6 +81,9 @@
#include <vcl/sysdata.hxx>
#endif
+#include <frameformats.hxx>
+#include <fmtcntnt.hxx>
+
bool SwViewShell::mbLstAct = false;
ShellResource *SwViewShell::mpShellRes = nullptr;
vcl::DeleteOnDeinit<std::shared_ptr<weld::Window>> SwViewShell::mpCareDialog(new std::shared_ptr<weld::Window>);
@@ -655,6 +658,44 @@ void SwViewShell::UpdateFields(bool bCloseDB)
EndAction();
}
+void SwViewShell::UpdateOleObjectPreviews()
+{
+ SwDoc* pDoc = GetDoc();
+ const SwFrameFormats* const pFormats = pDoc->GetSpzFrameFormats();
+ if (pFormats->empty())
+ {
+ return;
+ }
+
+ for (size_t i = 0; i < pFormats->size(); ++i)
+ {
+ SwFrameFormat* pFormat = (*pFormats)[i];
+ if (pFormat->Which() != RES_FLYFRMFMT)
+ {
+ continue;
+ }
+
+ const SwNodeIndex* pNodeIndex = pFormat->GetContent().GetContentIdx();
+ if (!pNodeIndex || !pNodeIndex->GetNodes().IsDocNodes())
+ {
+ continue;
+ }
+
+ SwNode* pNode = pDoc->GetNodes()[pNodeIndex->GetIndex() + 1];
+ SwOLENode* pOleNode = pNode->GetOLENode();
+ if (!pOleNode)
+ {
+ continue;
+ }
+
+ SwOLEObj& rOleObj = pOleNode->GetOLEObj();
+ svt::EmbeddedObjectRef& rObject = rOleObj.GetObject();
+ rObject.UpdateReplacement();
+ // Trigger the repaint.
+ pOleNode->SetChanged();
+ }
+}
+
/** update all charts for which any table exists */
void SwViewShell::UpdateAllCharts()
{