Skip to content

Commit

Permalink
Quick and dirty fix for bug in property restoration logic
Browse files Browse the repository at this point in the history
  • Loading branch information
greg42 committed Aug 20, 2024
1 parent ac4c535 commit 78cffe7
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions OpenOfficeIntegration/Renderer/Renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1023,11 +1023,13 @@ def insert_paragraph_character(self, avoid_empty_paragraph=True):
# Evil hack: restore the last property set again in case we haven't moved
# the cursor since.
if self._lastRestored:
(where, what) = self._lastRestored
testCursor = self._cursor.getText().createTextCursorByRange(where)
testCursor.gotoRange(beforeNewPara, True)
if testCursor.isCollapsed():
self.restorePropertySet(what)
try:
(where, what) = self._lastRestored
testCursor = self._cursor.getText().createTextCursorByRange(where)
testCursor.gotoRange(beforeNewPara, True)
if testCursor.isCollapsed():
self.restorePropertySet(what)
except: pass

self._lastRestored = None

Expand Down

0 comments on commit 78cffe7

Please sign in to comment.