Skip to content

Commit

Permalink
Impress: part and mode can not be obtained while creating pages.
Browse files Browse the repository at this point in the history
Issue:
 In Impress:
* Switch to notes view.
* Switch back to normal view.
* Edit text on the page.
* Switch to notes view again.
* See that the notes view page preview is not updated.

It seems that while switching to notes view, a new page class instance is created for the note.
Before the creation, invalidate tiles callback is called.
Whilst the creation, selected part and edit mode is not accessible.
So the INVALIDATE_TILES callback has edit mode and part number 0.
This commit fetches the part and edit mode when all the tiles are invalidated.

Signed-off-by: Gökay Şatır <[email protected]>
Change-Id: I73ab8d436617f06bf573c93bbabae93a2ff6c8cb
  • Loading branch information
gokaysatir committed Jan 7, 2025
1 parent 03f9cf4 commit 72f939a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kit/ChildSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3417,8 +3417,9 @@ void ChildSession::loKitCallback(const int type, const std::string& payload)
else if (tokens.size() == 3 && tokens.equals(0, "EMPTY"))
{
// with mode: "EMPTY, <part>, <mode>"
const std::string part = (_docType != "text" ? tokens[1].c_str() : "0"); // Writer renders everything as part 0.
const std::string mode = (_docType != "text" ? tokens[2].c_str() : "0"); // Writer is not using mode.
std::string part = (_docType != "text" ? std::to_string(getLOKitDocument()->getPart()) : "0"); // Writer renders everything as part 0.
std::string mode = (_docType != "text" ? std::to_string(getLOKitDocument()->getEditMode()) : "0"); // Writer is not using mode.

sendTextFrame("invalidatetiles: EMPTY, " + part + ", " + mode +
" wid=" + std::to_string(getCurrentWireId()));
}
Expand Down

0 comments on commit 72f939a

Please sign in to comment.