diff options
author | Andrzej Hunt <andrzej.hunt@collabora.com> | 2014-07-29 17:01:20 +0200 |
---|---|---|
committer | Andrzej Hunt <andrzej.hunt@collabora.com> | 2014-07-30 12:44:04 +0200 |
commit | af58bb8335416ac6416f7f4b6269337b2127ab08 (patch) | |
tree | 5d960866e60f382c6cbaea4b0805de5064fc12ff /desktop | |
parent | b3375a273e8030fd576e8094fe0890fab23362ea (diff) |
Protect setPartMode and ensure we actually show the new mode.
Change-Id: I3642702c5bf268f3c9ab04162166078052804270
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/lib/init.cxx | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 4de42e3c6da2..138b8f5dd3b5 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -504,7 +504,31 @@ static void doc_setPartMode(LibreOfficeKitDocument* pThis, return; } - pDoc->setPartMode(ePartMode); + Application::AcquireSolarMutex(1); + { + int nCurrentPart = pDoc->getPart(); + + pDoc->setPartMode(ePartMode); + + // We need to make sure the internal state is updated, just changing the mode + // might not update the relevant shells (i.e. impress will keep rendering the + // previous mode unless we do this). + // TODO: we might want to do this within the relevant components rather than + // here, but that's also dependent on how we implement embedded object + // rendering I guess? + // TODO: we could be clever and e.g. set to 0 when we change to/from + // embedded object mode, and not when changing between slide/notes/combined + // modes? + if ( nCurrentPart < pDoc->getParts() ) + { + pDoc->setPart( nCurrentPart ); + } + else + { + pDoc->setPart( 0 ); + } + } + Application::ReleaseSolarMutex(); } void doc_paintTile (LibreOfficeKitDocument* pThis, |